Skip to content

More control over use of macro parameters #162

Description

@thrust26

Macro parameters are sometimes handled as values and sometimes as string. But the user has no control over it.

Example:

  MAC TEST
    .byte   {1}
  ENDM

_VAL SET 0
  REPEAT 3
    TEST _VAL
_VAL SET _VAL + 1
  REPEND

This results into:

  .byte 0
  .byte 1
  .byte 2

Now, if I want to do the same with a label, this doesn't work.

    MAC TEST
Label{1}
    ENDM

_VAL SET 10
    TEST _VAL

Results into Label_VAL. But what I need is Label10,

And sometimes I even want both, value and string. E.g.

  MAC TESTP
    IF (>{1}) != (>{2})
      ECHO {1}, "not on same page as", {2}
    ENDIF
  ENDM

Label1
  .byte 1,2, 3
Label2
    TESTP Label1, Label2

Here I want to print out the labels names, not the values.

Therefore it would be good if the user get some control over the output. Maybe similar to [value]d, which outputs a number as decimal. So [value]v would output as value (also [value]d as decimal value, not only in strings) and [value]s would output as string.

So my 2nd example from above would look like this:

    MAC TEST
Label[{1}]d
    ENDM

_VAL SET 10
    TEST _VAL

And create Label10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions