Question

In: Computer Science

Write an assembly program that demonstrates multiplication operation in 80x86 assy languuage

Write an assembly program that demonstrates multiplication operation in 80x86 assy languuage

Solutions

Expert Solution

An 80x86 assembly program that demonstrates multiplication operation:

• Assume that we want to to perform multiplication of  two 8-bit number 04 and 06, that are at memory location 700 and 701 respectively.

• The 16-bit Result of the multiplication will be stored at memory location 800 and 801.

Assembly Program:

MOV SI, 700

MOV DI, 800

MOV AL, [SI]

INC SI

MOV BL, [SI]

MUL BL

MOV [DI], AX

HLT

Description:

MOV SI, 700 // SI = 700. Set the source index register to 700.

MOV DI, 800 // DI = 800. Set the Destination index register to 800.

MOV AL, [SI] // AL ← [SI]. load the contents from memory address SI to AL register. AL = 04

INC SI // SI = SI + 1. Increment the SI register value. SI = 701

MOV BL, [SI] // BL ← [SI]. load the contents from memory address SI to BL register. BL = 06

MUL BL // AX = AL * BL. Multiply register BL with AL. AX = 04 * 06

MOV [DI], AX // AX → [DI]. Store the content from AX register to destination address DI.

HLT // END the program.

The result is placed at memory location 800 and 801. Which is 04 * 06 = 18 (hexadecimal).


Related Solutions

Write a MIPS assembly language program that implements the following pseudo-code operation: result = x +...
Write a MIPS assembly language program that implements the following pseudo-code operation: result = x + y – z + A[j] x and y should be in reserved memory words using the .word directive and labeled as x and y. Initialize x=10 and y=200. Read in z from the console. Input the value -8. This is the value for z, not for –z. Store this value in memory with the label z. To begin, you could just initialize z to...
Java Program Use for loop 1.) Write a program to display the multiplication table of a...
Java Program Use for loop 1.) Write a program to display the multiplication table of a given integer. Multiplier and number of terms (multiplicand) must be user's input. Sample output: Enter the Multiplier: 5 Enter the number of terms: 3 5x0=0 5x1=5 5x2=10 5x3=15 2 Create a program that will allow the user to input an integer and display the sum of squares from 1 to n. Example, the sum of squares for 10 is as follows: (do not use...
Write in ARM assembly language the following operations without using multiplication instruction: a) A * 17...
Write in ARM assembly language the following operations without using multiplication instruction: a) A * 17 b). A * 23
Assignment Purpose The purpose of this lab is to write a well-commented java program that demonstrates...
Assignment Purpose The purpose of this lab is to write a well-commented java program that demonstrates the use of loops, and generation of random integers. Instructions You are taking some time off from your paint business and currently are on vacation in Bahamas. You decide to write a Java program that generates 10 random numbers between 1 and 20 (all integers). You cannot use arrays (even if you know what they are) to store these numbers. It then picks up...
Q1: A. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO EXCHANGE 16-BIT NUMBERS B. WRITE AN ASSEMBLY LANGUAGE...
Q1: A. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO EXCHANGE 16-BIT NUMBERS B. WRITE AN ASSEMBLY LANGUAGE PROGRAM TO SOLVE THE EQUATION Z=A+B-(C/D)+E please write the answer separately part A its own code and part B its own code this is microprocessor the ASSEMBLY LANGUAGE emu8086 should be written like this EX: mov ax,100h mov bx,200h etc
Write a Java program that uses nested for loops to print a multiplication table as shown...
Write a Java program that uses nested for loops to print a multiplication table as shown below.   Make sure to include the table headings and separators as shown.   The values in the body of the table should be computed using the values in the heading   e.g. row 1 column 3 is 1 times 3.
Write a java program of a multiplication table of binary numbers using a 2D array of...
Write a java program of a multiplication table of binary numbers using a 2D array of integers.
Coding Problem 1: In this program, you are asked to write a program in assembly (MIPS)...
Coding Problem 1: In this program, you are asked to write a program in assembly (MIPS) which works as a simple calculator. The program will get two integer numbers, and based on the requested operation, the result should be shown to the user. a. The program should print a meaningful phrase for each input, and the result. i. “Enter the first number” ii. “Enter the second number” iii. “Enter the operation type” iv. “The result is” b. The user should...
1)Write a C++ program which clearly demonstrates how the dangling else ambiguity is resolved. Your program...
1)Write a C++ program which clearly demonstrates how the dangling else ambiguity is resolved. Your program should print distinct results depending on if C++ uses inner-if or outer-if resolution. Turn in a listing of your program, the output, and a description of how your program demonstrates the semantic resolution of the ambiguity. 2) Give a context-free grammar describing the syntax of the following; Non-empty strings of 0’s and 1’s that represent binary numbers that have odd parity
Write a Python program that will perform various calculations (addition, subtraction, multiplication, division, and average). The...
Write a Python program that will perform various calculations (addition, subtraction, multiplication, division, and average). The program will add, subtract, multiply, or divide 2 numbers and provide the average of multiple numbers inputted from the user. You need to define a function named performCalculation which takes 1 parameter. The parameter will be the operation being performed (+,-,*,/). This function will perform the given prompt from the user for 2 numbers then perform the expected operation depending on the parameter that’s...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT