BTW, I like to use "+0" like this when working with 16-bit variables, even though it doesn't do anything, just to make it clear that it's a 2-byte variable. This is particularly helpful when you manipulate only the lower byte, for whatever reason.
Need some direction with multiple backgrounds
Moderator: Moderators
Re: Need some direction with multiple backgrounds
Oh, you're right. I'll just pretend it was intentional... you know, to prevent mindless copying & pasting. 
BTW, I like to use "+0" like this when working with 16-bit variables, even though it doesn't do anything, just to make it clear that it's a 2-byte variable. This is particularly helpful when you manipulate only the lower byte, for whatever reason.
BTW, I like to use "+0" like this when working with 16-bit variables, even though it doesn't do anything, just to make it clear that it's a 2-byte variable. This is particularly helpful when you manipulate only the lower byte, for whatever reason.
Re: Need some direction with multiple backgrounds
Was the double-post intentional as well? 
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Re: Need some direction with multiple backgrounds
Crap! I've been posting from my phone too often. Posting on forums with a phone is usually a chore, due to the smaller screen and reduced typing capabilities, so I end up making these stupid mistakes. Sorry about that.
Re: Need some direction with multiple backgrounds
He guys i had some time to code again.
I learned some things and got a error.
The first thing i did was taking a step back.
I learned some more about NMI. The nesdev tutorial with the clock example was great.
I also found an example code that switched between 3 background ( red,green and blue) with the help of loose flags.
Flags are still a bit unclear to me.
And i learn nothing from copying and pasta.
When i tried to work with the 2 codes from this topic.
I got this error : ASL operand is missing.
Should LDA screen number be replaced with a binary number ? #10011001
This is also a way of setting a flag if i am correct ?
So what is the problem with this ASL ?
I'm struggeling with my english trying to explain and ask things.
I'm also struggeling with the hole code. I seem to understand the parts. But when i put it all together i seem to lose focus and controlover my code.
I learned some things and got a error.
The first thing i did was taking a step back.
I learned some more about NMI. The nesdev tutorial with the clock example was great.
I also found an example code that switched between 3 background ( red,green and blue) with the help of loose flags.
Flags are still a bit unclear to me.
And i learn nothing from copying and pasta.
When i tried to work with the 2 codes from this topic.
I got this error : ASL operand is missing.
Should LDA screen number be replaced with a binary number ? #10011001
This is also a way of setting a flag if i am correct ?
So what is the problem with this ASL ?
I'm struggeling with my english trying to explain and ask things.
I'm also struggeling with the hole code. I seem to understand the parts. But when i put it all together i seem to lose focus and controlover my code.
im a newbie,lets see how far i can get
Re: Need some direction with multiple backgrounds
If you're trying to ASL a RAM address, for example 00...
If A (Accumulator) is being ASL -ed
[Syntax may vary in different assemblers]
Code: Select all
asl $00Code: Select all
asl Anesdoug.com -- blog/tutorial on programming for the NES
Re: Need some direction with multiple backgrounds
Consider making a flowchart of the code, to help you keep it organized.when i put it all together i seem to lose focus and control over my code.
nesdoug.com -- blog/tutorial on programming for the NES
Re: Need some direction with multiple backgrounds
For some assemblers, A is implied if you write ASL with no operand, but others (NESASM?) will require you to write ASL A.
Re: Need some direction with multiple backgrounds
NESASM3 requires you to put A, but I believe ASM6 will throw an error if you do this.tokumaru wrote:For some assemblers, A is implied if you write ASL with no operand, but others (NESASM?) will require you to write ASL A.
However, 6502.org says
Code: Select all
lsr a
Code: Select all
asl a
- rainwarrior
- Posts: 8062
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Need some direction with multiple backgrounds
There's no "standard" syntax. That particular article on 6502.org just adheres to this particular convention.
Re: Need some direction with multiple backgrounds
So MOS didn't come up with the instruction mnemonics?rainwarrior wrote:There's no "standard" syntax. That particular article on 6502.org just adheres to this particular convention.
Re: Need some direction with multiple backgrounds
ASM6 doesn't throw any errors if you put the A, it appears to work fine. An older version did have a bug related to this though... It couldn't handle variables starting with "A" after ASL or any other instruction that can use the accumulator as an implied operand. This has been fixed a long time ago.Sogona wrote:NESASM3 requires you to put A, but I believe ASM6 will throw an error if you do this.
I don't know what the standard is in this case (if there even is one), but I learned to write these instructions without the A and have always done it that way.
EDIT: Apparently, the official syntax requires the A.