Bitwise operations: Difference between revisions

Content added Content deleted
(→‎{{header|68000 Assembly}}: also revised 6502 example)
m (→‎{{header|6502 Assembly}}: forgot a # on an immediate operand)
Line 155: Line 155:
;NOT
;NOT
<lang 6502asm>LDA #$08
<lang 6502asm>LDA #$08
EOR 255</lang>
EOR #255</lang>


The 6502 doesn't have arithmetic shift right, but it can be replicated, provided the negative flag is set according to the value in the accumulator.
The 6502 doesn't have arithmetic shift right, but it can be replicated, provided the negative flag is set according to the value in the accumulator.
Line 172: Line 172:
<lang 6502asm>LDA #$01
<lang 6502asm>LDA #$01
ROR ;if the carry was set prior to the ROR, A = 0x80. If clear, A = 0.</lang>
ROR ;if the carry was set prior to the ROR, A = 0x80. If clear, A = 0.</lang>



=={{header|68000 Assembly}}==
=={{header|68000 Assembly}}==