You are on page 1of 7

Task 1:

Clean the screen using the INT 10h Video bios, then print the word "Hello" in the center of the screen.

.model small
.386
.stack 100h
.data
msg db 'HELLO','$'
.code
main:
mov ax,@data
mov ds,ax
;;;;clear screen;;;
mov ah,6
mov al,0
mov cl,0 ;starting of columns
mov ch,0 ;starting of rows
mov dl,4Fh ;ending of columns
mov dh,18h ;ending of rows
mov bh,2 ;back=black,for=green
int 10h
;;;;;;;position of cursor in center;;;
mov ah,2
mov bh,0
mov dl,27h ;mid-point of coloums
mov dh,0ch ;mid-point of rows
int 10h
;;;;print the msg;;;
mov ah,09h
mov dx,offset msg
int 21h
;;;;end;;;;
mov ah,4ch
2/9
int 21h
end main
Task2:

Print the previous word at the origin location (0,0) with red foreground and green background.

.model small
.386
.stack 100h
.data
msg db 'Nimra Tahir','$'
var1 db 12
.code
main:
mov ax,@data
mov ds,ax
;;;;clear screen;;;
mov ah,6
mov al,0
mov cl,0 ;starting of columns
mov ch,0ch ;starting of rows
mov dl,4Fh ;ending of columns
3/9
mov dh,18h ;ending of rows
mov bh,0h ;back=green,for=black
int 10h
mov ah,6
mov al,0
mov cl,27h ;starting of columns
add var1,cl
sub var1,2
mov ch,0ch ;starting of rows
mov dl,var1 ;ending of columns
mov dh,0ch ;ending of rows
mov bh,0cfh ;back=light red,for=white
int 10h
;;;;;;;position of cursor in center;;;
mov ah,2
mov bh,0
mov dl,27h ;mid-point of coloums
mov dh,0ch ;mid-point of rows
int 10h
;;;;print the msg;;;
mov ah,09h
mov dx,offset msg
int 21h
;;;;end;;;;
mov ah,4ch
int 21h
end main
Task 3

Write a program to color the screen background with three colors vertically 4 / 9

.model small
.386
.stack 100h
.code
main:
mov ax,@data
mov ds,ax
;;;;clear screen;;;
mov ah,6
mov cl,00h ;col
mov dl,18h
mov ch,00h ;rows
mov dh,18h ;ending of rows
mov bh,20h ;green
int 10h

mov ah,06h
mov cl,18h
mov dl,36h
mov ch,00h
mov dh,18h
mov bh,40h ; red
int 10h

mov ah,06h
mov cl,36h
mov dl,4fh
mov ch,00h
mov dh,18h
mov bh,10h ; blue
int 10h

mov ah,4ch
int 21h
end main
Task4:

Change the above program to color the screen background with same three colors horizontally.

.model small
.386
.stack 100h
.code
main:
mov ax,@data
mov ds,ax
;;;;clear screen;;;
mov ah,06h
mov cl,00h ;col
mov dl,4fh
mov ch,00h ;rows
mov dh,8h ;ending of rows
mov bh,20h ;green
int 10h

mov ah,06h
mov cl,0h
mov dl,4fh
mov ch,8h
6/9
mov dh,16h
mov bh,40h ; red
int 10h

mov ah,06h
mov cl,0h
mov dl,4fh
mov ch,16h
mov dh,24h
mov bh,10h ; blue
int 10h

mov ah,4ch
int 21h
end main
Task 5

Write a program to draw the Pakistan flag.

.model small
.386
.stack 100h
.data
.code
main proc

mov ah,0
7/9
mov al,04h
int 10h

mov ah,0bh
mov bh,00h
mov bl,00000010b
int 10h

mov ah,2
mov bh,0
mov dh,10
mov dl,18
int 10h

mov ah,9h
mov al,'*'
mov bl,00001111b
mov cx,1
int 10h

mov ah,2
mov bh,0
mov dh,10
mov dl,14
int 10h

mov ah,9h
mov al,'|'
mov bl,00001111b
mov cx,1
int 10h

mov ah,2
mov bh,0
mov dh,8
mov dl,16
int 10h

mov ah,9h
mov al,'-'
mov bl,00001111b
mov cx,1
int 10h

mov ah,2
mov bh,0
mov dh,12
mov dl,16
8/9
int 10h
mov ah,9h
mov al,'-'
mov bl,00001111b
mov cx,1
int 10h

mov ah,2
mov bh,0
mov dh,09
mov dl,15
int 10h

mov ah,9h
mov al,'/'
mov bl,00001111b
mov cx,1
int 10h

mov ah,2
mov bh,0
mov dh,11
mov dl,15
int 10h

mov ah,9h
mov al,'\'
mov bl,00001111b
mov cx,1
int 10h

mov ah,6
mov al,0
mov bh,00001111b
mov cl,0
mov cx,0
mov dh,32h
mov dl,8h
int 10h

mov ah,0
int 16h

mov ax,3
int 10h

;;;;end;;;;
9/9
mov ah,4ch
int 21h
main endp
end main

You might also like