1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-24 14:28:06 +11:00

zasm: tighten directive detection a bit

This commit is contained in:
Virgil Dupras 2019-10-06 14:39:47 -04:00
parent f4b6c7637d
commit e4732d79dc
2 changed files with 16 additions and 10 deletions

View File

@ -17,16 +17,16 @@
.equ DIREC_RAMEND DIREC_SCRATCHPAD+SCRATCHPAD_SIZE
; *** CODE ***
; 4 bytes per row, fill with zero
; 3 bytes per row, fill with zero
directiveNames:
.db ".DB", 0
.db ".DW", 0
.db ".EQU"
.db ".ORG"
.db ".FIL"
.db ".OUT"
.db ".INC"
.db ".BIN"
.db "DB", 0
.db "DW", 0
.db "EQU"
.db "ORG"
.db "FIL"
.db "OUT"
.db "INC"
.db "BIN"
; This is a list of handlers corresponding to indexes in directiveNames
directiveHandlers:
@ -296,14 +296,20 @@ handleBIN:
; Reads string in (HL) and returns the corresponding ID (D_*) in A. Sets Z if
; there's a match.
getDirectiveID:
ld a, (hl)
cp '.'
ret nz
push hl
push bc
push de
inc hl
ld b, D_BIN+1 ; D_BIN is last
ld c, 4
ld c, 3
ld de, directiveNames
call findStringInList
pop de
pop bc
pop hl
ret
; Parse directive specified in A (D_* const) with args in I/O and act in

Binary file not shown.