Skip to content

[FEATURE] .CONTENT inside a macro? #652

@cyraid

Description

@cyraid

This is not too high priority, but being able to insert content in a macro would unlock things like:

.MACRO Data ARGS label
\1:
  .IF has("content")
    .CONTENT ; Replaces this with the block that's provided when executed
  .ELSE
    .FAIL "Need content for Data"
  .ENDIF
  \1End:
  \1Size = (\1End - \1)
.ENDM

.MACRO Proc ARGS procLabel, flags
\1:
  ; Pre-Content pushing, etc.
  .IF has("content")
    .CONTENT ; Replaces this with the block that's provided when executed
  .ELSE
    .FAIL "Need Code for Procedure"
  .ENDIF
  ; Post-Content popping, etc.
  ; RTL/RTS (depending on flags)
.ENDM

Data &someDataBlock {
  .DW $0000
  .DW $0001
}

Data &someStr { .BYTE "test" }

Proc &someProc {
  Param &A, 0
  Param &B, 2

  ; Code here

}

; Use someDataBlock as a label, and it's size someDataBlockSize

For whenever you've had a nice break and feel nice and rested! Hope you're doing well. Sorry for all the free-time absorbing requests!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions