We have to determine the large number from a given set of number which are stored in memory.
To solve this problem we have to store some value in memory. Then we have to retrive this values from memory and have to determine the largest value.
- MVI C 05
- MVI A 00
- MVI B 00
- LXI H FO1D
- MOV A, M
- INX H
- MOV B,M
- CMP B
- JM F014
- MOV D,A
- JMP F015
- MOV D,B
- MOV A, D
- DCR C
- JNZ F00A
- MOV M,A
- HLT
In this program I have stored 5 numbers in memory, starting at F01D. C indicates the number of values. The large number is stored in memory location Fo22.
- Source Code and Output of the program:
0 comments:
Post a Comment