printstack.s 949 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. .define Printstack
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This a special subroutine which prints some things to the
  8. ! monitorscreen for debugging.
  9. Printstack:
  10. ldy #0
  11. 2: lda (hol0+4),y
  12. beq 1f
  13. jsr WRCH ! print filename
  14. iny
  15. jmp 2b
  16. 1: lda #32
  17. jsr WRCH ! print a space
  18. lda hol0+1
  19. jsr Printhex ! print line number (highbyte)
  20. lda hol0
  21. jsr Printhex ! print line number (lowbyte)
  22. lda #32
  23. jsr WRCH ! print a space
  24. lda SP+1
  25. jsr Printhex ! print stackpointer (highbyte)
  26. lda SP+2
  27. jsr Printhex ! print stackpointer (lowbyte)
  28. lda #32
  29. jsr WRCH ! print a space
  30. lda LB+1
  31. jsr Printhex ! print real localbase (highbyte)
  32. lda LB
  33. jsr Printhex ! print real localbase (lowbyte)
  34. lda #32
  35. jsr WRCH ! print a space
  36. lda LBl+1
  37. jsr Printhex ! print second lowerbase (highbyte)
  38. lda LBl
  39. jsr Printhex ! print second lowerbase (lowbyte)
  40. lda #10
  41. jsr WRCH ! print a newline
  42. lda #13
  43. jsr WRCH ! print a carriagereturn
  44. rts