Pseudoinstructions

The questions below are due on Sunday November 01, 2026; 11:59:00 PM.
 
You are not logged in.

Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
Back to Exercises

Pseudoinstructions

The questions below will be asking you to write possible equivalent lines of assembly code from pseudoinstructions to non-pseudo instructions and vice versa. You may need to use the RISC-V ISA Handout for reference.

1) Pseudo to non-pseudo

For each of the following, write a possible equivalent line of assembly code that does the same thing using non-pseudo instructions

1.1) mv a3, a7

mv a3, a7

1.2) call function_name

call function_name

1.3) beqz a4, return

beqz a4, return

1.4) li a2, 17

li a2, 17

2) Non-pseudo to pseudo

For each of the following, write a possible equivalent line of assembly code that does the same thing using pseudoinstructions

2.1) blt a3, zero, name

blt a3, zero, name

2.2) sub a4, zero, a2

sub a4, zero, a2

2.3) addi a2, zero, 31

addi a2, zero, 31

2.4) add a4, zero, a3

add a4, zero, a3

2.5) bne a5, zero, loop

bne a5, zero, loop

Back to Exercises