Question: Running programs You should create two files 1 One you work with, that has comments and notes to keep you sane. Call this anything you

Running programs
You should create two files
1 One you work with, that has comments and notes to keep you sane. Call this anything you like.
2 One you run and submit, which contains nothing but hex bytes separated by white space. You'll
submit this as a file named mod.binary (or mod.binary.txt if needed)
To test your code by going to our online simulator and click the file upload button at the top of the
page to load your mod. binary into the simulator's memory.
Your task
Your code should
1 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 (001) and fourth (003) bytes are the input values. This
means your first (000) and third (0x02) bytes (instructions) should b very specific
operations.
2 Compute the modulo of those values (i.e.,(what's at 001) mod (what's at 003))
3 Store the product at address 0xD0
4 Halt once it is done
For example, if mod.binary begins _?10_06 then when it is finished it should have 04 in address
OXDO; in decimal, that is 16mod6, which is 4. If mod.binary begins _7Fdots0A then when it is
finished it should have 07 in address 0D0; in decimal, that is 127mod10, 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 0D0 to 000.
Running programs You should create two files 1

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!