Assignment 3, due Sep 12
Part of
the homework for CS:2630, Fall 2019
|
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper in discussion section on Thursday. Some parts of assignments may be submitted on-line and completed in discussion section. Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
STRING1:ASCII "this is an example string",0 ENDMARK: LENGTH: H ENDMARK-STRING STRING2:ASCII "this is another example string",0 POINT1: W STRING1 POINT2: W STRING2
Rewrite the above code with ALIGN directives insterted where they should be to assure that all halfwords and words are properly aligned. (1 point, 0.2 point penalty for each missing or extra align)
113201D1 C213F2F3 000662F4 000010E5
a) Disassemble these words into a sequence of hawk instructions, and give those instructions in SMAL Hawk notation. (1.0 points, 0.1 points penalty per error in opcode, register or field.)
Hint: All the instructions are found in Chapter 4, Appendix B of the Hawk Manual is the primary resource for this kind of problem, in general, the Hawk emulator can solve this problem for you, but you will be expected to be able to disassemble code by hand using Appendix B on exams.
b) What registers does the above code change, and what values does it leave in those registers, when it is done. (0.5 points, 0.1 point penalty per missing or extra register or incorrect value)
Hint: Again, you will be expected to be able to solve this with pencil, paper and the Hawk manual, but you can check your work using the Hawk emulator.
LOADA rd,address
Here, rd is the destination register, address is a 32-bit literal memory address, and the instruction loads the word from that memory address into the destination register.
A problem: Write a SMAL Hawk macro that implements this. (0.5 points, 0.1 point penalty per missing, corrupt or extra element)