--- xmil/z80x/z80xmem.x86 2004/08/01 05:31:32 1.1 +++ xmil/z80x/z80xmem.x86 2004/08/20 23:01:16 1.3 @@ -1,16 +1,16 @@ +%include '../z80x/z80x.inc' section .bss - extern _mMAIN - extern _RAM0r - extern _RAM0w + extern _z80core + extern _mainmem section .text - global @memrd8_ecx_al@4 - global @memwr8_ecx_dl@8 + global @z80mem_read8@4 + global @z80mem_write8@8 global lea_ecx_ecx global memfetch @@ -24,47 +24,47 @@ section .text align 16 lea_ecx_ecx: cmp ecx, 8000h jc short .low - add ecx, _mMAIN + add ecx, _mainmem ret -.low: add ecx, [_RAM0r] +.low: add ecx, [_z80core + z80core_t.memread] ret align 16 memfetch: cmp ecx, 8000h jc short .low - movzx eax, byte [_mMAIN + ecx] + movzx eax, byte [_mainmem + ecx] ret -.low: mov edx, [_RAM0r] +.low: mov edx, [_z80core + z80core_t.memread] movzx eax, byte [edx + ecx] ret align 16 -@memrd8_ecx_al@4: +@z80mem_read8@4: memrd8_ecx_al: cmp ecx, 8000h jc short .low - mov al, [_mMAIN + ecx] + mov al, [_mainmem + ecx] ret -.low: mov edx, [_RAM0r] +.low: mov edx, [_z80core + z80core_t.memread] mov al, [edx + ecx] ret align 16 memrd8_ecx_dl: cmp ecx, 8000h jc short .low - mov dl, [_mMAIN + ecx] + mov dl, [_mainmem + ecx] ret -.low: mov edx, [_RAM0r] +.low: mov edx, [_z80core + z80core_t.memread] mov dl, [edx + ecx] ret align 16 -@memwr8_ecx_dl@8: +@z80mem_write8@8: memwr8_ecx_dl: cmp ecx, 8000h jc short .low - mov [_mMAIN + ecx], dl + mov [_mainmem + ecx], dl ret -.low: mov eax, [_RAM0w] +.low: mov eax, [_z80core + z80core_t.memwrite] mov [eax + ecx], dl ret @@ -73,18 +73,18 @@ memrd16_ecx_ax: cmp cx, 0xffff jo short .a7fff js short .a8000 je short .affff - mov eax, [_RAM0r] + mov eax, [_z80core + z80core_t.memread] mov ax, [eax + ecx] ret -.a7fff: mov eax, [_RAM0r] +.a7fff: mov eax, [_z80core + z80core_t.memread] mov al, [eax + ecx] - mov ah, [_mMAIN + ecx + 1] + mov ah, [_mainmem + ecx + 1] ret -.a8000: mov ax, [_mMAIN + ecx] +.a8000: mov ax, [_mainmem + ecx] ret -.affff: mov eax, [_RAM0r] +.affff: mov eax, [_z80core + z80core_t.memread] mov ah, [eax] - mov al, [_mMAIN + ecx] + mov al, [_mainmem + ecx] ret align 16 @@ -92,17 +92,17 @@ memwr16_ecx_dx: cmp cx, 0xffff jo short .a7fff js short .a8000 je short .affff - mov eax, [_RAM0w] + mov eax, [_z80core + z80core_t.memwrite] mov [eax + ecx], dx ret -.a7fff: mov eax, [_RAM0w] - mov [_mMAIN + ecx + 1], dh +.a7fff: mov eax, [_z80core + z80core_t.memwrite] + mov [_mainmem + ecx + 1], dh mov [eax + ecx], dl ret -.a8000: mov [_mMAIN + ecx], dx +.a8000: mov [_mainmem + ecx], dx ret -.affff: mov eax, [_RAM0w] - mov [_mMAIN + ecx], dl +.affff: mov eax, [_z80core + z80core_t.memwrite] + mov [_mainmem + ecx], dl mov [eax], dh ret