0% found this document useful (0 votes)
99 views10 pages

COA Assignment: Assembly Language Programs

The document contains 7 assembly language programs, including programs to print a single character, print uppercase letters from A to Z using different loops, print lowercase letters from z to a and from a to z, and print counting from 10 to 20. Each program listing includes comments describing its purpose and the code to implement the given task. The programs demonstrate basic looping and character printing in assembly language.

Uploaded by

Homi Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views10 pages

COA Assignment: Assembly Language Programs

The document contains 7 assembly language programs, including programs to print a single character, print uppercase letters from A to Z using different loops, print lowercase letters from z to a and from a to z, and print counting from 10 to 20. Each program listing includes comments describing its purpose and the code to implement the given task. The programs demonstrate basic looping and character printing in assembly language.

Uploaded by

Homi Malik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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

You might also like