|
|
c m s c 311
f a l l 2 0 0 2 |
The only thing you have to be careful about is that C++ strings number the characters from left to right (i.e. index 0 in the MSB), while "real" bitstrings number right to left (index 0 is the LSB).
You will need to implement the following two functions:
| static string binToStringInstr( unsigned int instr ) ; |
| The instruction is represented as a 32 bit unsigned int (thus, it's in "machine language" format). Translate this to the appropriate string (thus, if the instruction means "add $r1, $r2, $r3", that's the string that should be returned. Return the string "UNKNOWN" if you can't tell what instruction it is. |
| static unsigned int stringToBinInstr( string instr ) ; |
|
The instruction is now written as a string. Convert this to
an unsigned int. For example, the string could be
"add $r1, $r2, $r3". You should translate the string to an unsigned
int which is the machine language translation of "add".
You should handle:
|
|
See the class syllabus for policies concerning email Last Modified: Fri Sep 27 19:41:52 EDT 2002 |
|
|
|
|
|