abc80con.asm 737 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. spt_con_print: pop hl
  2. con_print:
  3. .loop:
  4. ld a,(HL) ; get message char
  5. or a ; test for null
  6. jr z, .done ; return if done
  7. ld (ix+0),A ; store char
  8. inc ix ; advance screen pointer
  9. inc hl ; advance message pointer
  10. jr .loop ; continue
  11. .done:
  12. ret
  13. con_home: ld ix,VBASE
  14. ret
  15. spt_con_goto: pop ix
  16. ret
  17. con_NL:
  18. ld a,ixl ; go to beginning of line
  19. and $c0 ; then go to the next line
  20. add a,$40
  21. ld ixl,a ; store the low byte back
  22. jr nc,.skip
  23. inc ixh ; fix up high byte if there was a carry
  24. .skip:
  25. ret
  26. con_clear:
  27. ld hl,VBASE
  28. ld bc,VSIZE
  29. .loop:
  30. ld (hl),20h
  31. cpi
  32. jp pe,.loop
  33. ld ix,VBASE
  34. ret
  35. spt_con_index: pop bc
  36. con_index:
  37. add ix,bc
  38. ret