mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-14 17:28:05 +11:00
a9ed8da0b2
The previous approach of maintaining R> and W> pointers was conceptually simple, but made INT handler code actually quite complex. Now, we maintain indexes instead. It's much easier to perform bounds checks and to compare for equality, something we have to do quick in the INT handler.
12 lines
370 B
Plaintext
12 lines
370 B
Plaintext
: ACIA$
|
|
H@ [ ACIA( LITN ] ! 0 [ ACIAR> LITN ] C!
|
|
1 [ ACIAW> LITN ] C! ( write index starts one pos later )
|
|
[ ACIA_BUFSZ LITN ] ALLOT
|
|
( setup ACIA
|
|
CR7 (1) - Receive Interrupt enabled
|
|
CR6:5 (00) - RTS low, transmit interrupt disabled.
|
|
CR4:2 (101) - 8 bits + 1 stop bit
|
|
CR1:0 (10) - Counter divide: 64 )
|
|
0b10010110 [ ACIA_CTL LITN ] PC!
|
|
(im1) ;
|