NESASM3 doesn't recognize .rs directive
Moderator: Moderators
NESASM3 doesn't recognize .rs directive
Hello everyone.
I got into NES development a few days ago. I'm currently reading Nerdy Nights Week 7 (Nested loops and JSR stuff) and making a tiny game in the meanwhile. I'm using the NESASM3 compiler and the FCEUXSP emulator. I'm trying to allocate a few variables like score1 and score2, but all my compiler does is throwing an error.
I tried to compile Nerdy Nights Week 7's .asm but it doesn't give any error so I'm pretty sure that my code is wrong, but I can't tell what am I getting wrong, since I tried to get around the problem a few other ways but none of them worked.
Here is my full .asm code, by the way:
https://pastebin.com/wV7S9ef9
Thank you all in advance.
EDIT: I uncommented some lines.
I got into NES development a few days ago. I'm currently reading Nerdy Nights Week 7 (Nested loops and JSR stuff) and making a tiny game in the meanwhile. I'm using the NESASM3 compiler and the FCEUXSP emulator. I'm trying to allocate a few variables like score1 and score2, but all my compiler does is throwing an error.
I tried to compile Nerdy Nights Week 7's .asm but it doesn't give any error so I'm pretty sure that my code is wrong, but I can't tell what am I getting wrong, since I tried to get around the problem a few other ways but none of them worked.
Here is my full .asm code, by the way:
https://pastebin.com/wV7S9ef9
Thank you all in advance.
EDIT: I uncommented some lines.
Last edited by WolfCorp on Mon Jan 28, 2019 12:12 pm, edited 1 time in total.
Re: NESASM3 doesn't recognize .rs directive
Why are your variables commented out? (semicolon starts a comment)
nesdoug.com -- blog/tutorial on programming for the NES
Re: NESASM3 doesn't recognize .rs directive
Ah, sorry! It was a test, but it doesn't work anyway.
Re: NESASM3 doesn't recognize .rs directive
From what I can tell (from looking at NESASM's usage.txt), the syntax is score1 .rs 1, not .rs score1 1.
Try not to rely on a single emulator for development. FCEUX and its derivatives, in particular, are somewhat lenient in certain areas compared to more accurate emulators.WolfCorp wrote:I'm using the NESASM3 compiler and the FCEUXSP emulator.
Re: NESASM3 doesn't recognize .rs directive
It's not FCEUX's fault. NESASM3 doesn't compile. The Nerdy Nights example works flawlessly...tokumaru wrote:From what I can tell (from looking at NESASM's usage.txt), the syntax is score1 .rs 1, not .rs score1 1.
Try not to rely on a single emulator for development. FCEUX and its derivatives, in particular, are somewhat lenient in certain areas compared to more accurate emulators.WolfCorp wrote:I'm using the NESASM3 compiler and the FCEUXSP emulator.
Re: NESASM3 doesn't recognize .rs directive
My second comment was unrelated to the problem, it was just an advice. Did you read the part about the syntax, though?WolfCorp wrote:It's not FCEUX's fault. NESASM3 doesn't compile. The Nerdy Nights example works flawlessly...
Re: NESASM3 doesn't recognize .rs directive
Sorry for the very delayed reply
Also, I apprenciate your suggestion about the emulator.
In which sense "the syntax part"?
If you refer to the Nerdy Nights tutorial, I don't recall any part about syntax; well, it may be in the very first lessons I believe, but I still think I grasped them to an acceptable degree.
Maybe there's something I missed which was of pivotal importance for the .rs directives to be accepted? I have no idea...
Also, I apprenciate your suggestion about the emulator.
In which sense "the syntax part"?
If you refer to the Nerdy Nights tutorial, I don't recall any part about syntax; well, it may be in the very first lessons I believe, but I still think I grasped them to an acceptable degree.
Maybe there's something I missed which was of pivotal importance for the .rs directives to be accepted? I have no idea...
Re: NESASM3 doesn't recognize .rs directive
Syntax means the order of words, bytes, characters; think "grammar". What you have:
This is not syntactically valid. nesasm3 documentation is here. What you SHOULD have:
Please look at the nesasm3 documentation for RS and you'll understand. It's up to you to get familiar with the syntax of the assembler you're using (nesasm3). That's why assembler documentation exists. :-)
Note also that your variables: line should have been preceded by a semicolon (;), indicating it's a comment. Otherwise, variables: by itself creates a label, which is not what you want.
The spacing/alignment is purely cosmetic in this case, which I cleaned up to make it more readable and easy to understand.
Code: Select all
variables:
.rsset $0000 ;put starting location at 0000
.rs score1 1 ;reserve 1 byte for var score1 at $0000
.rs score2 1 ;reserve 1 byte for var score2 at $0001
.rs marioflip 1 ;reserve 1 byte for var at $0002
Code: Select all
; Variables
.rsset $0000 ;put starting location at 0000
score1 .rs 1 ;reserve 1 byte for var score1 at $0000
score2 .rs 1 ;reserve 1 byte for var score2 at $0001
marioflip .rs 1 ;reserve 1 byte for var at $0002
Note also that your variables: line should have been preceded by a semicolon (;), indicating it's a comment. Otherwise, variables: by itself creates a label, which is not what you want.
The spacing/alignment is purely cosmetic in this case, which I cleaned up to make it more readable and easy to understand.
Re: NESASM3 doesn't recognize .rs directive
Thank you, I didn't understand he meant the assembler's syntax, so that's my bad.koitsu wrote:Syntax means the order of words, bytes, characters; think "grammar". What you have:
This is not syntactically valid. nesasm3 documentation is here. What you SHOULD have:Code: Select all
variables: .rsset $0000 ;put starting location at 0000 .rs score1 1 ;reserve 1 byte for var score1 at $0000 .rs score2 1 ;reserve 1 byte for var score2 at $0001 .rs marioflip 1 ;reserve 1 byte for var at $0002
Please look at the nesasm3 documentation for RS and you'll understand. It's up to you to get familiar with the syntax of the assembler you're using (nesasm3). That's why assembler documentation exists.Code: Select all
; Variables .rsset $0000 ;put starting location at 0000 score1 .rs 1 ;reserve 1 byte for var score1 at $0000 score2 .rs 1 ;reserve 1 byte for var score2 at $0001 marioflip .rs 1 ;reserve 1 byte for var at $0002
Note also that your variables: line should have been preceded by a semicolon (;), indicating it's a comment. Otherwise, variables: by itself creates a label, which is not what you want.
The spacing/alignment is purely cosmetic in this case, which I cleaned up to make it more readable and easy to understand.
Also, I'll check the NESASM3 documentation from now, it is pretty darn useful!
Now the assembler doesn't throw any errors and compiles flawlessly.
Thank you for your patience