mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-28 08:48:05 +11:00
forth: add words "PC!" and "PC@"
This commit is contained in:
parent
e95614755b
commit
aac0a57a68
@ -211,10 +211,33 @@ EMIT:
|
||||
call stdioPutC
|
||||
jp exit
|
||||
|
||||
; ( c port -- )
|
||||
.db "PC!"
|
||||
.fill 5
|
||||
.dw EMIT
|
||||
PSTORE:
|
||||
.dw nativeWord
|
||||
pop bc
|
||||
pop hl
|
||||
out (c), l
|
||||
jp exit
|
||||
|
||||
; ( port -- c )
|
||||
.db "PC@"
|
||||
.fill 5
|
||||
.dw PSTORE
|
||||
PFETCH:
|
||||
.dw nativeWord
|
||||
pop bc
|
||||
ld h, 0
|
||||
in l, (c)
|
||||
push hl
|
||||
jp exit
|
||||
|
||||
; ( addr -- )
|
||||
.db "EXECUTE"
|
||||
.db 0
|
||||
.dw EMIT
|
||||
.dw PFETCH
|
||||
EXECUTE:
|
||||
.dw nativeWord
|
||||
pop iy ; is a wordref
|
||||
|
@ -70,4 +70,6 @@ HERE -- a Push HERE's address
|
||||
. n -- Print n in its decimal form
|
||||
EMIT c -- Spit char c to stdout
|
||||
KEY -- c Get char c from stdin
|
||||
PC! c a -- Spit c to port a
|
||||
PC@ a -- c Fetch c from port a
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user