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
495B

  1. 0x80 CONSTANT SIO_ACTL 0x81 CONSTANT SIO_ADATA
  2. 0x82 CONSTANT SIO_BCTL 0x83 CONSTANT SIO_BDATA
  3. 0x20 CONSTANT SIO_BUFSZ ( SZ-1 must be a mask )
  4. ( Address in memory that can be used variables shared
  5. with SIO native words. 4 bytes used. )
  6. CREATE SIO_MEM SYSVARS 0x70 + ,
  7. ( Points to SIO buf )
  8. : SIO( SIO_MEM @ 2+ ;
  9. ( Read buf idx Pre-inc )
  10. : SIOR> SIO_MEM @ ;
  11. ( Write buf idx Post-inc )
  12. : SIOW> SIO_MEM @ 1+ ;
  13. ( This means that if W> == R>, buffer is full.
  14. If R>+1 == W>, buffer is empty. )