histcomp:6502

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

histcomp:6502 [2024-08-27 03:33] – created asdfhistcomp:6502 [2024-08-28 06:22] (current) asdf
Line 1: Line 1:
-====== 6502 ======+====== MOS Technology 6502 ======
 ===== Architecture ===== ===== Architecture =====
 The 6502 has only three general-purpose registers: A, X, and Y, all of which are 8 bits wide. It also has an eight-bit stack pointer (S) and an eight-bit status register (P). The stack is hardwired to page 1 (\$0100--\$01FF) and grows down. Addresses are always stored in little-endian format.  The 6502 has only three general-purpose registers: A, X, and Y, all of which are 8 bits wide. It also has an eight-bit stack pointer (S) and an eight-bit status register (P). The stack is hardwired to page 1 (\$0100--\$01FF) and grows down. Addresses are always stored in little-endian format. 
  
 ===== Instruction set ===== ===== Instruction set =====
 +6502 instructions can often use multiple addressing modes. Examples include:
 +
 +  * implied: TAX
 +  * immediate: ADC #\$01
 +  * zero page: STX \$A3
 +  * zero page indexed: LDX \$3A,Y
 +  * absolute: LDA \$2000
 +  * indirect: JMP (\$C1FF)
 +  * relative: BEQ -5
 +  * absolute indexed: EOR \$2000,X / AND \$2000,Y
 +  * indexed indirect: CMP (\$65,X)
 +  * indirect indexed: ORA (\$55),Y
 +
 +Out of a possible 256, the NMOS 6502 had only 151 legal opcodes. Because the chip used a PLA instruction decoder, the illegal opcodes could have effects from combining existing valid instructions to completely locking up the processor [(pagetableIllegalOpcodes)]. 
  
 <table |tab_nmosops> <table |tab_nmosops>
-<caption>NMOS opcodes (illegal opcodes omitted)</caption>+<caption>NMOS opcodes (illegal opcodes omitted) [(pastraiser6502)]</caption>
 ^  ^ x0 ^ x1 ^ x2 ^ x3 ^ x4 ^ x5 ^ x6 ^ x7 ^ x8 ^ x9 ^ xA ^ xB ^ xC ^ xD ^ xE ^ xF ^ ^  ^ x0 ^ x1 ^ x2 ^ x3 ^ x4 ^ x5 ^ x6 ^ x7 ^ x8 ^ x9 ^ xA ^ xB ^ xC ^ xD ^ xE ^ xF ^
 ^ 0x | BRK | ORA (a8,X) | | | | ORA a8 | ASL a8 | | PHP | ORA #d8 | ASL A | | | ORA a16 | ASL a16 | | ^ 0x | BRK | ORA (a8,X) | | | | ORA a8 | ASL a8 | | PHP | ORA #d8 | ASL A | | | ORA a16 | ASL a16 | |
Line 32: Line 46:
 ===== References ===== ===== References =====
 [(Zaks1983>//Programming the 6502// (1983) https://archive.org/details/Programming_the_6502_OCR/mode/2up)] [(Zaks1983>//Programming the 6502// (1983) https://archive.org/details/Programming_the_6502_OCR/mode/2up)]
 +[(pastraiser6502>https://pastraiser.com/cpu/6502/6502_opcodes.html)]
 +[(pagetableIllegalOpcodes>https://www.pagetable.com/?p=39)]
  
 ~~REFNOTES~~ ~~REFNOTES~~
  • histcomp/6502.1724729583.txt.gz
  • Last modified: 2024-08-27 03:33
  • by asdf