Jupyter at Bryn Mawr College |
|||
Public notebooks: /services/public/dblank / CS240 Computer Organization / 2015-Fall / Assignments |
Write machine code for each of the following problems, assemble them, and run them. Point out how to tell that you got the answer. Explain how your code works.
Add up the numbers 1 through 10 (use a branch).
Add up the numbers 10 through 20 (use a branch).
Subtract 5 from 7.
Subtract 7 from 5.
Multiply 2 times 7. Multiplying by two could be called "shift left".... why?
Multiply 5 times 7 in a generic way. Make your code so that you could change either 7 or 5 and the code would still work.
How many times will 3 go into 11? Make your code so that you could change either 3 or 11 and the code would still work.
How many times will 4 go into 33? Make your code so that you could change the data and it would still work.
Is the number 5 in the range of numbers 1 through 10? Make your code so that you could change 10 or 5 and it would still work.
Put a number in R0. If the number in R0 is even, put the number xFF in R1, otherwise put x00 in R1.