Objective:: Lab#5: Loop Instructions SSUET/QR/114
Objective:: Lab#5: Loop Instructions SSUET/QR/114
LAB#5
Objective :
Theory
Loop
A loop is a sequence of instructions that is repeated. The number of times to repeat may be
known in advance, or it may depend on conditions i.e. it’s a count controlled loop.
KEYWORD: LOOP
A FOR loop is implemented using the LOOP instruction. The counter for the loop is the CX
register, which is initialized to loop_count, which is the number of times the loop is executed.
Execution of the LOOP instruction causes CX to be decremented automatically. If CX becomes
0,the next instruction after loop is done.
Sample Program:
SOURCE CODE:
Object:Title a program that prints a character 100 times.
.model small
.stack 100h
.code
main proc
LAB OBJECTIVES:
Task #01:Write a program to print ‘*’ 100 times using linefeed and carriage return.
SOLUTION:
OUTPUT:
OUTPUT:
SOLUTION:
OUTPUT:
Task#03: Write a program to print ASCII characters from a-z and z-a
SOLUTION:
OUTPUT:
SOLUTION:
OUTPUT:
SOLUTION:
OUTPUT:
Task#05:Write a program to print your name 10 times using linefeed and carriage return.
SOLUTION:
OUTPUT: