2019-04-16 17:00:19 -04:00
|
|
|
; *** JUMP TABLE ***
|
2019-05-17 09:50:11 -04:00
|
|
|
strncmp .equ 0x03
|
|
|
|
addDE .equ 0x06
|
|
|
|
addHL .equ 0x09
|
|
|
|
upcase .equ 0x0c
|
|
|
|
unsetZ .equ 0x0f
|
|
|
|
intoDE .equ 0x12
|
|
|
|
intoHL .equ 0x15
|
|
|
|
findchar .equ 0x18
|
2019-05-17 23:00:57 -04:00
|
|
|
parseHex .equ 0x1b
|
|
|
|
parseHexPair .equ 0x1e
|
|
|
|
blkSel .equ 0x21
|
|
|
|
fsFindFN .equ 0x24
|
|
|
|
fsOpen .equ 0x27
|
|
|
|
fsGetC .equ 0x2a
|
|
|
|
fsSeek .equ 0x2d
|
|
|
|
fsTell .equ 0x30
|
2019-05-09 14:09:40 -04:00
|
|
|
|
2019-05-16 21:15:00 -04:00
|
|
|
.equ FS_HANDLE_SIZE 8
|
2019-05-17 13:22:45 -04:00
|
|
|
.equ STDERR_PORT 0x04
|
2019-05-10 18:20:43 -04:00
|
|
|
.equ USER_CODE 0x4800
|
|
|
|
.equ RAMSTART 0x5800
|
2019-05-09 21:21:08 -04:00
|
|
|
.org USER_CODE
|
2019-05-17 13:22:45 -04:00
|
|
|
|
|
|
|
call zasmMain
|
|
|
|
;call dumpSymTable
|
|
|
|
ret
|
|
|
|
|
2019-05-17 20:22:32 -04:00
|
|
|
#include "zasm/main.asm"
|
2019-05-17 13:22:45 -04:00
|
|
|
|
|
|
|
; *** Debug ***
|
|
|
|
debugPrint:
|
|
|
|
push af
|
|
|
|
push hl
|
|
|
|
.loop:
|
|
|
|
ld a, (hl)
|
|
|
|
or a
|
|
|
|
jr z, .end
|
|
|
|
out (STDERR_PORT), a
|
|
|
|
inc hl
|
|
|
|
jr .loop
|
|
|
|
.end:
|
|
|
|
ld a, 0x0a
|
|
|
|
out (STDERR_PORT), a
|
|
|
|
pop hl
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
|
|
|
dumpSymTable:
|
|
|
|
ld hl, SYM_NAMES
|
|
|
|
ld de, SYM_VALUES
|
|
|
|
.loop:
|
|
|
|
call debugPrint
|
|
|
|
ld a, (de)
|
|
|
|
out (12), a
|
|
|
|
inc de
|
|
|
|
ld a, (de)
|
|
|
|
out (12), a
|
|
|
|
inc de
|
|
|
|
xor a
|
|
|
|
call findchar
|
|
|
|
inc hl
|
|
|
|
ld a, (hl)
|
|
|
|
or a
|
|
|
|
ret z
|
|
|
|
jr .loop
|
|
|
|
|