You are on page 1of 2

Practical Examination

Credit Hours: 3 Program: BS.

Time 11:15-12:15 Total Marks: 100

Theoretical base question: (5x2=10)

1. What is an addressing mode? What are different addressing modes available in intel 8086?
2. Write a procedure in assembly language that get information from main library and then
prints the number of characters on the screen.
3. Write a procedure that copies a file, changes it into pdf and then writes the modified text
into the other file.
4. Change the value of variable Number to -253.
5. Add the value 74 to the value in EAX.
6. Add the two numbers stored in memory at Number1 and Number2, and store the total at the
memory location named Sum.
7. Subtract 1000 from the value store in memory location named Number.
8. Prompt for three (3) integer values from the user, add them, print or display the sum, as well as
store it in the memory location declared as Sum.
9. Prompt for two (2) from the user. Subtract the first from the second, display and result, and also
store in a variable declared as Diff.
10. Use MOVe based instructions to swap values stored at Value1, Value2 and Value3.
11. Use XCHG based instructions to swap values stored at Value1, Value2 and Value3.
12. Declare and organize memory space to store a list of 100 integer values. Write the code to
display the values stored in the list (Hint: Use the LOOP instruction).
13. Declare and organize memory space to store the LastName, FirstName and MiddleName of a
Patient. Prompt the user to input the names for a patient and store the inputs in the declared
variables.
INCLUDE \masm32\irvine\Irvine32.inc
INCLUDELIB \masm32\irvine\Irvine32.lib
include \masm32\irvine\macros.inc
includelib \masm32\irvine\kernel32.lib
includelib \masm32\irvine\user32.lib

.data?
integer dd 100 DUP(?) ; 100 integers of 32 bytes

FirstName dd ?
LastName dd ?
MiddleName dd ?

.data
number dd 0
number1 dd 10
number2 dd 24
number3 dd 0
sum dd 0
diff dd 0

value1 dd 10
value2 dd 20
value3 dd 30

message0 db 'The initial value of number is: ',0


message01 db 'The initial value eax of is: ',0...

You might also like