Category:6502 Assembly: Difference between revisions

Content added Content deleted
Line 65: Line 65:
===Immediate===
===Immediate===
A constant value is directly used as the argument for a command.
A constant value is directly used as the argument for a command.
<lang 6502asm>LDA #3 ;load the number 3 into the accumulator
<lang 6502asm>LDA #3 ;load the number 3 into the accumulator
AND #%10000000 ;bitwise AND the binary value 1000 0000 with the value in the accumulator
AND #%10000000 ;bitwise AND the binary value 1000 0000 with the value in the accumulator
SBC #$30 ;subtract hexadecimal 0x30 from the accumulator. If the carry flag is clear, also subtract 1 after that.</lang>
SBC #$30 ;subtract hexadecimal 0x30 from the accumulator. If the carry flag is clear, also subtract 1 after that.</lang>


===Zero Page===
===Zero Page===