1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-25 16:38:06 +11:00
collapseos/blk/357
2020-05-11 21:52:44 -04:00

17 lines
397 B
Plaintext

: (key)
( inc then fetch )
ACIAR> @ 1+ DUP ACIA) @ = IF
DROP ACIA( @
THEN
( As long as R> == W>-1, it means that buffer is empty )
BEGIN DUP ACIAW> @ = NOT UNTIL
ACIAR> !
ACIAR> @ C@
;
: (emit)
( As long at CTL bit 1 is low, we are transmitting. wait )
BEGIN [ ACIA_CTL LITN ] PC@ 0x02 AND UNTIL
( The way is clear, go! )
[ ACIA_IO LITN ] PC!
;