2) Make your assembler more intelligent so that it can catch errors, tell the user what the error is, and possibly suggest corrections.
a. Duplicate Labels
If there are two identical labels, my assembler will catch the error.
b. Unknown Operation
If the operation is not in the instruction table, then the seemlier will report the error. For example, the assembler does not know the operation "output."
c. Unrecognized Registers
If the order of registers are flipped, my assembler will catch the error and suggest correction.
I used try -except.
wrong order of registers
catches error and suggests correction
and except to handle this kind of errors.
the immediate value was put after the destination register whereas the right order should be movie 1 RA.
In the following example, the source register RG is not in the register fields.
The destination register RF is not in the register fields, so the assembler will report an error.
3) Create some test programs that evaluate all of the CPUs capabilities.
The program testInstr.txt uses all the remaining rest instructions.
I commented what should be executed in the text files. The results of simulation are as expected.