z80.mac 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. ; code: lang=asm-collection tabSize=8
  2. JP_ERROR defl 0
  3. JR_PROMOTE defl 0
  4. .jperror JP_ERROR
  5. .jrpromote JR_PROMOTE
  6. dbi .macro string
  7. irpc char,<string>
  8. db '`char`'|$80
  9. .endm
  10. .endm
  11. dbz .macro string
  12. db "`string`", 0
  13. .endm
  14. dbiz .macro string
  15. dbi "`string`"
  16. db 0
  17. .endm
  18. nop12 .macro
  19. jr $+2
  20. .endm
  21. ; interrupt vectors: these need to be located at 38h and 66h, so there is little
  22. ; code space before them. They should probably be present so that any incoming interrupts
  23. ; won't kill the test routines. The INT vector is probably unnecessary but the NMI should
  24. ; be present.
  25. ; to maximize space,
  26. PLACE_VEC .macro loc
  27. .assert $ <= loc
  28. .if $ < loc
  29. dc loc-$,$FF
  30. .endif
  31. org loc
  32. .endm
  33. ; PLACE_INTVEC .macro
  34. ; .assert $ <= $38
  35. ; .if $ < $38
  36. ; dc $38-$,$FF ; fill empty space
  37. ; .endif
  38. ; org $38 ; NMI vector
  39. ; .endm
  40. ; PLACE_NMIVEC .macro
  41. ; .assert $ <= $66
  42. ; .if $ < $66
  43. ; dc $66-$,$FF ; fill empty space
  44. ; .endif
  45. ; org $66 ; NMI vector
  46. ; .endm
  47. SKIP_INTVEC .macro
  48. jr .intvec_continue ; continue after the NMI vector
  49. PLACE_INTVEC
  50. reti
  51. .intvec_continue:
  52. .endm
  53. SKIP_NMIVEC .macro
  54. jr .nmivec_continue ; continue after the NMI vector
  55. ; PLACE_NMIVEC
  56. PLACE_VEC $66
  57. retn
  58. .nmivec_continue:
  59. .endm