stil.s 700 B

12345678910111213141516171819202122232425262728293031
  1. .define Stil
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This subroutine stores indirect a block of bytes if
  8. ! the number of bytes is greater than four.
  9. ! The destination address is in registerpair AX.
  10. ! The lowbyte of the number of bytes is in Y,
  11. ! the highbyte is in zeropage location NBYTES+1.
  12. Stil:
  13. sta ADDR+3 ! destination address (highbyte)
  14. stx ADDR+2 ! destination address (lowbyte)
  15. sty NBYTES ! number of bytes (lowbyte)
  16. clc
  17. lda SP+2
  18. sta ADDR ! source address (lowbyte)
  19. adc NBYTES
  20. sta SP+2 ! new stackpointer (lowbyte)
  21. lda SP+1
  22. sta ADDR+1 ! source address (highbyte)
  23. adc NBYTES+1
  24. sta SP+1 ! new stackpointer (highbyte)
  25. inc NBYTES+1
  26. jmp Blmnp ! do the move