Professional Documents
Culture Documents
Manual Details
Submission Details
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:
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