spt.asm 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ; code: lang=asm-collection tabSize=8
  2. ; spt_ld_bc: pop bc
  3. ; ret
  4. ; spt_ld_hl: pop hl
  5. ; ret
  6. spt_select_test:
  7. pop iy
  8. ret
  9. ; spt_ld_bchl: pop bc
  10. ; pop hl
  11. ; ret
  12. ; spt_clr_e: ld e,0 ; just clear reg e
  13. ; ret
  14. spt_exit:
  15. SPTHREAD_RESTORE
  16. ret
  17. spt_jp: pop hl
  18. ld sp,hl
  19. ret
  20. spt_jp_nc: pop hl
  21. ret c
  22. ld sp,hl
  23. ret
  24. spt_jp_c: pop hl
  25. ret nc
  26. ld sp,hl
  27. ret
  28. ; spt_jp_z: pop hl
  29. ; ret nz
  30. ; ld sp,hl
  31. ; ret
  32. ; ; attempt to create subroutine to replace SPTHREAD_ENTER macro
  33. ; ; the downside of these is that they destroy HL, which is a hard pill to swallow in
  34. ; ; ramless code
  35. ; ; notes:
  36. ; ; if a subroutine immediately JP's here, we know that:
  37. ; ; (sp-2) contains the address of the routine that called us (because we got there by RET)
  38. ; ; (sp-2)+3 contains the address we can jp back to in order to continue
  39. ; spt_enter:
  40. ; dec sp
  41. ; dec sp
  42. ; pop hl
  43. ; SPTHREAD_ENTER
  44. ; jp (hl)
  45. ; call an all-threaded subroutine
  46. ; the parameter (pointed by SP) is where we are jumping
  47. spt_call:
  48. pop hl
  49. SPTHREAD_SAVE
  50. ld sp,hl
  51. ret