Federal Urdu University ISLAMABAD
ASSIGNMENT NO:1
NAME :HAMMAD TARIQ
Mis ID:28589
SECTION:3B
DEPARTMENT:CS
SUBJECT:COA
SUBMISSION DATE:18-12-2020
1:-Write a program that display a character
;title:print a character
.model small
.stack 100h
.data
.code
main proc
mov dl,'2'
mov ah,2
int 21h
mov ah,4ch
int 21h
main endp
end main
2:-Write a program that print upper case letters from A to Z
;upper case letters from A to Z
.model small
.stack 100h
.data
.code
main proc
mov cx,26
mov dx,65
l1:
mov ah,2
int 21h
inc dx
loop l1
mov ah,4ch
int 21h
main endp
end main
3:-Write a program that print upper case letters from A to Z using
do while loop
.Model small
.STACK 100H
.DATA
MSg DB 10,13,"The Upper Case Letters from A to Z are : $"
.CODE
MAIN PROC
MOV AX, @DATA ; initialize DS
MOV DS, AX
LEA DX, MSG ; load and print PROMPT
MOV AH, 9
INT 21H
MOV CX, 26 ; initialize CX
MOV AH, 2 ; set output function
MOV DL, 41H ; set DL=A
@DO_WHILE_LOOP: ; loop label
INT 21H ; print character
INC DL ; increment DL to next ASCII character
DEC CX ; decrement CX
JNZ @DO_WHILE_LOOP ; jmp to label @DO_WHILE_LOOP
MOV AH, 4CH ; return control to DOS
INT 21H
MAIN ENDP
END MAIN
4:-Write a program that print upper case letters from A to Z using
while loop
.MODEL SMALL
.STACK 100H
.DATA
PROMPT DB 10,13,"The Upper Case Letters from A to Z are : $"
.CODE
MAIN PROC
MOV AX, @DATA ; initialize DS
MOV DS, AX
LEA DX, PROMPT ; load and print PROMPT
MOV AH, 9
INT 21H
MOV CX, 26 ; initialize CX
MOV AH, 2 ; set output function
MOV DL, 41H ; initialize DL=A
@WHILE_LOOP: ; loop label
CMP CX, 0 ; compare CX and 0
JE @END_LOOP ; jump to label @END_LOOP if CX=0
INT 21H ; print character
INC DL ; increment DL to next ASCII character
DEC CX ; decrement CX
JMP @WHILE_LOOP ; jump to label @WHILE_LOOP
@END_LOOP: ; jump label
MOV AH, 4CH ; return control to DOS
INT 21H
MAIN ENDP
END MAIN
5:-Write a program that print lower case letters from z to a
;lower case letters from z to a
.model small
.stack 100h
.data
.code
main proc
mov cx,26
mov dx,122
l1:
mov ah,2
int 21h
dec dx
loop l1
mov ah,4ch
int 21h
main endp
end main
6:-Write a program that print lower case letters from a to z
;lower case letters from a to z
.model small
.stack 100h
.data
.code
main proc
mov cx,26
mov dx,97
l1:
mov ah,2
int 21h
inc dx
loop l1
mov ah,4ch
int 21h
main endp
end main
7:-Write a program that print counting from 10 to 20