Assembler Steps

These are the steps your assembler needs to perform

  1. Read input line from text assembly file
  2. Parse the opcode (usually the 1st word from the input line).
  3. Based on the opcode, you know if the next words in the input line are registers, addresses, immediate, offsets, etc... Parse these final fields from the input line. At this point you have all of the 8-bits you need to create the instruction.
  4. Write the 8-bits for this instruction to the binary (a text file, really) in as a 2 character hex number.
  5. Go back to step 1, until all instructions are processed.

The following are some points to keep in mind