I am trying to make modifications to the code of my Pong Game so that I can assemble it with ASM6 assembler.
After making modifications to be able to assemble, I still can't assemble it.
I attach my ASM file and a TXT of the errors that the assembler gives me.
Problems changing syntax from NESASM to ASM6
Moderator: Moderators
-
- Posts: 21
- Joined: Wed Jun 22, 2022 7:00 am
Problems changing syntax from NESASM to ASM6
- Attachments
-
- failed to assemble.txt
- (6.05 KiB) Downloaded 26 times
-
- pong_basic_(ASM6).asm
- (38.99 KiB) Downloaded 18 times
Re: Problems changing syntax from NESASM to ASM6
There's a few issues here:
1) ASM6 local label scope (labels that start with @) gets reset when a non-local label is defined. Changing @UpdateGameComponentsDone to UpdateGameComponentsDone everywhere is one way of fixing it.
2) JSR @DrawScore should be JSR DrawScore
3) Macros should have arguments after the macro name (and apparently they can't be numbers). I'm just going to paste the fixed macros here:
Hope this helps!
1) ASM6 local label scope (labels that start with @) gets reset when a non-local label is defined. Changing @UpdateGameComponentsDone to UpdateGameComponentsDone everywhere is one way of fixing it.
2) JSR @DrawScore should be JSR DrawScore
3) Macros should have arguments after the macro name (and apparently they can't be numbers). I'm just going to paste the fixed macros here:
Code: Select all
MACRO Test_Button var, btn
LDA var
AND #btn
ENDM
MACRO Test_Button_Pressed var, btn
LDA var+1
AND #btn
BNE @Test_Button_Pressed_PrevWasPressed
LDA var
AND #btn
JMP @Test_Button_Pressed_Done
@Test_Button_Pressed_PrevWasPressed:
LDX #$FF
INX
@Test_Button_Pressed_Done:
ENDM
MACRO Test_Button_Released var, btn
LDA var
AND #btn
BNE @Test_Button_Released_CurrWasReleased
LDA var+1
AND #btn
JMP @Test_Button_Released_Done
@Test_Button_Released_CurrWasReleased:
LDX #$FF
INX
@Test_Button_Released_Done:
ENDM
-
- Posts: 21
- Joined: Wed Jun 22, 2022 7:00 am
Re: Problems changing syntax from NESASM to ASM6
Thank you!freem wrote: ↑Mon Aug 01, 2022 11:09 am There's a few issues here:
1) ASM6 local label scope (labels that start with @) gets reset when a non-local label is defined. Changing @UpdateGameComponentsDone to UpdateGameComponentsDone everywhere is one way of fixing it.
2) JSR @DrawScore should be JSR DrawScore
3) Macros should have arguments after the macro name (and apparently they can't be numbers). I'm just going to paste the fixed macros here:
Hope this helps!Code: Select all
MACRO Test_Button var, btn LDA var AND #btn ENDM MACRO Test_Button_Pressed var, btn LDA var+1 AND #btn BNE @Test_Button_Pressed_PrevWasPressed LDA var AND #btn JMP @Test_Button_Pressed_Done @Test_Button_Pressed_PrevWasPressed: LDX #$FF INX @Test_Button_Pressed_Done: ENDM MACRO Test_Button_Released var, btn LDA var AND #btn BNE @Test_Button_Released_CurrWasReleased LDA var+1 AND #btn JMP @Test_Button_Released_Done @Test_Button_Released_CurrWasReleased: LDX #$FF INX @Test_Button_Released_Done: ENDM
With the changes you mentioned plus what I did, now I can assemble it and it works fine.
- Attachments
-
- pong_basic_(ASM6).asm
- (39.12 KiB) Downloaded 21 times