Skip to content

Repository files navigation

Co-project

ASSEMBLER


WORKFLOW:

  1. The assembler starts by initializing the following:
  • opcode dictionary(stores all opcodes)
  • register dictionary(stores all registers)
  • memory dictionary
  • label dictionary
  • instructions list
  1. the assembler first stores all the variables in the memory.

  2. It stores all the labels and deletes them from the instructions so that only the instruction part is left.

  3. It then adds opcodes to all the instructions.

  4. Next, it adds all the remaining parts of the instructions like unused bits, register code, label address, memory address and immediate value.

  5. finally it prints all the binary code generated in the output file.

  6. If any of the errors are triggered then only the error is printed in the file.


ERROR REPORTING:

The assembler can find the following types of errors: a) Typos in instruction name or register name

b) Use of undefined variables

c) Use of undefined labels

d) Illegal use of FLAGS register

e) Illegal Immediate values (more than 7 bits)

f) Misuse of labels as variables or vice-versa

g) Variables not declared at the beginning

h) Missing hlt instruction

i) hlt not being used as the last instruction

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages