Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assembly language Intel x-86 based Write an assembly language program consisting of a main program and a subprogram (a second separate procedure to be called

Assembly language Intel x-86 based

image text in transcribed

Write an assembly language program consisting of a main program and a subprogram (a second separate procedure to be called from the main procedure). The purpose of the second procedure is to perform arithmetic (either addition or subtraction, but not both in response to the same call) on unsigned 96-bit integers stored in memory. Communication between the main program and the called procedure is to be done via CPU registers (you will need to choose four) One CPU register must be used to pass the memory offset of the first operand to the subprogram. A second register must be used to pass the offset of the second operand to the subprogram. A third register must be used to pass the offset of the location where the result of the operation is to be stored. The called procedure should use only the information passed from the main program in these three registers to locate the two source and one destination operands in memory; do not refer to these variables by name anywhere within the subprogram. A fourth register is to be used as a "control flag" to specify the desired operation; in other words, to tell the subprogram whether to compute (operandl + operand2) or (operand1 - operand2). If this register contains zero, the 96-bit numbers in memory are to be added; if it contains a nonzero value, the numbers are to be subtracted. Use assembler directives within your data segment to declare storage for and initialize the 96-bit test variables given below. The main program should call the subprogram twice: once to add the numbers 48C2E4C3552677F535D9607Bh plus 115724954F1792C6ED40C392h, and once to perform the subtraction 10792731164E95A224C2F0ABh minus 086234E52324642E3C7F1265h. Assemble and link your program and test it (using the debugger as necessary). At the conclusion of your program run, observe the final CPU register contents and the values of all variables of interest (the two source and one destination operands from both calculations - a total of six 96-bit values) in memory. You can capture screen shots from within the debugger, or use Irvine's DumpRegs and DumpMem procedures, to show these final register and memory contents

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions

Question

Write short notes on Interviews.

Answered: 1 week ago