5

I'm trying to learn CBM Program Studio. But I can't get macros work for me. Withouth the macro the codes was ok. But when I add the macro part it gives "No Matching End Definition" on line 7.

Any idea?

        *=$c000 ; sys 49152

        ; set screen colors to black 
        lda #$00
        sta $d020
        sta $d021

defm    waitmacro ;akumulatörü hacılıyor   
        TYA
mloop   DEY
        BNE mloop
        TAY     
        endm waitmacro

        ;color bars
        LDX #$FF
loop    LDY #$07
        STY $d020

        waitmacro

        INY
        STY $d020

        waitmacro

        DEX
        BNE loop
        RTS
Jens Björnhager
  • 5,632
  • 3
  • 27
  • 47
wizofwor
  • 917
  • 8
  • 25

1 Answers1

5

It should work fine if you don't specify a name for endm. I.e.:

defm waitmacro ;akumulatörü hacılıyor
        TYA
mloop   DEY
        BNE mloop
        TAY     
        endm

I'm not sure why this is the case or why the documentation suggests otherwise.

Michael
  • 57,169
  • 9
  • 80
  • 125