Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
532B

  1. 0x80 CONSTANT ACIA_CTL ( IO port for ACIA's control register )
  2. 0x81 CONSTANT ACIA_IO ( IO port for ACIA's data registers )
  3. 0x20 CONSTANT ACIA_BUFSZ ( SZ-1 must be a mask )
  4. ( Address in memory that can be used variables shared
  5. with ACIA's native words. 4 bytes used. )
  6. CREATE ACIA_MEM SYSVARS 0x70 + ,
  7. ( Points to ACIA buf )
  8. : ACIA( ACIA_MEM @ 2+ ;
  9. ( Read buf idx Pre-inc )
  10. : ACIAR> ACIA_MEM @ ;
  11. ( Write buf idx Post-inc )
  12. : ACIAW> ACIA_MEM @ 1+ ;
  13. ( This means that if W> == R>, buffer is full.
  14. If R>+1 == W>, buffer is empty. )