You are on page 1of 5

LAB PRACTISE

Activity 1:
Install the Emulator 8086 in your machine and take overview of all tabs in it.

Explanation of Tabs

Example tab → you will find some starting examples to understand the language.
Compile Tab → Allow the code to compile and show the syntax errors
Emulate tab → Show you new window, where you can run and check the complete conversation
of code into machine code step by step or in one step.
Calculator tab → its programming calculator which shows you four types of conversations.
Convertor tab → it converts the single value in four different bases (Hexa, octal, decimal, binary)
according to bits requirement (8bits or 16 bits)

Flags
The Purpose of this lab is to understand effect of different instructions on the flag registers. Also,
we will discuss conditional statements (if, else-if and switch case) which can implement with the
help condition jumps.

Flag Introduction:

Flag is a register which shows the current status or state of the processor. The processor has only
one flag register but divided into two parts i.e. 6 status flags/bits and 3 controls flags/bits.
Activity 2:

Step1: Open the emulator 8086 application, create an empty project and copy the following lines
of code.

.model small
.stack 100h
.data
.code
mov ax,0ffffh
mov bx,0ffffh
add ax,bx

Step 2: Now click on emulate icon.


Step 3: Single step run the program.

Step 4: Observe value in AX register. Actual result is 1FFFEh but Result stored in AX = FFFE

Step 5: Now click on flags button on the bottom of screen you will see a new screen with flags
value.
Practice Problems
Question no 1:
Write the assembly code for following: A = B – 2 x A using add and sub instructions.
Question no 2:
Write the assembly code for following: A= -(A+1) using increment, negate and move instructions.
Question no 3:
Write a program to change the value of the one register in another register.

Question no 4:
Using the procedure described in activity number 2 fill the following table.

Instructions operand flags destination


registers

AX BX CF SF ZF O PF
F

1. NEG AL

2. Sub ax,bx

3. Dec AL

4. Xcgh ax,bx

5. Mov ax,bx

You might also like