Question: i need write conclusion analysis of each program Lab Work: Multiplication and Division using Shift instructions We have seen earlier that the SHL instruction can

Lab Work: Multiplication and Division using Shift instructions We have seen earlier that the SHL instruction can be used to multiply an operand by 2" and the SHR instruction can be used to divide an operand by 2". The MUL and DIV instructions take much longer to execute than the Shift instructions. Therefore, when multiplying/dividing an operand by a small number it is better to use Shift instructions than to use the MUL/DIV instructions. For example MUL BL where BL = 2 takes many more clock cycles than SHL AL, I. In Exercise 1, and 2, you will write programs to multiply, and divide respectively, using shift instructions. Write each of the programs using emu8086. 1. Write a program to multiply AX by 27 using only Shift and Add instructions. You should not use the MUL instruction Recall that shifting left n bits multiplies the operand by 2". If the multiplier is not an absolute power of 2. then express the multiplier as a sum of terms which are absolute powers of 2 For example, multiply AX by 7. (7 = 4 +2+1 = 22 +2' +1) Answer = AX shifted left by 2 + AX shifted left by 1 +AX. Note: Only the original value of AX is used in each operation above. 2. Write a program to divide AX by 8 using Shift instructions. You should not use the DIV instruction. Assume AX is a multiple of 8. Recall that shifting right ne bits divides the operand by 2". 3. Write a program to check if a byte is a Palindrome. (Hint: Use Rotate instructions). If the byte is a Palindrome, then move AAh into BL. Otherwise move 00h in BL. A Palindrome looks the same when seen from the left or the right. For example, 11011011 is a Palindrome but 11010011 is not a Palindrome Write a program to display the bits of a register or memory location. Use the INT 21H interrupts to display data on the display monitor. (Hint: Use logical shift instruction to move data bit into For example, if AL = 5SH, then your program must display: AL-01010 101
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
