lxa2.s 564 B

12345678910111213141516171819202122232425262728293031323334353637
  1. .define Lxa2
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This subroutine load the address of AB n (255 >= n > 0) static levels
  8. ! back.
  9. Lxa2:
  10. lda LB
  11. sta ADDR ! address of localbase (lowbyte)
  12. lda LB+1
  13. sta ADDR+1 ! address of localbase (highbyte)
  14. 1: ldy #2
  15. lda (ADDR),y ! static level LB (lowbyte)
  16. pha
  17. iny
  18. lda (ADDR),y ! static level LB (highbyte)
  19. sta ADDR+1 ! static level LB (highbyte)
  20. pla
  21. sta ADDR ! static level LB (lowbyte)
  22. dex
  23. bne 1b
  24. tax
  25. ldy ADDR+1
  26. inx
  27. inx ! argumentbase = localbase + 2
  28. bne 1f
  29. iny
  30. 1: tya
  31. rts