1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 23:18:05 +11:00

shell: add iowr and iord

This commit is contained in:
Virgil Dupras 2019-05-02 15:18:47 -04:00
parent f9ae5ca46b
commit 59b0c83b0e

View File

@ -26,7 +26,7 @@
; *** CONSTS *** ; *** CONSTS ***
; number of entries in shellCmdTbl ; number of entries in shellCmdTbl
SHELL_CMD_COUNT .equ 5+SHELL_EXTRA_CMD_COUNT SHELL_CMD_COUNT .equ 7+SHELL_EXTRA_CMD_COUNT
; maximum number of bytes to receive as args in all commands. Determines the ; maximum number of bytes to receive as args in all commands. Determines the
; size of the args variable. ; size of the args variable.
@ -486,8 +486,32 @@ shellCall:
xor a xor a
ret ret
shellIORDCmd:
.db "iord", 0b001, 0, 0
push bc
ld a, (hl)
ld c, a
in a, (c)
call printHex
xor a
pop bc
ret
shellIOWRCmd:
.db "iowr", 0b001, 0b001, 0
push bc
ld a, (hl)
ld c, a
inc hl
ld a, (hl)
out (c), a
xor a
pop bc
ret
; This table is at the very end of the file on purpose. The idea is to be able ; This table is at the very end of the file on purpose. The idea is to be able
; to graft extra commands easily after an include in the glue file. ; to graft extra commands easily after an include in the glue file.
shellCmdTbl: shellCmdTbl:
.dw shellMptrCmd, shellPeekCmd, shellLoadCmd, shellSaveCmd, shellCallCmd .dw shellMptrCmd, shellPeekCmd, shellLoadCmd, shellSaveCmd, shellCallCmd
.dw shellIORDCmd, shellIOWRCmd