2020-05-11 21:52:44 -04:00
|
|
|
: (key)
|
|
|
|
( inc then fetch )
|
2020-06-28 17:30:01 -04:00
|
|
|
[ ACIAR> LITN ] @ 1+ DUP [ ACIA) LITN ] @ = IF
|
|
|
|
DROP [ ACIA( LITN ] @
|
2020-05-11 21:52:44 -04:00
|
|
|
THEN
|
|
|
|
( As long as R> == W>-1, it means that buffer is empty )
|
2020-06-28 17:30:01 -04:00
|
|
|
BEGIN DUP [ ACIAW> LITN ] @ = NOT UNTIL
|
|
|
|
[ ACIAR> LITN ] !
|
|
|
|
[ ACIAR> LITN ] @ C@
|
2020-05-11 21:52:44 -04:00
|
|
|
;
|
|
|
|
: (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!
|
|
|
|
;
|