collapseos/blk/582
Virgil Dupras 9424770caa rc2014: add a declaration part to ACIA drivers
Driver configuration don't need their own words at runtime, we only
need to compile them as literals when compiling words.

Now that we have this "declaration blocks" pattern emerging, it
seems like a good idea to take advantage of this in drivers, both
for simplifying the xcomp unit and to make final binary slimmer.
2020-06-28 17:30:01 -04:00

16 lines
547 B
Plaintext

0x80 CONSTANT ACIA_CTL ( IO port for ACIA's control register )
0x81 CONSTANT ACIA_IO ( IO port for ACIA's data registers )
( Address in memory that can be used variables shared
with ACIA's native words. 8 bytes used. )
CREATE ACIA_MEM RAMSTART 0x70 + ,
( Points to ACIA buf )
: ACIA( ACIA_MEM @ 4 + ;
( Points to ACIA buf end )
: ACIA) ACIA_MEM @ 6 + ;
( Read buf pointer. Pre-inc )
: ACIAR> ACIA_MEM @ ;
( Write buf pointer. Post-inc )
: ACIAW> ACIA_MEM @ 2+ ;
( This means that if W> == R>, buffer is full.
If R>+1 == W>, buffer is empty. )