Working with Macros

Here follows a small example on macro usage.

test .MACRO
  LDA #£1
  STA $0286
  LDA #£2
  STA $D020
  STA $D021
  LDA #<text1
  LDY #>text1
  JMP $AB1E
text1 .NULL "@3"
  .ENDM
   
  *=$1000
main JSR $E544
  #Test $0F,0,"text"

This assembles into:

LDA #$0F
STA $0286
LDA #$00
STA $D020
STA $D021
LDA #$14 ;(LoByte of $1014)
LDY #$10 ;(HiByte of $1014)
JMP $AB1E                                                                                                                                   $54,$45,$58,$54,$00 ; (‘text’,$00)