Program counter (PC) is used as a pointer to the next program instruction that should be executed. With each new instruction value of program counter is being set to point on the next instruction in program memory, which is going to be decoded and executed.
Stack pointer (SP) points to the address of SRAM memory where data is written to or read from in case of PUSH and POP instructions respectively. When these instructions occur value stored in SP is internally incremented or decremented.
Accumulator register (A) is the main register which handles all arithmetical, logical or data transfer operations.
Index register (X) could behave as register A in large number of instructions. Also, register X is used in the case of index addressing.
Flag register (F) contains bits which describe result of a previously executed instruction. It also has a role during selection of a RAM memory page in case when PSoC microcontroller has more than 256 bytes of
RAM. Bit Flag Zero (Z) marks that accumulator stores a zero, while Carry (C) marks that there has been carrying during arithmetic or logic operations.
Arithmetic logic unit (ALU) is a standard part of a CPU, which is used for arithmetic operations like addition, subtracting and shifting (left or right), as well as logic operations. Data handled by instructions could be stored in internal registers A and X, or in RAM data memory
No comments:
Post a Comment