Skip to content

Instantly share code, notes, and snippets.

@ksherlock
Created September 16, 2016 15:55
Show Gist options
  • Save ksherlock/abb8459d0cc4c689a9f0354006cbda94 to your computer and use it in GitHub Desktop.
Save ksherlock/abb8459d0cc4c689a9f0354006cbda94 to your computer and use it in GitHub Desktop.
Harpoon assembler now supports macros.
macro name [arguments...] {
...
}
arguments are in the form `&identifier`. The final argument may include an ellipsis to capture variadic arguments.
(`&identifier...`). Within the macro, `&...` expands to the full argument set. Arguments are replaced as-is,
macro load &p { lda #10 * &p}
load 1 + 2 ; lda #10 * 1 + 2 not lda #10 * (1+2)
@labels will be scoped within the macro. (not yet implemented, though :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment