loil.s 493 B

12345678910111213141516171819202122232425262728
  1. .define Loil
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This subroutine pushes an object of size greater than four bytes
  8. ! onto the stack.
  9. Loil:
  10. sta ADDR+1 ! source address (lowbyte)
  11. stx ADDR ! source address (highbyte)
  12. sty NBYTES
  13. sec
  14. lda SP+2
  15. sbc NBYTES
  16. sta ADDR+2 ! destination address (lowbyte)
  17. sta SP+2 ! new stackpointer
  18. lda SP+1
  19. sbc NBYTES+1
  20. sta ADDR+3 ! destination address (highbyte)
  21. sta SP+1 ! new stackpointer
  22. inc NBYTES+1
  23. jmp Blmnp ! do the move