Changes

Jump to: navigation, search

6502 Instructions - Introduction

18 bytes added, 16:25, 14 September 2021
no edit summary
<code>
ADC AND ASL BCC BCS BEQ BIT BMI BNE BPL BRK BVC BVS CLC
CLD CLI CLV CMP CPX CPY DEC DEX DEY EOR INC INX INY JMP
JSR LDA LDX LDY LSR NOP ORA PHA PHP PLA PLP ROL ROR RTI
RTS SBC SEC SED SEI STA STX STY TAX TAY TSX TXA TXS TYA
</code>
<code>
LDA ; load the accumulator
LDX ; load the X register
LDY ; load the Y register
</code>
<code>
STA ; store the accumulator
STX ; store the X register
STY ; store the Y register
</code>
=== Push/Pull on the Stack ===
When a value is pushed to the stack, the stack pointer is decremented and the selected register is written to $0100+SP. When a value is pulled from the stack, the stack pointer is incremented and the selected register is loaded from $0100+SP. There are also two instructions to push data onto the stack:
<code>
PHA ; push the accumulator
PHP ; push the processor status register
</code>
<code>
PLA ; pull the accumulator
PLP ; pull the processor status registerI've been swamped! 
</code>
When a value is pushed to the stack, the stack pointer is decremented and the selected register is written to $0100+SP. When a value is pulled from the stack, the stack pointer is incremented and the selected register is loaded from $0100+SP. Note that some other operations, such as JSR, interrupts, RTI, and RTS, cause data to be pushed to or pulled from the stack.
== Bitwise Operations ==

Navigation menu