About Us

Welcome to FEARPK, your number one source for all things about education. We’re dedicated to providing you the very best of knowledge, with an emphasis on formal and non formal education.

 

Founded in  3, March 2019 by Rehmat Ullah, FEARPK has come a long way from its beginnings in Pakistan. When Rehmat ullah first started out, his passion for educational services  drove them to start their own business.

 

We hope you enjoy our educational knowledge as much as we enjoy offering them to you. If you have any questions or comments, please don’t hesitate to contact us.

 

Sincerely,

Rehmat Ullah

cs401 assignment 3 solution fall 2019 2020

?php the_post_thumbnail(); ?
cs401 assignment 3 solution fall 2019 2020

cs401 assignment 3 solution fall 2019 2020

 

Question:

Suppose we want to draw a square on our computer screen as shown below.

 

name “vga”

 

; this program draws a square in vga mode.

 

org  100h

 

jmp code

 

; dimensions of the square:

; width:  50 pixels

; height: 50 pixels

 

w equ 50

h equ 50

 



; set video mode 13h – 320×200

 

code:   mov ah, 0

mov al, 13h

int 10h

 

 

; draw upper line:

 

mov cx, 100+w  ; column

mov dx, 20     ; row

mov al, 0010     ; green

u1: mov ah, 0ch    ; put pixel

int 10h

 

dec cx

cmp cx, 100

jae u1

 

; draw bottom line:

 

mov cx, 100+w  ; column

mov dx, 20+h   ; row

mov al, 0001     ; blue

u2: mov ah, 0ch    ; put pixel

int 10h

 

dec cx

cmp cx, 100

ja u2

 

; draw left line:



mov cx, 100    ; column

mov dx, 20+h   ; row

mov al, 35      ; pink

u3: mov ah, 0ch    ; put pixel

int 10h

 

dec dx

cmp dx, 20

ja u3

 

 

; draw right line:

 

mov cx, 100+w  ; column

mov dx, 20+h   ; row

mov al, 20    ; gray

u4: mov ah, 0ch    ; put pixel

int 10h

 

dec dx

cmp dx, 20

ja u4

 

 

; pause the screen for dos compatibility:

 

;wait for keypress

mov ah,00

int 16h

 

; return to text mode:

mov ah,00

mov al,03 ;text mode 3

int 10h

 

 

 

ret

 

Muhammad Reyan

Leave a Reply

Your email address will not be published. Required fields are marked *