Motorola MC6805R Series Advance Information page 28

8-bit microcomputers
Table of Contents

Advertisement

4.4 STACK POINTER (SP)
The stack pointer is a 12-bit register that contains the address of the next free location on the stack.
During an MCU reset or the reset stack pointer (RSP) instruction, the stack pointer is set to location
$07F. The stack pointer is then decremented as data is pushed onto the stack and incremented as
data is pulled from the stack. The seven most significant bits of the stack pointer are permanently
set to 0000011. Subroutines and interrupts may be nested down to location $061 (31 bytes maxi-
mum) which allows the programmer to use up to 15 levels of subroutine calls (less if interrupts are
allowed).
4.5 CONDITION CODE REGISTER (CC)
The condition code register is a 5-bit register in which four bits are used to indicate the results of the
instruction just executed. These bits can be individually tested by a program and specific action
taken as a result of their state. Each bit is explained in the following paragraphs.
4.5.1 Half Carry (H)
Set during ADD and ADC operations to indicate that a carry occurred between bits 3 and 4.
4.5.2 Interrupt
(I)
When this bit is set, the timer and external interrupts (INT and INT2) are masked (disabled), If an
interrupt occurs while this bit is set, the interrupt is latched and is processed as soon as the interrupt
bit is cleared.
4.5.3 Negative (N)
When set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was
negative (bit 7 in the result is a logic one).
4.5.4 Zero (Z)
When set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was
zero.
4.5.5 Carry/Borrow (C)
When set, this bit indicates that a carry or borrow out of the arithmetic logical unit (ALU) occurred
during the last arithmetic operation. This bit is also affected during bit test and branch instructions
plus shifts and rotates.
4-2

Advertisement

Table of Contents
loading

Table of Contents