Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write your solutions in a Word, Wordpad, or Notepad file, and upload i as an attachment on Blackboard (BB). Avoid pdf, photos, handwritten. Do

image text in transcribed

image text in transcribed

Please write your solutions in a Word, Wordpad, or Notepad file, and upload i as an attachment on Blackboard (BB). Avoid pdf, photos, handwritten. Do not directly type your answers in BB system. Attach a file. Do not send it to my email. Q1. 50 Points. Convert the given code fragment to assembly code fragment, using only instructions of the following types. These instructions are generally discussed in class. Here X,Y,Z are any memory locations; R,R1,R2 are any general registers; L is a label in the code (you can use any names as labels, ex. L, L1, L2 etc. ). - load X, R //copy contents of memory location X into R. - store R,X //Store contents of R into Mem location X - cmp R1, R2 //Compute R1-R2 and update condition codes: // throw away result of subtraction. - jmpL//Jump to location L in the code. - jmppL //If P bit is 1 , Jump to location L in the code - add X, R //Add contents of XR and store result in R; //Also update the condition codes. Be careful about what type of argument is allowed in the instruction (Memory or Register). Ex. the first argument of ADD instruction is memory, not register. Do Not use any other instructions (in this, or some other, assembly language). I cannot get into syntax and semantics of your assembly language or its presume cpu architecture. So follow the instructions in the question. Ex. do not use JMPZ, JMPN etc. in these questions. Ex. Do not say: cmpXX Y. The question says that the two arguments in the cmp instruction are registers, not memory locations. The code segment: while ((X

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books

Students also viewed these Databases questions