Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------- REGISTERS --------
- A - accumulator, 8-bit
- X - index, 8-bit
- Y - index, 8-bit
- SP - stack pointer, 6-bit?
- PC - program counter, 12-bit
- F - flags: carry, negative, zero
- 3KB of RAM to put the program and data in
- -------- OPCODE FORMAT --------
- ffffff00 - zero
- ffffff01 nnnnnnnn - zeropage (or immediate)
- ffffff10 nnnnnnnn nnnnnnnn - absolute
- ffffff11 nnnnnnnn nnnnnnnn - absolute,x
- The bottom two bits tell the CPU how many bytes of parameters to read and put into a buffer.
- For a constant it may be zero or an 8-bit value. Absolute and Absolute,x are reserved.
- For memory it may be zero (first byte of RAM), zeropage, absolute or absolute,x.
- For a branch, an 8-bit parameter is relative and a 16-bit parameter is absolute. Jumping to absolute,x is allowed.
- Memory+Y acts like (zeropage),y for zeropage instructions.
- f = function, from list below:
- -------- FUNCTION TABLE --------
- 000000 00 LDA constant
- 000001 01 LDA memory
- 000010 02 LDX constant
- 000011 03 LDX memory
- 000100 04 LDY constant
- 000101 05 LDY memory
- 000110 06 CLC
- 000111 07 SEC
- 001000 08 ADD constant
- 001001 09 ADD memory
- 001010 0A SUB constant
- 001011 0B SUB memory
- 001100 0C ADC constant
- 001101 0D ADC memory
- 001110 0E SBC constant
- 001111 0F SBC memory
- 010000 10 NOR constant
- 010001 11 NOR memory
- 010010 12 XOR constant
- 010011 13 XOR memory
- 010100 14 CMP constant
- 010101 15 CMP memory
- 010110 16 CPX constant
- 010111 17 CPX memory
- 011000 18 ASL
- 011001 19 ROL memory
- 011010 1A LSR
- 011011 1B ROR memory
- 011100 1C CPY constant
- 011101 1D INC memory
- 011110 1E Unused
- 011111 1F DEC memory
- 100000 20 NOP - neither TAX or TXA firing
- 100001 21 STA memory
- 100010 22 TAX
- 100011 23 STX memory
- 100100 24 TXA
- 100101 25 STY memory
- 100110 26 SWAP (X and Y) - TAX and TXA firing at the same time
- 100111 27 RTS
- 101000 28 LDA memory+y
- 101001 29 STA memory+y
- 101010 3A INC
- 101011 3B DEC
- 101100 3C INX
- 101101 3D DEX
- 101110 2E INY
- 101111 2F DEY
- 110000 30 PHP
- 110001 31 PLP
- 110010 32 PHA
- 110011 33 PLA
- 110100 34 PHX
- 110101 35 PLX
- 110110 36 PHY
- 110111 37 PLY
- 111000 38 BRA/JMP location
- 111001 39 BSR/JSR location
- 111010 3A BPL/JPL location
- 111011 3B BMI/JMI location
- 111100 3C BNE/JNE location
- 111101 3D BEQ/JEQ location
- 111110 3E BCC/JCC location
- 111111 3F BCS/JCS location
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement