
HT46RU75D-1
Rev. 1.10 10 January 10, 2008
Accumulator -ACC
The accumulator, ACC, is related to the ALU operations.
It is mapped to location 05H of the RAM and is capable
of operating with immediate data. The data movement
between two data memory locations must pass through
the ACC.
Arithmetic and Logic Unit -ALU
This circuit performs 8-bit arithmetic and logic opera-
tions and provides the following functions:
·Arithmetic operations - ADD, ADC, SUB, SBC, DAA
·Logic operations - AND, OR, XOR, CPL
·Rotation - RL, RR, RLC, RRC
·Increment and Decrement - INC, DEC
·Branch decision - SZ, SNZ, SIZ, SDZ etc.
The ALU not only saves the results of a data operation
but also changes the status register.
Status Register -STATUS
The status register is 8 bits wide and contains, a carry
flag (C), an auxiliary carry flag (AC), a zero flag (Z), an
overflow flag (OV), a power down flag (PDF), and a
watchdog time-out flag (TO). It also records the status
information and controls the operation sequence.
Except for the TO and PDF flags, the status register bits
can be altered by instructions similar to other registers.
Data written into the status register does not alter the TO
or PDF flags. Operations related to the status register,
however, may yield different results from those in-
tended. The TO and PDF flags can only be changed by
a Watchdog Timer overflow, a device power-up, or
clearing the Watchdog Timer and executing the ²HALT²
instruction. The Z, OV, AC, and C flags reflect the status
of the latest operations.
On entering the interrupt sequence or executing a sub-
routine call, the status register will not be automatically
pushed onto the stack. If the contents of the status regis-
ter is important, and if the subroutine is likely to corrupt
the status register, the programmer should take precau-
tions and save it properly.
Interrupts
The device provides one external interrupt, one UART
interrupt, two internal timer/event counter interrupts and
an ADC interrupt. The interrupt control register INTC0,
and interrupt control register INTC1, both contain the in-
terrupt control bits that are used to set the enable/dis-
able status and record the interrupt request flags.
Once an interrupt subroutine is serviced, the other inter-
rupts will be disabled, as the EMI bit will be automatically
cleared, preventing interrupt nesting. Other interrupt re-
quests may take place during this interval, but only the
interrupt request flag will be recorded. If a certain inter-
rupt requires servicing within the service routine, the
EMI bit and the corresponding bit of INTC0 or INTC1
may be set in order to permit interrupt nesting to take
place. Once the stack is full, the interrupt request will not
be acknowledged, even if the related interrupt is en-
abled, until the Stack Pointer is decremented. If immedi-
ate service is desired, the stack should be prevented
from becoming full.
All interrupts will provide a wake-up function. As an in-
terrupt is serviced, a control transfer occurs by pushing
the contents of the program counter onto the stack fol-
lowed by a branch to a subroutine at the specified loca-
tion in the Program Memory. Only the contents of the
program counter is pushed onto the stack. If the con-
tents of the accumulator or of the status register is al-
tered by the interrupt service program, this may corrupt
the desired control sequence, therefore the contents
should be saved in advance.
External interrupts are triggered by an edge transition
on the INT pin. A configuration option determines the
type of edge transition, high to low, low to high, or both
Bit No. Label Function
0C
C is set if an operation results in a carry during an addition operation or if a borrow does not
take place during a subtraction operation; otherwise C is cleared. C is also affected by a ro-
tate through carry instruction.
1AC
AC is set if an operation results in a carry out of the low nibbles in addition or no borrow from
the high nibble into the low nibble in subtraction; otherwise AC is cleared.
2 Z Z is set if the result of an arithmetic or logic operation is zero; otherwise Z is cleared.
3OV
OV is set if an operation results in a carry into the highest-order bit but not a carry out of the
highest-order bit, or vice versa; otherwise OV is cleared.
4 PDF PDF is cleared by either a system power-up or executing the ²CLR WDT²instruction.
PDF is set by executing the ²HALT²instruction.
5TO
TO is cleared by a system power-up or executing the ²CLR WDT²or ²HALT²instruction.
TO is set by a WDT time-out.
6~7 ¾Unused bit, read as ²0²
Status (0AH) Register