Skip to content

Instantly share code, notes, and snippets.

@pinobatch
Created June 22, 2023 19:08
Show Gist options
  • Save pinobatch/69ab4f1ae82ea1d7e6b532388514f4dc to your computer and use it in GitHub Desktop.
Save pinobatch/69ab4f1ae82ea1d7e6b532388514f4dc to your computer and use it in GitHub Desktop.
ca65 example for "Define symbols using arithmetic on imported symbols" (gbdev/rgbds#1146)
.segment "CODE"
.import calleeFunc, calleeFunc_hLocalsEnd
callerFunc_hLocalsEnd = calleeFunc_hLocalsEnd + 3
.proc callerFunc
; omitted: do something with 3 bytes of local variables
; at calleeFunc_hLocalsEnd through callerFunc_hLocalsEnd - 1
jsr calleeFunc
rts
.endproc
.export callerFunc, callerFunc_hLocalsEnd
# the above is an example of working ca65 source code for
# "Define symbols using arithmetic on imported symbols"
# <https://github.com/gbdev/rgbds/issues/1146>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment