Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with macro arguments and reordering #21

Open
bshepherdson opened this issue Sep 8, 2017 · 0 comments
Open

Error with macro arguments and reordering #21

bshepherdson opened this issue Sep 8, 2017 · 0 comments

Comments

@bshepherdson
Copy link

.def _counter, 0

; These are broken.
.macro dbg_inner=.asciiz %1 %n .def _counter, %e0 + 1
.macro dbg_log=dbg_inner _counter, %0
.macro op_log=dbg_log %0


; Reordering the arguments to dbg_inner fixes it:
;.macro fixed_inner=.asciiz %0 %n .def _counter, %e1 + 1
;.macro fixed_log=fixed_inner %0, _counter
;.macro fixed_op_log=fixed_log %0

op_log "text"
op_log "more text"

This produces an error for each usage of op_log:

Outputing to test.bin
Loading test.asm
Error: Could not evaluate expression:%0                               
Error: Could not evaluate expression:%0

Switching the order of arguments fixes it, see the commented version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant