This website works better with JavaScript.
Home
Explore
lain.church
Help
Register
Sign In
izaya
/
collapseos
mirror of
https://github.com/hsoft/collapseos.git
Watch
1
Star
1
Fork
0
Code
Issues
0
Releases
0
Wiki
Activity
Browse Source
zasm: implement error conditions in .org and .fill
pull/10/head
Virgil Dupras
5 years ago
parent
371076190f
commit
31f7c7771d
2 changed files
with
24 additions
and
2 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+20
-2
apps/zasm/directive.asm
+4
-0
tools/tests/zasm/errtests.sh
+ 20
- 2
apps/zasm/directive.asm
View File
@@ -142,17 +142,27 @@ handleEQU:
handleORG:
call readWord
jr nz, .badfmt
call parseExpr
r
et
nz
j
r nz
, .badarg
push ix \ pop hl
call zasmSetOrg
cp a ; ensure Z
ret
.badfmt:
ld a, ERR_BAD_FMT
jr .error
.badarg:
ld a, ERR_BAD_ARG
.error:
call unsetZ
ret
handleFIL:
call readWord
jr nz, .badfmt
call parseExpr
ret nz
j
r nz
, .badarg
push bc
push ix \ pop bc
xor a
@@ -163,6 +173,14 @@ handleFIL:
cp a ; ensure Z
pop bc
ret
.badfmt:
ld a, ERR_BAD_FMT
jr .error
.badarg:
ld a, ERR_BAD_ARG
.error:
call unsetZ
ret
handleINC:
call readWord
+ 4
- 0
tools/tests/zasm/errtests.sh
View File
@@ -22,11 +22,15 @@ chkerr "ld a, hl" 2
chkerr ".db foo" 2
chkerr ".dw foo" 2
chkerr ".equ foo bar" 2
chkerr ".org foo" 2
chkerr ".fill foo" 2
chkerr "ld a," 3
chkerr "ld a, 'A" 3
chkerr ".db 0x42," 3
chkerr ".dw 0x4242," 3
chkerr ".equ" 3
chkerr ".equ foo" 3
chkerr ".org" 3
chkerr ".fill" 3
chkerr "ld a, 0x100" 4
chkerr ".db 0x100" 4
Write
Preview
Loading…
Cancel
Save