Skip to content

Use the value of a variable in a string #457

Answered by vhelin
rondnelson99 asked this question in Q&A
Discussion options

You must be logged in to vote

\@ works only in .MACRO, but you could do something like this:

        .define NUM_ROWS 8
        .define NUM_COLS 8

        .macro CreateSection ARGS ROWm
          .section "level_row_\1" FORCE
          .rept NUM_COLS index COL
            .dw COL+ROWm*NUM_COLS
            .dw COL+ROWm*NUM_COLS
          .endr
        .endm

        .rept NUM_ROWS index ROW
          .org ROW << 8
          CreateSection ROW
          .ends
        .endr

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@rondnelson99
Comment options

@vhelin
Comment options

@rondnelson99
Comment options

Answer selected by vhelin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants