HSC Science (Computer Science) 12th Board ExamMaharashtra State Board
Share
Notifications

View all notifications

Write an Assembly Language Program to Count the Occurrence of the Data Byte Ach in a Memory Nock Stored from 7401h to 7405h. Store the Count at the Memory Location 7406h. - HSC Science (Computer Science) 12th Board Exam - Computer Science 2

Login
Create free account


      Forgot password?

Question

Write an Assembly Language Program to count the occurrence of the data byte ACH in a memory Nock stored from 7401H to 7405H. Store the count at the memory location 7406H.

Solution

Label

Mnemonic +

Operand

Comments

START:

 

 

LOOP:

 

 

 

NEXT:

 

 

 

 

END:

MVI C, 05H

MVI B, 00H

LXI H, 7401H

MOV A, M

CPI ACH

JNZ NEXT

INR B

INX H

DCR C

JNZ LOOP

MOV A, B

STA 7406H

RST 1.0

; Store count 05H in register C

; Initialize occurrence count in register B

; Initialize H-L pair with starting address

; Get the number in the accumulator

; Check whether the number in the accumulator is ACH

; If no? jump to label NEXT

; Yes, increment content in register B by 1

; Increment H-L pair

; Decrement count

; Is count zero? No-jump to label LOOP

; Get count in accumulator

; Store count of occurrence 7406H

; Restart

 

 

 

 

 

  Is there an error in this question or solution?

APPEARS IN

 2017-2018 (March) (with solutions)
Question 5.2.1 | 5.00 marks
Solution Write an Assembly Language Program to Count the Occurrence of the Data Byte Ach in a Memory Nock Stored from 7401h to 7405h. Store the Count at the Memory Location 7406h. Concept: Instruction Set and Programming of 8085.
S
View in app×