
Clear ResLo and ResHi
Loop
Add Num1 to ResLo
If Carry set, increment ResHi
Decrement Num2
Until Num2 = 0
12 Declare registers: Num1, Num2
Load integer into Num1
Complement Num1
Increment Num1
Add Num1 to Num2
Result in Num2
Assessment 6
1 The key code is obtained by taking the row low and checking the column input. If it is
low, the ASCII code is loaded and the scan quit.
2 The code to operate the LCD only needs to be written once, saved and included into
new programs as required, saving time and effort.
3 The negative result is detected when the carry flag is cleared. A minus sign character is
displayed, and the inverse 2s complement of the result calculated ...