| |
btuck Account closed
Registered: Apr 2002 Posts: 5 |
Help
Heh, still haven't found a board for c64 programing or 6502 so I guess I'll ask my question here. ;)
-------------------------------------------------------
Some 6502 instructions make use of bitwise logic.
This includes AND, OR, and EOR (Exclusive-OR). The tables below illustrate the effects
of these operations:
AND 1 1 -> 1 "both"
1 0 -> 0
0 1 -> 0
0 0 -> 0
OR 1 1 -> 1 "either one or both"
1 0 -> 1
0 1 -> 1
0 0 -> 0
EOR 1 1 -> 0 "one or the other but not both"
1 0 -> 1
0 1 -> 1
0 0 -> 0
-------------------------------------------------------
It doesn't support (0 1 -> 1) and (1 0 -> 0) like this:
0 0 -> 0
1 0 -> 1
0 1 -> 0
1 1 -> 0
and the other way around
0 0 -> 0
1 0 -> 0
0 1 -> 1
1 1 -> 0
Is there an easy way to do this kinda bitwise logic? and if how? eh.. :)
Thanks |
|
| |
btuck Account closed
Registered: Apr 2002 Posts: 5 |
nah.. heh.. nevermind.. I found me a way.. kinda slow perhaps.. but it works.. :) |
| |
Viktor Account closed
Registered: Apr 2002 Posts: 78 |
I think, yes.
You can code the first with this way:
row1 and (row2 eor 1)
(leave the row 1 negate the row2 and make between these an and)
The second one is near the same way.
(row1 eor 1) and row2
(negate the row 1 and with row2)
Viktor
|
| |
Viktor Account closed
Registered: Apr 2002 Posts: 78 |
And why that you need this?
Viktor |