
7751 SERIES SOFTWARE MANUAL
4–133
4.3 Notes for programming
Make sure of the following when programming.
(1)
Set an initial value to the stack pointer because it is undefined immediately after removing reset.
Example)
LDX #27FH
TXS
(2)
Do not set a value other than “00
16
” to the program bank register and the data bank register. It is because
they are invalid in the single-chip mode.
(3)
When performing a decimal operation, in the condition of the decimal mode flag = “1” :
With ADC instruction
Only the carry flag is valid.
The zero, negative, and overflow flags are invalid.
With SBC instruction
Only the carry and zero flags are valid.
The negative and overflow flags are invalid.
Note:
Decimal operation can be done only with the ADC and the SBC instructions.
(4)
Using a 16-bit immediate data in the condition of the data length flag = “1” (data length : 8 bits), or using an
8-bit immediate data in the condition of the data length flag = “0” (data length : 16 bits) will cause the program
runaway. The same rule is applied to the index register length flag. Accordingly, take care of the condition
of these flags when programming.
(5)
The 7751 series can prefetch the instructions using the 3-byte instruction queue buffer. Make sure that when
creating a timer with the software, the cycle number shown in the list of machine instructions is the minimum.
(Refer to Chapter 5.)
(6)
When setting a value other than “00
16
” into the low-order 8 bits of the direct page register (DPR
L
), the
processing time needs 1 machine cycle longer than when setting “00
16
”.
(7)
The processing speed will deteriorate when a 16-bit data is accessed from an odd address. Allocate a 16-
bit data from an even address when the processing speed is important.
(8)
By execution of the PLA instruction, the zero and negative flags will change. When the only accumulator A
is restored by execution of the PUL instruction, the contents of the processor status register will not change.
(9)
The PSH instruction can save the program bank register on the stack by setting “1” in bit 6 of the operand.
However, the PUL instruction cannot restore the program bank register.
(10) Any code in the second byte of the BRK instruction will not affect to the CPU.
INST R UCT IONS
4.3 Notes for programming