locaddr.s 371 B

1234567891011121314151617181920212223
  1. .define Locaddr
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This routine gets the address of a local which offset is to big.
  8. ! The offset is in registerpair AX.
  9. Locaddr:
  10. pha ! save A
  11. txa
  12. clc
  13. adc LB ! localbase + offset (lowbyte)
  14. sta ADDR ! address (lowbyte)
  15. pla
  16. adc LB+1 ! localbase + offset (highbyte)
  17. sta ADDR+1 ! address (highbyte)
  18. rts