Hi everybody.
I've just begun programing the 6502, and heh.. maan this is hard..
so I'd like some help..
My teacher gave me this supposedly "easy" task to write a code for.
I have 1 Byte stored at adress 1 and another one at adress 2,
now I must compare these two bytes bit for bit and write to different adresses depending on how they compare.
Let's say that the first bit of adress one is "1" and the first bit of adress two is "1" then I should write a "1" to the first
bit of adress 3, and a "0" to adress 4,5
But if bit one of adress one is "1" and bit one of adress 2 is "0" then I should write a "1" to the first bit of
adress 4, and a "0" to adress 3,5
Or if bit one of adress one is "0" and bit one of adress two is "1" then I should write a "1" to the first bit of the
byte at adress 5, and a "0" to adress 3,4
and finally if first bit of both adress 1 and 2 contains a "0" I should write a "0" to all 3 adresses
(adress 3,4,5). This I should do for all the bits of the bytes from the 2 adresses.
ex.
Adress 1 first byte : 00100010
Adress 2 second byte: 00100000
First bit of the two adresses is "0" so I should write 0 to adress 3,4,5.
Second bit of the two ardesses is "1" and "0" so I should write a "1" to 4 and "0" to adress 3,5
third bit (see first bit)
forth bit (see first bit)
fifth bit (see first bit)
sixth bit of the two adresses is "1" and "1" so I should write a "1" to adress 3 and "0" to adress 4,5
seventh bit (see first bit)
eight bit (see first bit)
Can anybody be kind and give me an example code to study?
Thanks and I hope you won't mind the bad english of a lame newbie