sti.s 559 B

1234567891011121314151617181920212223242526272829
  1. .define Sti, Sext, Stii
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! The subroutine Sti stores an twobyte word at the address which
  8. ! is in registerpair AX.
  9. ! The subroutine Sext is used when the address is already in
  10. ! zeropage.
  11. ! The subroutine Stii is used when the address is in zeropage
  12. ! and the registerpair AX contains the word.
  13. Sti:
  14. stx ADDR ! address of word (lowbyte)
  15. sta ADDR+1 ! address of word (highbyte)
  16. Sext:
  17. jsr Pop ! get word
  18. Stii:
  19. ldy #1
  20. sta (ADDR),y ! store highbyte
  21. dey
  22. txa
  23. sta (ADDR),y ! store lowbyte
  24. rts