Assembly Language Questions
Assembly Language Questions
Question # 1:
Write ReadChar and WriteChar procedures
Code:
WriteChar proc ReadChar proc
Ret Ret
Question # 2:
Write a program in which first you display a prompt message “Please enter your name:”
on screen using writechar procedure that you write. Then you get the name in a buffer in your
program by using readchar procedure that you write. After that you display a greeting
“welcome to assembly language lab” followed by the name entered, using writechar.
Code:
Dosseg .code
je stringend jnz l3
Question # 3:
Write a program in which first you display a prompt message “Please enter your name:” on
screen using Writechar procedure that you write. Then you get the name in buffer in your
program by using Readchar procedure that you write. After that you display a greeting
“Welcome to assembly language lab” followed by the name entered.
Code:
Dosseg .code
Question # 4:
Write two procedures isCapital and isSmall which return true / false by setting / clearing carry
flag.
Both of these procedures receive ASCII character is AL on calling, which is tested by the
procedures and true / false is returned accordingly.
Code:
isSmall proc int 21h
cmp al,97
sub al,32
Code:
.model small
.stack 100h
.data
.code
main proc
mov cx,10
mov dx,48
l1:
mov ah,2
int 21h
inc dx
dec cx
jnz l1
mov ah,4ch
int 21h
main endp
end main