You will finish an assembler for the made-up machine of the lesson. Each instruction becomes 8 bits: a 4-bit operation code, a space, and the address as a 4-bit binary number.
Your tasks.
SUB (0011) and STO (0100) to the table OPCODES.assemble_line, so "ADD 6" becomes "0010 0110".run: start with the accumulator at 0, carry out each instruction on the memory, and return the accumulator at the end.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…