Skip to content

Instantly share code, notes, and snippets.

@rkujawa
Created March 27, 2016 08:45
Show Gist options
  • Save rkujawa/71ba2f1af9bbccd36b63 to your computer and use it in GitHub Desktop.
Save rkujawa/71ba2f1af9bbccd36b63 to your computer and use it in GitHub Desktop.
.macro fcall fname, arg1, arg2, arg3, arg4, arg5
ldy #0
.ifnb \arg1
ldx #\arg1
stx FARGS_ARG,Y
iny
.endif
.ifnb \arg2
ldx #\arg2
stx FARGS_ARG,Y
iny
.endif
.ifnb \arg3
ldx #\arg3
stx FARGS_ARG,Y
iny
.endif
.ifnb \arg4
ldx #\arg4
stx FARGS_ARG,Y
iny
.endif
.ifnb \arg5
ldx #\arg5
stx FARGS_ARG,Y
iny
.endif
sty FARGS_NUM
jsr \fname
.endm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment