Lab 4: Programming in Assembly Language-Part2
Lab 4: Programming in Assembly Language-Part2
Lab 4: Programming in Assembly Language-Part2
Assalamualaikum, Dear Friends, in this lab 4, we will continue to explore more x86
Instruction Set.
One important group of instructions is Logic Instructions. Logical instructions are used to
perform logic operations such as AND, OR, XOR and NOT.
In two operand instructions, result will be stored in destination operand except for NOT
logic instruction which is a single operand instruction where source and destination
operand are same, for example NOT BX where each bit in BX will be inverted !!!
Instructions under this group are AND/OR/XOR ( two operand instructions ) NOT D
(Single Operation)
1
Lab 4: Programming in Assembly Language-Part2
2.1 Shift
Instructions are used to move positions of bits in an operand. For example, move bit 2
right 2 places, or left two places.
Exercise : Find the difference between arithmetic shift and logical shifts
While rotations are closed loop instructions in which data is moved out from one and put
into another end. Example rotate bit number 3 left by 3 units , means bit 3 is moved 3
2
Lab 4: Programming in Assembly Language-Part2
places to left, while the originals bits are also moved left, if they reach the end, then they
are feed back to another end. Following image shows rotation instruction
We options to rotate the bits thru carry flag or copy it to carry flag. Please Google the
difference, there many illustrations online.
3
Lab 4: Programming in Assembly Language-Part2
Lab Exercises
2. Write and ALP to clear bits 0 to bits 5 and set the bits 6 and bits 7 using AND
instruction
KBAT Question
Write a program, which finds a largest unsigned 8-bit number in a memory location of
your choise, and store the result in a different memory location 200. Draw a flow chart
and verify your program.
If the program above is to find the largest unsigned 16-bit number, what changes will you
do?
4
Lab 4: Programming in Assembly Language-Part2
Question:
2. By referring to the block diagram of minimum mode of 8088, explain the functions of
the following signal lines
a. IO/M
b. SSO
c. DT/R
d. RD and WR
e. DEN
3. List 1 key difference between 8088 and 8086 from point of hardware.
4. List 2 key differences between maximum mode and minimum mode of operation of
8088.