3c) Programming i. Write a snippet of MIPS assembly language to implement the following high-level code. Assume the signed inii. A MIPS jump and link instruction has the format jal addr where addr is the address _/1 to which execution will jump. Howeiii. The jal instruction can be used to jump to a procedure. When it is finished the procedure can return to the instruction

3c) Programming i. Write a snippet of MIPS assembly language to implement the following high-level code. Assume the signed integer variables g, h and i are in registers $s0, $s1 and $s2 respectively. Use any of the temportary registers (e.g. $t0) you require. (Note that the code in a do while loop will execute at least once.). do { i = i + g; } while (i ii. A MIPS jump and link instruction has the format jal addr where addr is the address _/1 to which execution will jump. However addr cannot be any arbitrary 32-bit number. Explain why not. (You do not need to explain which values are valid and which are not.) iii. The jal instruction can be used to jump to a procedure. When it is finished the procedure can return to the instruction after the jal. Explain how this works in the MIPS and give the instruction used to return from a procedure.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *