Question: 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

Assembly language Intel x-86 based Write an assembly language program consisting of

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!