assemblyasciimachine-codemicroprocessors

How does a computer/microprocessor understand the mnemonics(assembly language) written by a programmer?


I was reading the book "Microprocessor architecture, programming and applications with the 8085" written by Ramesh Goankar. In that I came across the section which deals with how assembly language and machine code wroks(like a brief intro). So here's what I understood:

  1. First, the programmer has to enter the mnemonics specific to the processor through the ascii keyboard.
  2. Second, the ascii keyboard decodes the character to binary(which represents the ascii characters .i.e. the mnemonics).
  3. Third, the assembler(specific to the processor) converts the ascii character to the machine code based on the mnemonics it has provided.
  4. Finally, the machine code is executed.

Is there anything wrong about what I understood? Correct me if I'm wrong.


Solution

  • Your understanding is largely correct.

    I would add that each of these steps represent a large chunk of work, rather than operating on one instruction.

    Very little ever gets done in one or two assembly instructions.

    A programmer writes a whole program or test sequence with intent of running, testing and debugging.

    A program consists of many lines of assembly, where each line (modulo directives and blank lines) corresponds to a machine code instruction, including opcode and operands

    Program development is a cycle, in that the programmer will often make adjustments to the program, so some editing of assembly text via a text editor, followed by the other steps of build (assemble, link), run & test.