Changes

MOS 6502

1,223 bytes added, 20:12, 2 September 2024
Originally the CPC was destined to be designed around the 6502 processor. But when Amstrad approached [[Locomotive Software]] to develop a Basic for it with a very tight deadline, Locomotive PLC, who already had a Z80 Basic in the works, urged and convinced Amstrad to switch to the Z80.
 
<br>
 
== Registers ==
 
{| class="wikitable" style="white-space: nowrap;"
! Register !! Size !! Description !! Notes
|-
| A (Accumulator) || 8-bit || Main register for arithmetic, logic, and data transfer || Most operations use this register
|-
| X (Index Register X) || 8-bit || Used for indexing memory and loop counters || Can be used for addressing modes like Indexed Indirect, Zero Page Indexed, and Absolute Indexed
|-
| Y (Index Register Y) || 8-bit || Used for indexing memory and loop counters || Often used in Absolute and Zero Page Indexed addressing
|-
| P (Processor Status) || 8-bit ||
* bit7 - N - Negative Flag
* bit6 - V - Overflow Flag
* bit5 - Unused (always set to 1)
* bit4 - B - Break Command
* bit3 - D - Decimal Mode Flag
* bit2 - I - Interrupt Disable Flag
* bit1 - Z - Zero Flag
* bit0 - C - Carry Flag
|| The status register is modified by arithmetic and logic operations, as well as interrupts
|-
| S (Stack Pointer) || 8-bit || Points to the current location in the stack || Stack is located in page 1 ($0100-$01FF), 8-bit S is offset to this base
|-
| PC (Program Counter) || 16-bit || Points to the next instruction to be executed || Automatically increments as instructions are executed
|}
<br>
13,146
edits