Nothing Special   »   [go: up one dir, main page]

BC190405733 Code of Assembly

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Computer Architecture and

Assembly Language Total marks = 20

Programming (CS401) Deadline Date

Fall 2022, Assignment # 02 January 25, 2023


Student ID: BC190405733

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING


It should be clear that your assignment would not get any credit if:

 The assignment is submitted after the due date.


 The submitted assignment does not open or file is corrupt.
 Strict action will be taken if submitted solution is copied from any other student or from the
internet.
You should concern the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.

Any other formats like scan images, PDF, zip, rar, ppt and bmp etc. will not be accepted.

Topic Covered:

 Clearing the Screen and String Printing, keyboard interrupt service routine.
 Interrupts Handling, Dos Interrupt, BIOS Video Services.

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load
shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of
deadline. It is recommended to upload solution file at least two days before its closing date.

If you people find any mistake or confusion in assignment (Question statement), please consult with
your instructor before the deadline. After the deadline no queries will be entertained in this regard.

Syllabus:-

Lectures # 01 - 33.

For any query, feel free to email at:

cs401@vu.edu.pk

Q- Write an assembly language program that performs the following


operations :
1- While pressing the right shift button clear the screen and print
your name on the console screen using BIOS Video Services.

2- While pressing the left shift button clear the screen and
Prints your VU ID on the console screen using BIOS Video Services.

Solution:

[org 0x0100]
jmp start
vuname db' Hafiz Ahmad Bin Umer','$'
vuid db'bc190405733','$'
kbisr: push ax
push es
mov ax, 0xb800
mov es, ax
in al, 0x60
cmp al, 0x2a
jne nextcmp
call cls

mov ah, 0x13


mov al, 1
mov bh, 0
mov bl, 7
mov dx,0x0A03
mov cx, 11
push cs
pop es
mov bp, vuid
int 0x10

jmp nomatch
nextcmp: cmp al, 0x36

jne nomatch
call cls

mov ah, 0x13


mov al, 1
mov bh, 0
mov bl, 7
mov dx, 0x0A03
mov cx, 20
push cs
pop es
mov bp, vuname
int 0x10

nomatch: mov al, 0x20


out 0x20, al
pop es
pop ax
iret
start: xor ax, ax
mov es, ax
cli
mov word [es:9*4],kbisr
mov [es:9*4+2], cs
sti
ll: jmp 11

cls:
pusha
mov ah, 0x00
mov al, 0x03
int 0x10
popa
ret

You might also like