Skip to content

Error with macro arguments and reordering #21

@bshepherdson

Description

@bshepherdson
.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions