English

Consider a block of memory locations beginning D600 H to D60F H. Write an assembly language program to find first occurrence of data byte A2 H, found HL pair must contain 0000H. - Computer Science 2

Advertisements
Advertisements

Question

Consider a block of memory locations beginning D600 H to D60F H. Write an assembly language program to find first occurrence of data byte A2 H, found HL pair must contain 0000H.

Short Answer

Solution

Label Mnemonics code Comments
  MVI A, A2H ; Load A2H in A immd.
MVI B, 10 H ; MOV 10 H in B immd.
LXI H, D600H ; Load D600H in HL pair
Loop: CMP M ; Compare A with M
  JZ END ; Jump on Zero
INX H ; Increment HL pair
DCR B ; decrement B by 1
JNZ Loop ; Jump on no zero
LXI H, 0000H ; Load 0000H in HL pair
End: HLT ; Halt process
    ;
  ;
shaalaa.com
  Is there an error in this question or solution?
2023-2024 (March) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×