You are on page 1of 4

Lab 6

Control Instructions

Student Name: _MUHAMMAD TOQEER


_Roll No: BSCS-2020-34

Task 1: Write program display 0 to 9 value using loop.

.model
.stack
.data
.code
mov cx,10
mov bx,0
here:
mov dx,bx
add bx,1
add dx,48
mov ah,2
int 21h
loop here
end

output :

Task 2: Write program display 9 to 0 value using loop.


.model
.stack
.data
.code
mov cx,10
mov bx,9
here:
mov dx,bx
sub bx,1
add dx,48
mov ah,2
int 21h
loop here
end

output :

Task 3: Write a program display A TO Z letter using loop decrement in assembly.


.model
.stack
.data
.code
mov cx,26
mov bx,25
here:
mov dx,bx
sub bx,1
add dx,65
mov ah,2
int 21h
loop here
end

output:

Task 4: Write a program display A TO Z using increment in assembly.


.model
.stack
.data
.code
mov cx,26
mov bx,0
here:
mov dx,bx
add bx,1
add dx,65
mov ah,2
int 21h
loop here
end

output ;
Task 5: Write an assembly language program, which output the first ten Prime numbers.
Hint: Use looping technique, to output numbers one by one in each iteration of loop.

You might also like