asp.s 459 B

12345678910111213141516171819202122232425
  1. .define Asp
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This subroutine adds an offset to the stackpointer,
  8. ! e.g. after the return from a procedurecall.
  9. ! The offset is in registerpair AX, and is added to the
  10. ! stackpointer.
  11. Asp:
  12. tay ! save A
  13. txa ! get X
  14. clc
  15. adc SP+2 ! add adjustment (lowbyte)
  16. sta SP+2 ! new stackpointer (lowbyte)
  17. tya ! get A
  18. adc SP+1 ! add adjustment (highbyte)
  19. sta SP+1 ! get stackpointer (highbyte)
  20. rts