FXTH870xD
Sensors
Freescale Semiconductor, Inc.
53
8.3
Programmer’s Model and CPU Registers
Figure 40
shows the five CPU registers. CPU registers are not part of the memory map.
Figure 40. CPU Registers
8.3.1
Accumulator (A)
The A accumulator is a general-purpose 8-bit register. One operand input to the arithmetic logic unit (ALU) is connected to the
accumulator and the ALU results are often stored into the A accumulator after arithmetic and logical operations. The accumulator
can be loaded from memory using various addressing modes to specify the address where the loaded data comes from, or the
contents of A can be stored to memory using various addressing modes to specify the address where data from A will be stored.
Reset has no effect on the contents of the A accumulator.
8.3.2
Index Register (H:X)
This 16-bit register is actually two separate 8-bit registers (H and X), which often work together as a 16-bit address pointer where
H holds the upper byte of an address and X holds the lower byte of the address. All indexed addressing mode instructions use
the full 16-bit value in H:X as an index reference pointer; however, for compatibility with the earlier M68HC05 Family, some
instructions operate only on the low-order 8-bit half (X).
Many instructions treat X as a second general-purpose 8-bit register that can be used to hold 8-bit data values. X can be cleared,
incremented, decremented, complemented, negated, shifted, or rotated. Transfer instructions allow data to be transferred from
A or transferred to A where arithmetic and logical operations can then be performed.
For compatibility with the earlier M68HC05 Family, H is forced to 0x00 during reset. Reset has no effect on the contents of X.
8.3.3
Stack Pointer (SP)
This 16-bit address pointer register points at the next available location on the automatic last-in-first-out (LIFO) stack. The stack
may be located anywhere in the 64-Kbyte address space that has RAM and can be any size up to the amount of available RAM.
The stack is used to automatically save the return address for subroutine calls, the return address and CPU registers during
interrupts, and for local variables. The AIS (add immediate to stack pointer) instruction adds an 8-bit signed immediate value to
SP. This is most often used to allocate or deallocate space for local variables on the stack.
SP is forced to 0x00FF at reset for compatibility with the earlier M68HC05 Family. HCS08 programs normally change the value
in SP to the address of the last location (highest address) in on-chip RAM during reset initialization to free up direct page RAM
(from the end of the on-chip registers to 0x00FF).
The RSP (reset stack pointer) instruction was included for compatibility with the M68HC05 Family and is seldom used in new
HCS08 programs because it only affects the low-order half of the stack pointer.
SP
PC
CONDITION CODE REGISTER
CARRY
ZERO
NEGATIVE
INTERRUPT MASK
HALF-CARRY (FROM BIT 3)
TWO’S COMPLEMENT OVERFLOW
H
X
0
0
0
7
15
15
7
0
ACCUMULATOR
A
INDEX REGISTER (LOW)
INDEX REGISTER (HIGH
)
STACK POINTER
8
7
PROGRAM COUNTER
16-BIT INDEX REGISTER H:X
CCR
C
V 1 1 H I N Z
Содержание FXTH870 D Series
Страница 86: ...FXTH870xD Sensors 84 Freescale Semiconductor Inc Figure 57 Data Flow For Measurements...
Страница 170: ...FXTH870xD Sensors 168 Freescale Semiconductor Inc 19 Package Outline Figure 127 QFN Case Outline...
Страница 171: ...FXTH870xD Sensors Freescale Semiconductor Inc 169 Figure 128 QFN Case Outline...
Страница 172: ...FXTH870xD Sensors 170 Freescale Semiconductor Inc Figure 129 QFN Case Outline...
Страница 173: ...FXTH870xD Sensors Freescale Semiconductor Inc 171...