rowread.s 324 B

1234567891011121314151617
  1. .xdef _rowread
  2. .text
  3. _rowread:
  4. | Write the mask to the port
  5. move.w %d0,0x600018
  6. | Wait for a few milliseconds until the I/O can return a valid value
  7. moveq #24,%d0
  8. 0:
  9. dbra %d0,0b
  10. | Read the port and write it to %d0 (return value register)
  11. move.b 0x60001B,%d0
  12. | Invert the byte
  13. not.b %d0
  14. and.w #0xFF,%d0
  15. | Return
  16. rts