You are on page 1of 5

DEPARTMENT OF COMPUTER ENGINEERING

University College of Engineering & Technology Bahauddin


Zakariya University, Multan.

Manual Details

Subject MICROPROCESSOR AND Roll No.


INTERFACING 2019-CPE- 28
Session 2019 -2023
Pr. Hrs. per Week 3Hrs. (Pr)
Practical No 7
Lab Instructor Engr. Muhammad Ubaid Ullah

Submission Details

Submitted by Nitasha Huma

Experiment # 7
Objective: To understand the functionality of conditional and unconditional loops with different
addressing modes.
Theory:
Loop:
In computer science, a loop is a programming structure that repeats a sequence of instructions until a
specific condition is met.

Loope/ Loopz:

Loope is a conditional iterative structure that repeats with some condition, when there result of the
arithmetic and logic instruction gives loop while ZF=1 and CX=0.
Loopnz:
Loope is a conditional iterative structure that repeats with some condition, when there result of the
arithmetic and logic instruction gives loop while ZF=0 and CX=0.
Tasks:
Write an executable assembly program using unconditional loops
(register relative addressing)
Code:
[org 0x0100]
mov bx, 10;
mov ax, [bx+10H];
mov dx,10;
div dl;
mov cx, 3; counter:
sub ax, 100H;
mov bx, 5;
sub cx,1; loopcounter
r;
mov ax, 0x4c00; terminate program
int 0x21
Output:

Write an executable assembly program using unconditional loops


(register relative addressing plus use of JMP instruction).
CODE
[org 0x0100]
MOV BX,12;
MOV AX,[BX+10H];
CMP BX,AX
JNZ HBR
41
JMP STOP
HRB COUNTER:
SUB AX, 100H;
STOP: MOV BX,5; LOOPCOUNTER;
MOV AX,0x4c00; terminate program
int 0x021

OUTPUT

Program 2:
CODE
[org 0x0100]
mov bx, 12;
movax,[bx+10H];
m ovcx, 8;
counter:
sub ax,
100H;
mov bx,
5;
loopcounter ;
mov ax,
0x4c00int 0x21
Output

Conclusion:
41
In this manual we have learnt about the functionality of conditional and unconditional loops
with different addressing modes.

41

You might also like