- #1
altoaviactus
- 1
- 0
- Homework Statement
- This is the application that we have to use https://joeledstrom.github.io/brookshear-emu/ . I am attempting to subtract 16-15. The instruction set is also attached. I'm not very good at 2's complement, but I am trying to figure this out. Addition is much easier and straightforward, but I can't seem to make a good algorithm to make a negative converter. Here are the questions: 1. Using the model CPU demonstrated in class, write code using the simple machine language of Appendix C to solve the following problem: 16 - 15. Store the result in memory location F0.
2.Using the model CPU demonstrated in class, write code using the simple machine language of Appendix C to solve the following problem: 9 + 27 – 16. Store the result in memory location FF.
I think I only need help on one as I could figure out the other from it.
- Relevant Equations
- 1 RXY LOAD register R with the contents of the memory cell at address XY.
2 RXY LOAD register R with the value XY.
3 RXY STORE the contents of register R at memory location XY.
4 0RS MOVE the contents of register R to register S.
5 RST ADD the integer contents of registers S and T and leave the result
in register R. Integers are stored using two's complement notation.
6 RST ADD the floating-point contents of registers S and T and leave the
result in register R.
7 RST OR the contents of registers S and T and place the result in register R.
8 RST AND the contents of registers S and T and place the result in register R.
9 RST EXCLUSIVE OR the contents of registers S and T and leave the result in register R.
A R0X ROTATE the contents of register R one bit to the right X times.
B RXY JUMP to the instruction located at memory address XY if the
contents of register R equals that of register 0.
C 000 HALT
2010
210F
Can only get this far without running into issues
210F
Can only get this far without running into issues