Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

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 addition or subtraction on 96-bit unsigned 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 an
operation selector to specify whether to add or subtract the two operands. If this register contains
zero, the operands are to be added; if it contains a nonzero value, the operands are to be subtracted.

Use assembler directives within your data segment to declare storage for and initialize the test
variables given below. The main program should call the subprogram twice: once to add the 96-
bit numbers 48C2E4C3552677F535D9607Bh plus 115724954F1792C6ED40C392h, and once to
subtract the 96-bit numbers 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.

Expert Solution
Check Mark
Step 1

 

 

 

DATA SEGMENT

NUM1 DB 9H

NUM2 DB 7H

RESULTS DB?

ENDS

Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY