Advertisements
Advertisements
प्रश्न
Write an Assembly Language Program to divide Hexa decimal number stored in the memory location 5000H by Hexa decimal number stored in memory location 5001H. Store the quotient at 5002H and remainder at 5003H.
दीर्घउत्तर
Advertisements
उत्तर
| Label | Instrcution | Comments |
| LDA | 5001H | ; Load Acc with content of 5001 H |
| MOV B, A | ; Move Acc to Reg. В | |
| LDA 5000H | ; Load Acc with content of 5000H | |
| MVI C, OOH | ; Inhalize Reg. C to OOH | |
| BACK: | SUB B | ; Subtract B from Acc |
| JC-SKIP | ; If carry go to SKIP | |
| INR C | ; Increment Reg. C by 1 | |
| JMP-BACK | ; JUMP to Back | |
| SKIP | ADD B | ; Add Reg. B to Acc |
| STA 5003 H | ; Store remainder at 5003Н | |
| MOV A, C | ; Move Reg. B to Acc | |
| STA 5002 H | ; Store quotient at 5002 Н | |
| HLT | ; Stop |
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
