
Provide the full MARIE RTN for these new MARIE operations. Include the
fetch, decode, operand fetch (if necessary), execution and store result (if necessary) stages. X is a
main memory address (the last 12 bits of the 16-bit instruction) and should be referenced as
IR[11..0] in your RTN.
LoadIndex X – this is a load where a datum is loaded into the AC, but the address of the
datum is not X, instead it is computed by fetching the address at memory location X and
adding that value to the address of the value currently stored in a special register called R1.
Using the textbook’s notation, we are performing AC M[R1+M[X]] meaning that we
get the item at location X, add it to R1, and use that sum as the address to fetch the datum.
Assume the ALU can directly access values in the AC, MBR and R1.

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

- Assign the register numbers for all the variables. You are encouraged to refer the MIPS assembly registers. (2) Select appropriate assembly instructions for arithmetic operations and if/else statements. (3) Once you have the assembly instructions for arithmetic operations and if/else statement, pair up these instructions with beq/bne and j instructions. If the condition has equality comparison, you may need to slt instruction. Using slt instruction, you can set a temporary value (t) to 1 and branch to the next instruction with beq/bne instruction. (4) Finally, add the comments for each instruction line to clarify. Assume the integer variables g and h are in registers $s2 and $s3, respectively. if (g > h) g = g + h;else g = g – h; if (g >= h) g = g + 1;else h = h – 1; if (g <= h) g = 0;else h = 0;arrow_forwardQ5 Please convert the following C/C++ function to RISC-V assembly (RV321). Function: swap Registers: ra = x1 (return address) &v[0] -> a0 = x10 (arguments/return values) k-> a1 = x11 (arguments/return values) to = x5 (temporary) t1 = x6 (temporary) t2 = x7 (temporary) hint: void swap(int v[], int k) { int temp; temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; %3D }arrow_forwardQ3. Provide the hexadecimal representation of the following instruction.-- sd x17, 61 (x30) Ans:arrow_forward
- For the whole question, pseudo-instructions are not allowed except “j target_label”and “jr ra”. One suggestion for assembly programming problems is that you can includecomments to one or a block of instructions. Consider a RISC-V assembly function func1. func1 has three passingarguments stored in registers a0, a1 and a2, uses temporary registers t0-t3 andsaved registers s4–s10. func1 needs to call func2 and other functions may call func1also. func2 has two passing arguments stored in registers a0 and a1, respectively. Infunc1, after the program returns to func1 from func2, the code needs the originalvalues stored in registers t1 and a0 before it calls func2. (a) How many words are the stack frames of function func1?(b) Indicate which registers are stored on the stack of func1.arrow_forwardHow many trap service routines could theoretically be created for the LC-3, given the format of the TRAP instruction? (hint: how many bits are used for the trap vector?) 8 64 O 256 О 16к 32arrow_forwardDraw a diagram showing the relationship of the EDX, DX, DL and DH registers. Page 29 shows EAX that you can follow as a template. Template attachedarrow_forward
- The FIQ interrupt techniques are required to hook and chain at the offset of the Interrupt Vector Table. It.?arrow_forwardFollowing is the memory map beginning from address 3C00H and increasing addresses to the right , all in hex : 33, 5F, 00, FF, DE, C1, BB, 5E, 77, 95, 8C, ... Write down the value of each register after executing each instruction: MOV SP, -50168 РOP ВХarrow_forwardWhat happens to the Carry flag when the SHR AX,1 instruction is executed?arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





