Page 2 of 2
Re: Need some direction with multiple backgrounds
Posted: Sun Sep 20, 2015 6:09 am
by tokumaru
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.
Re: Need some direction with multiple backgrounds
Posted: Sun Sep 20, 2015 6:54 pm
by thefox
Was the double-post intentional as well?

Re: Need some direction with multiple backgrounds
Posted: Sun Sep 20, 2015 9:27 pm
by tokumaru
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
Posted: Sat Oct 03, 2015 2:46 pm
by log in
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.
Re: Need some direction with multiple backgrounds
Posted: Sat Oct 03, 2015 3:05 pm
by dougeff
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]
Re: Need some direction with multiple backgrounds
Posted: Sat Oct 03, 2015 3:17 pm
by dougeff
when i put it all together i seem to lose focus and control over my code.
Consider making a flowchart of the code, to help you keep it organized.
Re: Need some direction with multiple backgrounds
Posted: Sat Oct 03, 2015 3:58 pm
by tokumaru
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
Posted: Mon Oct 05, 2015 6:54 pm
by Sogona
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.
NESASM3 requires you to put A, but I believe ASM6 will throw an error if you do this.
However,
6502.org says
and
is the standard syntax
Re: Need some direction with multiple backgrounds
Posted: Mon Oct 05, 2015 6:55 pm
by rainwarrior
There's no "standard" syntax. That particular article on 6502.org just adheres to this particular convention.
Re: Need some direction with multiple backgrounds
Posted: Mon Oct 05, 2015 7:01 pm
by Sogona
rainwarrior wrote:There's no "standard" syntax. That particular article on 6502.org just adheres to this particular convention.
So MOS didn't come up with the instruction mnemonics?
Re: Need some direction with multiple backgrounds
Posted: Mon Oct 05, 2015 7:07 pm
by tokumaru
Sogona wrote:NESASM3 requires you to put A, but I believe ASM6 will throw an error if you do this.
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.
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.