Assignment 3 data file and insights
Data File
To get a copy of the data file, I suggest you go to the data file page and
select File Save As... from the Navigator menu. Alternatively you
can get a copy of it from my directory:
~downeyt/public_html/cda4101/mbi_in.txt
Data File in text format
Insights
-
Remember that ADD, SUB, MUL, XOR, OR in MBI can have the second operand as
an immediate value.
-
If you have trouble reading my data file, be sure that you are skipping the
TAB character as well as spaces. In C, tab is the '\t' character. In Pascal,
look for the character chr(9).
-
In the MUL routine, did you consider the case when the second operand is
negative? Do you have an infinite loop???
-
Be sure that all the labels that your program creates are unique.
-
When working with the signed branches, only look at the V, N, and Z bits.
The V bit means that the sign bit is incorrect. Suppose you are comparing
A and B, so you perform the subtraction A - B. If the answer is negative,
then B > A. So, you want to test if the answer should have been
negative. If V is clear and N is set then the answer should have been negative,
and it is. If V is set and N is clear then the answer should have been negative,
but it is positive.
-
When working with the unsigned branches, only look at the Z and O bits. Suppose
you are comparing A and B, so you perform the subtraction A - B. If the O
bit is set, then B > A.