Lab Report 2
Lab Report 2
Submitted by:
Intake: 49
Section:50/
Submitted
To:
Materials:
Introduction:
Task 1 :
1. MOV AH,1
○ This instruction sets the AH register to 1, which tells
the DOS interrupt INT 21h to use the "Read a
character from standard input" function.
○ The AL register will store the ASCII value of the key
pressed by the user.
2. INT 21h
○ This call invokes DOS interrupt 21h to read a single
character from the keyboard.
○ The result is stored in the AL register.
3. MOV DL,AL
○ After the key is pressed, the ASCII value of the
character is stored in the AL register.
○ This value is then moved to the DL register in
preparation for output, as INT 21h function 2
requires the character to be in the DL register.
4. MOV AH,2
○ This instruction sets the AH register to 2, which
specifies the DOS interrupt function to display a
character on the screen.
○ The character to be displayed is in the DL register.
5. INT 21h
○ The second call to DOS interrupt 21h is made
to output the character stored in DL to the
console.
Output:
Task 3:
Displays a prompt message asking the user to input
a number. Reads a single numeric character from the
user.
Displays a message with the input number echoed back to the
user.
MOV CL,AL
MOV AH,2 and INT 21h (for Line Feed and Carriage Return)
● The final step is to echo the input back to the user. The
value stored in CL is moved to DL and then displayed
using the interrupt INT 21h with AH set to 2, which
outputs the character to the screen.
Output:
Conclusion: