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