0% found this document useful (0 votes)
326 views

CS401 Assignment 2 Solution 2023

The document is an assembly code solution for CS-401 Assignment 2. It prints the student's name and VUID to the screen. It then sets up an interrupt handler to check for left and right shift key presses, printing the design or assignment ID respectively. It loops indefinitely after setting up the interrupt handler.

Uploaded by

Rabbani King
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)
326 views

CS401 Assignment 2 Solution 2023

The document is an assembly code solution for CS-401 Assignment 2. It prints the student's name and VUID to the screen. It then sets up an interrupt handler to check for left and right shift key presses, printing the design or assignment ID respectively. It loops indefinitely after setting up the interrupt handler.

Uploaded by

Rabbani King
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
You are on page 1/ 3

000000

BC00000
CS-401 Assignment 2 Solution 2023

Solution:

Assembly Code:

[org 0x0100]
jmp start
name db 'Name : BIBI ZAINAB','$'
vuid db 'VUID : BC210424967','$'
msg db 'VUID Sorted :','$'
assid db '012244679','$'
desid db '976442210','$'
start:
mov AH, 06h
mov AL, 0
mov BH, 07h
mov CX, 0
mov dx, 184Fh
int 10h
mov AH, 02h
mov BH, 00h
mov DH, 00h
mov DL, 00h
int 10h
mov AH, 09h
mov DX, name
int 21h
mov AH, 02h
mov BH, 00h
mov DH, 01h
mov DL, 00h
int 10h
mov AH, 09h
mov DX, vuid
int 21h
mov AH, 02h
mov BH, 00h
mov DH, 02h
mov DL, 00h
int 10h
mov AH, 09h
mov DX, msg
int 21h
xor AX, AX
mov ES, AX
cli
mov word [es:9*4], kbisr
mov [es:9*4+2], cs
sti
L1: jmp L1
kbisr: push AX
push ES
mov AX, 0Xb800
mov ES, AX
in AL, 0x60
cmp AL, 0x2a
jne nextcmp
mov AH, 02h
mov BH, 00h
mov DH, 02h
mov DL, 13
int 10h
mov AH, 09h
mov DX, desid
int 21h
jmp nomatch
nextcmp: cmp AL, 0x36
jne nomatch
mov AH, 02h
mov BH, 00h
mov DH, 02h
mov DL, 13
int 10h
mov AH, 09h
mov DX, assid
int 21h
nomatch: mov AL, 0x20
out 0x20, AL
pop ES
pop AX
iret
mov AX, 4c00h
int 21h
Left Shift Pressed Right Shift Pressed

You might also like