7001446212
Recipes contain bits and pieces of hardware-related knowledge, but these bits feel sparse. I've been wanting to consolidate hardware- related documentation for a while, but always fell at odds with the recipes organisation. We don't have recipes anymore, just a /doc/hw section that contains hardware-related documentation which often translate to precise instructions to run Collapse OS on a specific machine. With this new organisation, I hope to end up with a better, more solid documentation.
15 lines
443 B
Plaintext
15 lines
443 B
Plaintext
: (key)
|
|
( inc then fetch )
|
|
[ ACIAR> LITN ] C@ 1+ [ ACIA_BUFSZ 1- LITN ] AND
|
|
( As long as R> == W>-1, it means that buffer is empty )
|
|
BEGIN DUP [ ACIAW> LITN ] C@ = NOT UNTIL
|
|
DUP [ ACIA( LITN ] @ + C@ ( ridx c )
|
|
SWAP [ ACIAR> LITN ] C! ( 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!
|
|
;
|