You are on page 1of 4

Faculty of Engineering & Technology

Subject: Computer Organization Architecture Lab

Subject-Code:203105254
B.Tech. IT Year 2nd Semester: 4th

PRACTICAL : 6
AIM : Write on assembly langn code GNUMSIM8085 to short the no in
ascending order.
Instruction:
1. LXI :
 This instruction loads 16 bit data in the register pair.
2. MVI :
 The 8 bit data is stored in the deastination register or memory.
3. MOV :
 This instruction copies the contents of the source register into the
destination register.
4. INX :
 The contents of register pair are incremented by I.
5. CMP :
 The contents of the operand are compared with the contents of the
accumulator.
6. JC :
 This instruction is used to jump to the address a16 as provided in the
instruction. But as it is a conditional jump so it will happen if and only
if the present carry flag value is 1.
7. DCX :
 The contents of register pair are decremented by I.
8. DCR :
 The contents of register or memory location are decremented by I.

Enrollment No: - 2203031087018 1|Page


Faculty of Engineering & Technology

Subject: Computer Organization Architecture Lab

Subject-Code:203105254
B.Tech. IT Year 2nd Semester: 4th

9. JNZ :
 This instruction is used to jump to the address a16 as provided in the
instruction. But as it is a conditional jump so it will happen if and only
if the present zero flag value is 0.
10.HLT
 The CPU finishes executing the current instruction and halts any
further execution.

Program :
LXI H,8000
MVI C,04
LOOP : MOV A,M
INX H
CMP M
JC LAST
MOV B,M
MOV M,A
DCX H
MOV M,B
INX H
LAST: DCR C
JNZ LOOP
HLT

Enrollment No: - 2203031087018 2|Page


Faculty of Engineering & Technology

Subject: Computer Organization Architecture Lab

Subject-Code:203105254
B.Tech. IT Year 2nd Semester: 4th

Output :

Enrollment No: - 2203031087018 3|Page


Faculty of Engineering & Technology

Subject: Computer Organization Architecture Lab

Subject-Code:203105254
B.Tech. IT Year 2nd Semester: 4th

Enrollment No: - 2203031087018 4|Page

You might also like