[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

System Specification for C65Fred BowenMarch 1, 1991

2.3.7.2 CPU Operation

The 4502 has the following 8 user registers: A accumulator X index-X Y index-Y Z index-Z B Base-page P Processor status SP Stack pointer PC Program counter

Accumulator

The accumulator is the only general purpose computational register. It can be used for arithmetic functions add, subtract shift, rotate, negate, and for Boolean functions and, or, exclusive-or, and bit operations. it cannot, however, be used as an index register.

Index X

The index register X has the largest number of opcodes pertaining to, or using it. It can be incremented, decremented, or compared, but not used for arithmetic or logical (Boolean) operations. It differs from other index registers in that it is the only register that can be used in indexed-indirect or (bp,X) operations. It cannot be used in indi rect-indexed or (bp),Y mode.

Index Y

The index register Y has the same computational constraints as the X register, but finds itself in a lot less of the opcodes, making it less generally used. But the index Y has one advantage over index X, in that it can be us-ld in indirect-indexed operations or (bp),Y mode.

Index Z

The index register 2 is the most unique, in that it is used in the smallest number of opcodes. It also has the same computation limitations as the X and Y registers, but has am extra feature. Upon reset, the Z register is cleared so that the STZ (store zero ) opcodes and non-indexed indirect opcodes from previous 65C02 designs are emulated. The Z-register can also be used in indirect-indexed or (bp),Z operations.

Base page B register

Early versions of 6502 microprocessors had a special subset of instructions that required less code and less time to execute. These were referred to as the "zero page" instructions. Since the addressing page was always known, and known to be zero, addresses could be specified as a single byte, instead of two bytes.

The CSG4502 also implements this same "zero page" set of instructions, but goes one step further by allowing the programmer to specify which page is to be the "zero page". Now that the programmer can program this page, it is now, not necessarily page zero, but instead, the "selected page". The term "base page" is used, however.

The B register selects which page will be the "base page", and the user sets it by transferring t he contents of the accumulator to it. At reset, the B register is cleared, giving initially a true "zero page".



[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated July 29, 2002.