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

zasm: properly raise error on bas ioPutC calls

This commit is contained in:
Virgil Dupras 2019-06-15 16:48:30 -04:00
parent 7ba8e85a4a
commit 3e7d181d3c
5 changed files with 13 additions and 0 deletions

View File

@ -50,12 +50,16 @@ handleDB:
jr nz, .overflow ; not zero? overflow jr nz, .overflow ; not zero? overflow
ld a, l ld a, l
call ioPutC call ioPutC
jr nz, .ioError
.stopStrLit: .stopStrLit:
call readComma call readComma
jr z, .loop jr z, .loop
cp a ; ensure Z cp a ; ensure Z
pop hl pop hl
ret ret
.ioError:
ld a, SHELL_ERR_IO_ERROR
jr .error
.badfmt: .badfmt:
ld a, ERR_BAD_FMT ld a, ERR_BAD_FMT
jr .error jr .error

View File

@ -823,10 +823,14 @@ parseInstruction:
.loopWrite: .loopWrite:
ld a, (hl) ld a, (hl)
call ioPutC call ioPutC
jr nz, .ioError
inc hl inc hl
djnz .loopWrite djnz .loopWrite
cp a ; ensure Z cp a ; ensure Z
jr .end jr .end
.ioError:
ld a, SHELL_ERR_IO_ERROR
jr .error
.overflow: .overflow:
ld a, ERR_OVFL ld a, ERR_OVFL
jr .error jr .error

View File

@ -152,6 +152,7 @@ ioPutC:
jp _blkPutC jp _blkPutC
.skip: .skip:
pop af pop af
cp a ; ensure Z
ret ret
ioSavePos: ioSavePos:

View File

@ -529,11 +529,13 @@ sdcSync:
.buf1Ok: .buf1Ok:
ld de, SDC_BUFSEC1 ld de, SDC_BUFSEC1
ld (SDC_BUFPTR), de ld (SDC_BUFPTR), de
; Z already set
jr .end jr .end
.buf2Ok: .buf2Ok:
ld de, SDC_BUFSEC2 ld de, SDC_BUFSEC2
ld (SDC_BUFPTR), de ld (SDC_BUFPTR), de
; Z already set
; to .end ; to .end
.end: .end:
pop de pop de

View File

@ -82,6 +82,7 @@ emulGetC:
emulPutC: emulPutC:
out (STDIO_PORT), a out (STDIO_PORT), a
cp a ; ensure Z
ret ret
fsdevGetC: fsdevGetC:
@ -111,6 +112,7 @@ fsdevPutC:
jr nz, .error jr nz, .error
pop af pop af
out (FS_DATA_PORT), a out (FS_DATA_PORT), a
cp a ; ensure Z
ret ret
.error: .error:
pop af pop af