Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Hamza Nazir COAL LAB 2

LAB REPORT: 2
Submitted By: Hamza Nazir (2872)
Submitted To: Sir Faiq Ahmad Khan

DATE:——-
Bscs-40B (5th Semester) Evening

Objective:
The objective of this lab session was to gain familiarity with assembly language instructions, directives, and interrupts. Specifically,
we aimed to understand the .MODEL, .STACK, .DATA, and .CODE directives, as well as explore software interrupts for I/O operations

Activities Performed:
1. Input and Display Program:

Developed an assembly program to input a character from the user and display it using software interrupts.

Hamza Nazir COAL LAB 2 1


out put

1. Convert Lowercase to Uppercase:

Wrote an assembly program to input a lowercase letter from the user, convert it to uppercase (by subtracting 32 from the
ASCII value), and display the result

.model small
.stack 100h
.data
.code
main proc

;input

mov ah,1
int 21h

mov dl,al
sub dl,32

;Output

mov ah,2
int 21h

mov ah,4ch
int 21h

end main
main endp

Hamza Nazir COAL LAB 2 2


output

1. Convert Uppercase to Lowercase:

Created an assembly program to input an uppercase letter, convert it to lowercase (by adding 32 to the ASCII value), and
display the result.

.model small
.stack 100h
.data
.code
main proc

;input

mov ah,1
int 21h

mov dl,al
add dl,32

Hamza Nazir COAL LAB 2 3


;Output

mov ah,2
int 21h

mov ah,4ch
int 21h

end main
main endp

OUT PUT

Hamza Nazir COAL LAB 2 4


Outcome:
Through these activities, we gained practical experience with assembly language programming concepts, including directives for
memory and code organization, as well as using interrupts for system calls and I/O operations. These exercises enhanced our
understanding of low-level programming and interaction with the underlying hardware.

Overall, the lab session provided valuable insights into the fundamentals of assembly language programming and its application in
system-level operations.

Hamza Nazir COAL LAB 2 5

You might also like