Exercise 1:
Install EMU8086 and paste screenshots of your installation by documenting each step.
Exercise 2:
1) (A50F)₁₆ to Binary?
2) (6921)₁₀ to Hexa?
3) -22 in 8-bit Binary?
4) 9FCD₁₆ to Unsigned Decimal?
Exercise 3:
Write the complete structure of the assembly language program taught in the lab with
proper explanation
of each line.
Exercise 1:
Why should computer students learn assembly language?
Exercise 2:
Show the ECX register and the size and position of the CH, CL, and CX within it.
Exercise 3:
For each add instruction in this exercise, assume that EAX contains the given contents
before the
instruction is executed. Give the contents of EAX as well as the values of the CF, OF, SF,
PF, AF and
ZF after the instruction is executed. All numbers are in hex. (Hint: add eax, 45 adds 45
to the
contents of register eax and stores the result back in eax)
Contents of EAX Contents of EAX
Instruction CF OF SF PF AF ZF
(Before) (After)
00000045 add eax, 45
FFFFFF45 add eax, 45
00000045 add eax, -45
FFFFFF45 add eax, -45
FFFFFFFF add eax, 1
Exercise 1:
Write an assembly language program to take two numbers from user and print them on screen.
Exercise 2:
Write instructions in assembly language to display your full name on the screen using a variable.
Exercise 3:
Write assembly language code to read two numbers, add them together, and display the result on the
screen.
Exercise 4:
Write a program to convert capital letter to its equivalent small letter and display on the console
Exercise 1:
Read the following statements carefully and answer whether they are legal or illegal? For illegal
statements provide reason.
The sizes of the variables are given as: var_1 and var_2 are of 16 bits and var_3 is of 8 bits.
a) Mov ax, bx
b) Mov var_2, al
c) Mov ax, bl
d) Mov bh, 4A6Fh
e) Mov dx, 3
f) Mov var_1,bx
g) Mov al, var_3
h) Mov cs, 0
i) Mov ip,ax
j) Mov var1,var2
k) Mov bx, cs
l) Mov ds, es
Mov ds, 1000
Exercise 2:
What will be the hexadecimal value of the destination operand after each of the following moves?
If any instruction is illegal, write the word illegal as the answer.
Var_1 and var_2 are 16 bit operands and count is 8 bits long. All the numbers are in hexadecimal
format.
Exercise 3:
Write a program to add two byte-size integers.
Exercise 4:
Write a program to subtract two byte-size integers.
Exercise 1:
Write code for printing two strings on separate lines.
Exercise 2:
Input Handling:
Prompt the user to enter a digit (0-9).
Processing:
Check whether the entered digit is even or odd.
Output Display:
Print "Even" if the digit is even.
Print "Odd" if the digit is odd.
Exercise 3:
Input Handling:
Prompt the user to enter the first number.
Prompt the user to enter the second number.
Processing:
Compare the two numbers to check if they are equal.
Output Display:
Print "Numbers are equal" if both numbers are the same.
Print "Numbers are not equal" if they are different.
Exercise 1:
Loop through Alphabets:
Use a loop to iterate through the lowercase alphabets (a-z).
Use a loop to iterate through the uppercase alphabets (A-Z).
Printing Output:
Print lowercase alphabets in sequence.
Print uppercase alphabets in sequence.
Exercise 2:
You are tasked to print numbers from 1 to 9 using a loop.
Exercise:
Write an assembly language program to perform arithmetic operations of Addition,
Subtraction,
Multiplication and Division.
Follow the below instructions when writing the code:
a) Take two user input numbers and perform the operations, also show the result of each
operation.
b) Your program should prompt user for entering the first and the second values
respectively.
c) Each user input value should be in the separate line.
d) Declare two variables for the user input values and one for storing the result.