English

Write an Assembly Language Program to Count the Total Number of Even Data Bytes Occurring in a Block of Data Stored from 9201h to 920ah. Store the Result (Count) at the Memory Location 9500h.

Advertisements
Advertisements

Question

Write an Assembly Language Program to count the total number of even data bytes occurring in a block of data stored from 9201H to 920AH. Store the result (count) at the memory location 9500H.

Advertisements

Solution

Label Mnemonics Comment

rep:

 

 

 

next :

 

 

MVI C, 00H

MVI B, 0AH

LXI H, 9201H

MOV A, M

RRC

JC next

INR C

INX H

DCR B

JNZ rep

MOV A, C

STA 9500H

RST 1.0

; Clear C reg

; Set B = 0AH

; Set HL = 9201 H

; Get M to A

; Rotate A to right

; Jump, if carry to next

; Increment C

; Increment HL

; Decrement B

; Jump, if no zero to rep

; Get C to A

; Store A at 9500 H

; Restart

 

shaalaa.com
  Is there an error in this question or solution?
2017-2018 (March)

APPEARS IN

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×