Write an assembly language program that performs the following operations
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 Print your VU ID on the console screen using BIOS Video Services.
Solution
1- While pressing the right shift button clear the screen and print your name on the console screen using BIOS Video Services.
section .data
name db 'Your Name',0
section .text
global _start
_start:
;check for right shift button press
in al, 0x60
cmp al, 0x36
jne exit
;clear screen and print name
mov ah, 0x00
mov al, 0x03
int 0x10
mov ah, 0x09
mov dx, name
int 0x21
exit:
;exit program
mov eax, 0x1
xor ebx, ebx
int 0x80
2- While pressing the left shift button clear the screen and Prints your VU ID on the console screen using BIOS Video Services.
section .data
vu_id db 'Your VU ID',0
section .text
global _start
_start:
;check for left shift button press
in al, 0x60
cmp al, 0x2A
jne exit
;clear screen and print VU ID
mov ah, 0x00
mov al, 0x03
int 0x10
mov ah, 0x09
mov dx, vu_id
int 0x21
exit:
;exit program
mov eax, 0x1
xor ebx, ebx
int 0x80
No comments