Question: Load the values in memory at addresses 0 x 0 1 and 0 x 0 3 into registers Note: since we have not discussed ways

Load the values in memory at addresses 0x01 and 0x03 into registers
Note: since we have not discussed ways to get other data into our memory yet, we will directly modify your code so that the second (0x01) and fourth (0x03) bytes are the input values. This means your first (0x00) and third (0x02) bytes (instructions) should be very specific operations.
Compute the modulo of those values (i.e.,(whats at 0x01) mod (whats at 0x03))
Store the product at address 0xD0
Halt once it is done
For example, if mod.binary begins __10__06 then when it is finished it should have 04 in address 0xD0; in decimal, that is 16 mod 6, which is 4. If mod.binary begins __7F __0A then when it is finished it should have 07 in address 0xD0; in decimal, that is 127 mod 10, which is 7.
Note: We should be able to change the second and fourth bytes of your program to do other modulo calculations too.
You may assume that neither value will be negative, but either may be zero. If either operand is 0, your code should set the value at 0xD0 to 0x00.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!