1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-24 14: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
ld a, l
call ioPutC
jr nz, .ioError
.stopStrLit:
call readComma
jr z, .loop
cp a ; ensure Z
pop hl
ret
.ioError:
ld a, SHELL_ERR_IO_ERROR
jr .error
.badfmt:
ld a, ERR_BAD_FMT
jr .error

View File

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

View File

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

View File

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

View File

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