Write an Assembly Lariguage Program to add 2 decimal numbers stored at 1050 H and 1051 H.· Store result at 1052 H and 1053 H. - Computer Science 2

Advertisements
Advertisements

Write an Assembly Lariguage Program to add 2 decimal numbers stored at 1050 H and 1051 H.· Store result at 1052 H and 1053 H.

Advertisements

Solution

 

Label Mnemonics + Operand Comment
  LXI H,1050 H Initialise HL pair to memory address 1050 H
  MVI B, 00H Initialise register to store MSB of sum
  MOV A, M Move first number in accumulator
  INX H Get address of next number
  ADD M Add next number to accumulator
  DAA Decimal adjust accumulator
  JNC L1 Is Carry ? No, jump to label L1
  INR B Increment register B
L1: INX H Increment HL pair by 1
  MOV M, A Store LSB of Sum in memory
  MOV A, B Move MSB of Sum in accumulator
  INX H Increment HL pair by
  MOV M, A Store MSB of Sum in memory
  RST 1.0 Restart
Concept: Instruction Set and Programming of 8085
  Is there an error in this question or solution?
2015-2016 (March)

APPEARS IN

RELATED QUESTIONS

______Instruction would not affect Zero Flag.

(i) XRA A

(ii) SUB A

(iii) CMPA

(iv) MVI A, 00H


The accumulator in 8085 microprocessor contains data 71H and register E contains data 39H. What will be the contents of an accumulator in  Hexadecimal after execution of the following  instructions independently ?

(i) ADD E
(ii) ORA E
(iii) RRC


Write any three instructions to make Accumulator Zero


A block of data is stored in memory location 4500 H. The length of block is stored in memory location 44FFH. Write Assembly Language Program that searches for the first occurrence of data D9H in given block. Store the address of this occurrence in H.L. pair. If the number is not found then HL. pair should contain 5000 H.


The instruction PCHL belongs to _______ group.

(i) Data transfer

(ii) Logical

(iii) Arithmetic

(iv) Branching


The Registers A and C of 8085 contain the data E2H and 47H. What will be the contents of Accumulator in Hex digits after execution of each of the following instructions independently?

1) SUB C

2) XRA C

3) ADD C


Explain the function of following instructions of Intel 8085 :

LDA 6605 H


Explain the function of following instructions of Intel 8085 :

PUSH B


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.


The accumulator contains AA H and register C contains 55 H. What will be the contents of accumulator if following instructions are executed independently?
i) CMP C
ii) ANA C
iii) ORA C
iv) SUB C


Share
Notifications



      Forgot password?
Use app×