Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Hand assemble and run the code in example 8,2 in your book. Your code will also have to fill the array. Include startup code

image text in transcribed

image text in transcribed

image text in transcribed

1) Hand assemble and run the code in example 8,2 in your book. Your code will also have to fill the array. Include startup code that loads the first eight prime numbers into the first eight bytes of the array. 2) Write, and hand assemble code, that loads the value 25 into variable A, 10 into variable B, and 5 into variable C, computes A+(B-C) and writes the result into address 250. Write a short report discussing any choices that you made and your approach to problem 2. Include screenshots of your run for both of these programs. In the report include both your assembler code (e.g., your modified code from page 318) and your object file listings (as shown above). You will be uploading your.pdf and a .jar file. Your assembler and object code will be in both files. That is required! Example Instruction Format Op-code 1: ADD 2: ADD 9 Op-code data 3: ADD R1,-9 Op-code R data 4: ADD R1, (9) Op-code RD | address 5: ADD R1, (R2), 9 Op-code RX 12 address 16: ADD R1, R2 Op-code RR 1 2 7: ADD R1, R2, R3 Op-code RR 1 12 13 Example Instruction ADD ADD 9 ADD R1,9 Description The source and destination operands are known to the instruction (e.g. a hardware stack). Immediate: R-R+9; R is a known register to the instruction. Register and immediate: R1R1+-9; R1 is used for both as the source and also as the destination register number Register and direct: R1 R1 + Memory19] Register and indexed: R1 R1 - Memory R2 +91 Register and register (two operands): R1R1+R2 Register and register (three operands): R3-R1+R3; the destination register can be different from the source registers ADD R1. (9) ADD R1, R2, (9) ADD R1, R2 ADDR3, R1, R2 1) Hand assemble and run the code in example 8,2 in your book. Your code will also have to fill the array. Include startup code that loads the first eight prime numbers into the first eight bytes of the array. 2) Write, and hand assemble code, that loads the value 25 into variable A, 10 into variable B, and 5 into variable C, computes A+(B-C) and writes the result into address 250. Write a short report discussing any choices that you made and your approach to problem 2. Include screenshots of your run for both of these programs. In the report include both your assembler code (e.g., your modified code from page 318) and your object file listings (as shown above). You will be uploading your.pdf and a .jar file. Your assembler and object code will be in both files. That is required! Example Instruction Format Op-code 1: ADD 2: ADD 9 Op-code data 3: ADD R1,-9 Op-code R data 4: ADD R1, (9) Op-code RD | address 5: ADD R1, (R2), 9 Op-code RX 12 address 16: ADD R1, R2 Op-code RR 1 2 7: ADD R1, R2, R3 Op-code RR 1 12 13 Example Instruction ADD ADD 9 ADD R1,9 Description The source and destination operands are known to the instruction (e.g. a hardware stack). Immediate: R-R+9; R is a known register to the instruction. Register and immediate: R1R1+-9; R1 is used for both as the source and also as the destination register number Register and direct: R1 R1 + Memory19] Register and indexed: R1 R1 - Memory R2 +91 Register and register (two operands): R1R1+R2 Register and register (three operands): R3-R1+R3; the destination register can be different from the source registers ADD R1. (9) ADD R1, R2, (9) ADD R1, R2 ADDR3, R1, R2

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

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions