Mitsubishi Electronics 13JW55 Network Card User Manual


 
5 - 54
Project name QTEST8
Program name MAIN
5.7.4 Exercise 4 Comparison instruction
Using the two BCD digital switches, execute the calculation of (A - B) and display
the result on the BCD digital display (Y40 to Y4F).
(X20 to X2F)
B
(X30 to X3F)
A
(Y40 to Y4F)
Displays the result of the calculation of A - B
on the BCD display of Y40 to Y4F.
When the result is a negative number, make sure that
the display displays 0 and the LED of Y70 turns on.
Fill in the blanks .
Then, check the operation using the demonstration machine.
X0
0
Y70
SET
D0
D1
2)
D0
1)
K4X20
K4X30
-P D1
K0MOV K4Y40
D1BCD K4Y40
Y70RST
D1
3)
K0
D1
4)
K0
Hint
The operation result is always output from the CPU in binary.
D1D0-
=D1-D0 D1
1)
2)
3)
4)