MOS Technology 6502/650x/651x architectureMemoryProgram, data and stack memories occupy the same memory space. The total addressable memory size is:
Program memory - program can be located anywhere in memory. Jump and subroutine call instructions can be used to jump anywhere in memory. Conditional branches are limited to 256 bytes (-127 - +128 bytes from current location). Data memory - data can be anywhere in memory space. 16-bit data pointers are stored as the low-order byte first, then the high-order byte. Stack memory is limited to 256 bytes. Stack is always located at addresses 100h - 1FFh. Reserved memory locations:
InterruptsIRQ - maskable interrupt. When the interrupt occurs the program counter and processor status are stored in the stack, the further interrupts are disabled and the processor jumps to memory location address of which is stored in memory FFFEh - FFFFh. To return from the interrupt the processing routine should use RTI instruction. This interrupt can be enabled/disabled using CLI/SEI instructions. This interrupt type is not available on 6507 processor. NMI - non-maskable interrupt. When the interrupt occurs the program counter and processor status are stored in the stack, the further interrupts are disabled and the processor jumps to memory location address of which is stored in memory FFFAh - FFFBh. To return from the interrupt the processing routine should use RTI instruction. This interrupt can not be disabled. This interrupt type is not available on 6504, 6505, 6507, 6514 and 6515 processors. I/O portsNone. RegistersAccumulator is an 8-bit register used for arithmetic and logic operations. X index is an 8-bit register usually used as an index in different types of index addressing modes. Y index is an 8-bit register usually used as an index in different types of index addressing modes. Program counter is a 16-bit register. Stack pointer is an 8-bit register. The processor assumes that the higher 8-bits of the stack pointer are always set to 01h thus limiting stack to memory range 100h - 1FFh. Processor Status register contains the following flags:
Instruction Set6502/650x instruction set consists of 56 instructions:
Addressing modesImplied - the data value/data address is implicitly associated with the instruction. Accumulator - the instruction implies that the data is in the accumulator. Immediate - 8-bit data is provided as the second byte in the instruction. Absolute (direct) - the second and the third bytes of the instruction specify the memory address where data is located. Zero page - the second byte in the instruction points to location in page zero (0000h - 00FFh) where data is located. Indexed zero page - the contents of the X or Y register is added to the second byte of the instruction (carry is ignored), and the resulting byte is a memory offset in page zero (0000h - 00FFh) where data is located. This form of addressing is written as "addr8, X" or "addr8, Y", where addr8 is an 8-bit value. Indexed absolute - the contents of the X or Y register is added to the 16-bit pointer specified in the second and third bytes of the instruction, and the resulting 16-bit value is a pointer to memory where data is located. This form of addressing is written as "addr16, X" or "addr16, Y", where addr16 is a 16-bit value. Relative - one byte offset is added to the contents of the program counter register. The offset is a signed number in the range -127 - +128. Indexed indirect - the contents of the X register is added to the second byte provided in the instruction (carry is ignored), the resulting byte is a memory offset in page zero where a 16-bit pointer is stored. The 16-pointer points to data. This type of addressing is written as "(addr8, X)", where addr8 is an 8-bit value. This addressing is useful for addressing an array of data pointers. Indirect indexed - the second byte in the instruction points to memory in page zero where 16-bit data pointer is stored. This pointer is added to the contents of the Y register, the resulting 16-bit value is an offset to memory where data is located. This type of addressing is written as "(addr8), Y", where addr8 is an 8-bit value. Absolute indirect - The second and third bytes in the instruction specify the memory address containing 16-bit data, which is loaded into the program counter. This type of addressing is written as "(addr16)", where addr16 is a 16-bit value.
|
Search CPU-WorldIdentify partRelated linksQuick LinksJump to CPU / Family | |||||||||||