MC81F4x16
9.5 Stack Area
The stack provides the area where the return address is saved before a jump is performed during the
processing routine at the execution of a subroutine call instruction or the acceptance of an interrupt.
When returning from the processing routine, executing the subroutine return instruction [RET] restores
the contents of the program counter from the stack; executing the interrupt return instruction [RETI]
restores the contents of the program counter and flags.
The save/restore locations in the stack are determined by the stack pointed (SP). The SP is
automatically decreased after the saving, and increased before the restoring. This means the value of
the SP indicates the stack location number for the next save. Refer to Figure 9-4. .
9.6 Control Registers ( SFR )
The control registers are used by the CPU and Peripheral function blocks for controlling the desired
operation of the device. Therefore these registers contain control and status bits for the interrupt
system, the timer/ counters, analog to digital converters and I/O ports. The control registers are in
address range of 0B0H to 0FFH. It also be called by SFR(Special Function Registers).
Note that unoccupied addresses may not be implemented on the chip. Read accesses to these
addresses will in general return random data, and write accesses will have an indeterminate effect.
More detailed information of each registers are explained in each peripheral section.
Example : To write at CKCTLR
LDM CKCTLR,#0AH ;Divide ratio(÷32)
60
October 19, 2009 Ver.1.35