Omron C20K Video Game Controller User Manual


 
125
When the execution condition is OFF, DIV(33) is not executed and the next
instruction is moved to. When the execution condition is ON, the content of
Dd is divided by the content of Dr and the result is placed in R and R + 1: the
quotient in R and the remainder in R + 1.
Dd wordDr word
R word R + 1 word
÷
Quotient Remainder
ER: Dd or Dr is not in BCD.
Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
EQ: ON when the result is 0.
When IR 0000 is ON with the following program, the content of IR 20 is di-
vided by the content of HR 9 and the result is placed in DM 17 and DM 18.
Example data and calculations are shown below the program.
DIV(33)
20
HR 9
DM 17
0000
R : DM 17 R + 1 : DM 18
11500002
Dd : IR 20
3452
÷
Quotient Remainder
Dd : IR 20
0003
Address Instruction Operands
0000 LD 0000
0001 DIV(33)
20
HR 9
DM 17
5-16-5 SET CARRY – STC(40)
Set carry is used to set (turn ON) the CY (SR bit 1904) to “1.”
0002
STC(40)
0000 LD 0002
0001 STC(40)
Address Instruction Operands
5-16-6 CLEAR CARRY – CLC(41)
Clear carry is used to reset (turn OFF) the CY (SR bit 1904) to “0.”
0002
CLC(41)
0000 LD 0002
0001 CLC(41)
Address Instruction Operands
Description
Flags
Example
BCD Calculations Section 5-16