Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

NAME OF THE SUBJECT: EE (MPMC Lab)

SUB CODE: 224


B-Tech (CSE) 3rd Semester

Submitted by: Ritu Raj Chanda


(Scholar id: 2012157)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


NATIONAL INSTITUTE OF TECHNOLOGY SILCHAR
ASSAM, PIN-788010

(September-December 2021)
Experiment-10
Aim of the experiment: Write a program to ADD ‘ N ’ two digit BCD numbers using 8085 & verify
Theory:
Software Interrupts or Restart Instructions:

8085 microprocessor provides eight RST instructions (RST0 to RST7). These instructions allow
transfer of program control from main program to predefined service routine addresses. Predefined
service routine is also called ISR (Interrupt Service Routine). After completing ISR, program control
is transferred back to main program. The vector locations for RST0 to RST7 are as follows:

RST0 0000H
RST1 0008H
RST2 0010H
RST3 0018H
RST4 0020H
RST5 0028H
RST6 0030H
RST7 0038H
1. ORG Addr. Directive reserves the starting address for Program Code or data in specified memory
array,
2. LXI H (LOAD REGISTER PAIR IMMEDIATELY) loads 16 bit data in register pair designated by
operand.
3. INX H (INCREMENT REGISTER PAIR) increments the contents of the register pair by one.
4. MOV A, M copies the data byte into accumulator from the memory specified by the address in H-L
pair.
5. MVI (MOVE IMMEDIATE DATA)moves immediate value to specified register.
6. DCR Reg (DECREMENT REGISTER) decrement register content by one.
7. DAA (Decimal Adjust Accumulator) instruction changes the content of accumulator from a binary
value to two 4-bit BCD digits.
8. JNZ Addr. instruction jump the execution to the specified Address if zero flag is reset.
9. ADD M (ADDITION) addmemory address content specified in HL register to accumulator and
result stored into accumulator.
10. SUB Reg (SUBTRACT REGISTER) subtract register content by accumulator and result stored
into accumulator.
11. JMP (JUMP UNCONDITIONALLY) Jump execution to the specified address.
12. STA (Store Accumulator Direct) copy the content of accumulator to specified address.
13. RST 1 (RESET) finishes the execution of the current instruction and stops any further execution.
14. DB Directive is defined to store values in specified memory array.
Program
# ORG 2000H
LXI H,F100 // HL &8592; F100
MOV C,M // C &8592;[HL]
MVI D,00 // Clear regD
INX H // HL+1 &8594; HL
DCR C // C-1 &8594; C
MOV A,M // M &8594; A
up:INX H // HL+1 &8594; HL
ADD M // M+A &8594;A
DAA // Decimal Adjust After Addition
JNC down // Jump if no carry
INR D // D+1 &8594;D
down:DCR C // C-1 &8594;C
JNZ up // Jump if ZF=0
STA F200 // A &8592;[F200]
RST 1 // Terminate
# ORG F100H // Store inputs at the address
# DB 04,43,77,55,55 // Store bytes in successive locations
Flowchart
Result: After execution of the programs we got the final results which are attached in the snapshots.
****End of experiment****

You might also like