Professional Documents
Culture Documents
Rashid Ahmad
BC210208554
Note:
Dear sir my laptop is not working for 2 weeks. So please be kind with me. I know how I managed to make
this assignment. Please don’t degrade me
Question no 1:
Write an assembly language program to store your Roll Number (Number part only) and
calculate their sum. Print a message on the screen that shows that the received number is
even or odd.
Answer:
section.data
section.text
global_start
_start
sum_loop:
mov al, byte[roll num+si] ; Load the byte from roll num string
section.data
section.text
global_start
_start
sum_loop:
mov al, byte[roll num+si] ; Load the byte from roll num string
mov ah,9h ;set the function code for print string lea
end program;
section_data
odd_msg mc 'The received number is odd.' , 0Dh, 0Ah, '$' ; Message for odd number
even_msg mc 'The received number is odd.' , 0Dh, 0Ah, '$' ; Message for even number
Question no 2:
Find the offset address where Physical address is 4A37Bh and the segment address is
40FFh.
Answer:
The formula to calculate the offset address is:
4A37Bh=303995