Write a program to add two 16-bit numbers, X and Y and put the result in X. (X <-- X + Y)
| XH | XL |
| + YH | YL |
| XH | XL |
The numbers will be found in the following locations in RAM:
| Address | |
| XL | 0x78 |
| XH | 0x79 |
| YL | 0x7A |
| YH | 0x7B |
The sum should be written into locations 0x78 and 0x79. Use EQU to define symbols for the memory locations so that the code is easy to follow. Call this program adder.asm.
After you have compiled and built the program, modify the RAM addresses in the debugger so they have the following values:
| DATA | |
| XL | 99 |
| XH | aa |
| YL | F2 |
| YH | 33 |
You can modify values in the RAM debug window by placing the cursor before the data value and typing over the value.
IF YOU FINISH EARLY.... try the following data:
| DATA | |
| XL | FF |
| XH | FF |
| YL | 9C |
| YH | 89 |