Advertisements
Advertisements
प्रश्न
Write an Assemhly Language Program to find largest number in a block of memory starting from 7000 H. The length of the block is stored at 6FFF H. Store the result at the end of the block.
थोडक्यात उत्तर
Advertisements
उत्तर
| Label | Opcode Operand | Comments |
| L2: | LXI H, 6FFF H | ; Initialise HL pair with address 6FFF H |
| MOV C, M | ; block length in register C | |
| SUB A | ; Initialise a ccumulator with OOH | |
| INX H | ; Increment HL pair b y 1 | |
| CMP M | ; Compare the next number with acc umulator | |
| JNC L1 | ; Number in accumulator greater? | |
| Yes, jump L1 | ||
| L1 : | MOV A, M | ; No, Bring the greater number in accumulato r |
| DCR C | ; Decrement Count | |
| JNZ L2 | ; Count = 0 ? No jump to label L2 | |
| INX H | ; Increment HL pair b y 1 | |
| MOV M, A | ; Cop y largest number at M register | |
| RST 1 | ; Restart |
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
