English

A series of 1-bute hexadecimal data is stored at memory locations from D600 H to D60A H. Write an assembly language program to replace each odd number in the series wit data 00H. - Computer Science 2

Advertisements
Advertisements

Question

A series of 1-bute hexadecimal data is stored at memory locations from D600 H to D60A H. Write an assembly language program to replace each odd number in the series with data 00H.

Short Answer

Solution

Label Mnemonics code Comments
  MVI B, OBH ; Move OB into reg. B
LXI H, D600H ; Load D600 H in HL pair
Repeat MOV A, M ; copy mem. into A 
  RAR / RRC ; Rotate A right 1-bit
JNC NEXT ; Jump if not cry
NEXT: INX H ; Increment HL by 1
  DCR B ; decrement B by 1
JNZ Repeat ; Jump on no zero
HLT ; Halt the process
shaalaa.com
  Is there an error in this question or solution?
2023-2024 (March) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×