putchr.nas.s 394 B

12345678910111213141516171819202122232425262728
  1. .define putchr
  2. ! output routine in monitor
  3. CRT = 0x013B
  4. ! output a charcter
  5. ! entry: ascii character in a
  6. putchr:
  7. push hl
  8. push bc
  9. ld hl,tab
  10. ld b,5
  11. 1: cp (hl)
  12. jr z,fetch
  13. inc hl
  14. inc hl
  15. djnz 1b
  16. 2: call CRT
  17. pop bc
  18. pop hl
  19. ret
  20. fetch: inc hl
  21. ld a,(hl)
  22. jr 2b
  23. ! conversion table for nascom characters
  24. tab: .byte 0x0D,0x00
  25. .byte 0x1B,0x1E
  26. .byte 0x08,0x1D
  27. .byte 0x0A,0x1F
  28. .byte 0x7F,0x00