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

[FEATURE] .CONTENT inside a macro? #652

Open
cyraid opened this issue Jan 29, 2025 · 0 comments
Open

[FEATURE] .CONTENT inside a macro? #652

cyraid opened this issue Jan 29, 2025 · 0 comments

Comments

@cyraid
Copy link

cyraid commented Jan 29, 2025

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!

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