From: Alan Cox Date: Fri, 15 Feb 2019 00:32:56 +0000 (+0000) Subject: v8080: update for the rst changes X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=666dde3c12663d57aacce07790f6bfe612c6d0eb;p=FUZIX.git v8080: update for the rst changes - Save BC - Only install the vectors for kernel - Use the rst routines from todays kernel --- diff --git a/Kernel/platform-v8080/rst.s b/Kernel/platform-v8080/rst.s index 28117b28..bec34667 100644 --- a/Kernel/platform-v8080/rst.s +++ b/Kernel/platform-v8080/rst.s @@ -1,75 +1,31 @@ #include "../kernel-8080.def" +.sect .text + +! Which resets we install are determined by statistical analysis of Star +! Trek. When changing these, make sure to update the i80 table to match. +! 97 call .floadn2 +! 41 call .floadn4 +! 34 call .fload4 +! 28 call .fstoren2 -.sect .common -! -! We need this in common because -! 1. We need to use .rst_init to install the hooks in other banks -! 2. User space also shares these rst handlers (why store them -! repeatedly). That does create an ABI concern but if it becomes a -! problem we just make user apps override -! .define .rst_init .rst_init: - mvi a, 0xc3 ! jmp - sta 0x08 - sta 0x10 - sta 0x18 - lxi h, rst1 - shld 0x09 - lxi h, rst2 - shld 0x11 - lxi h, rst3 - shld 0x19 - ret - - ! de = [bc+const1] (remember bc is the frame pointer) -rst1: - pop h - mov a, m - inx h - push h - - mov l, a - ral - sbb a - mov h, a - - dad b - mov e, m - inx h - mov d, m - ret - - ! [bc+const1] = de (remember bc is the frame pointer) -rst2: - pop h + lxi h, .floadn2 + lxi d, 0x0008 + call copy + lxi h, .floadn4 + call copy + lxi h, .fload4 + call copy + lxi h, .fstoren2 +! Copies eight bytes from HL to DE. +copy: + mvi c, 8 +.1: mov a, m + stax d inx h - push h - - mov l, a - ral - sbb a - mov h, a - - dad b - mov m, e - inx h - mov m, d - ret - - ! hl = bc+const1 -rst3: - pop h - mov a, m - inx h - push h - - mov l, a - ral - sbb a - mov h, a - - dad b - ret - \ No newline at end of file + inr e + dcr c + jnz .1 + ret \ No newline at end of file diff --git a/Kernel/platform-v8080/v8080.s b/Kernel/platform-v8080/v8080.s index 277480bd..9ee5d62d 100644 --- a/Kernel/platform-v8080/v8080.s +++ b/Kernel/platform-v8080/v8080.s @@ -59,11 +59,15 @@ _program_vectors: push h push d call map_process - call _program_vectors_k + call _program_vectors_u call map_kernel_di ret _program_vectors_k: + push b + call .rst_init + pop b +_program_vectors_u: mvi a,0xc3 sta 0 sta 0x30 @@ -77,7 +81,7 @@ _program_vectors_k: shld 0x39 lxi h,nmi_handler shld 0x67 - jmp .rst_init + ret ! ! Memory mapping