This preview shows page 1. Sign up to view the full content.
Unformatted text preview: hine
language program (often referred to as an object program). Since the assembler
translates each assembly language instruction into an equivalent machine language
instruction, there is a one-to-one correspondence between the assembly language
instructions of a source program and the machine language instructions of its
equivalent object program. Note that during the process of translation of a source
program into its equivalent object program by the assembler, the source program
is not being executed. It is only being converted into a form that can be executed
by the computer's processor.
Assembly language program -► input Assembler -► Machine language program (Source Program) -► One-to-one correspondence -► (Object Program)
Figure 12.2. Illustrating the translation process of an assembler.
You must have noticed from the discussion above that in case of an assembly
language program, the computer not only has to run the program to get the answer,
but it also must first run the assembler (program) to translate the original assembly
language program into its equivalent machine language program. This means that
the computer has to spend more time in getting the desired answer from an
assembly language program as compared to a machine language program.
However, assembly language programming saves so much time and effort of the
programmer that the extra time and effort spent by the computer is worth it.
Assembly language programming and translation of an assembly language
program into its equivalent machine language program can be best illustrated with
the help of an example. For this, let us assume that the computer uses the
mnemonics given in Figure 12.3 for the operation codes mentioned against each.
For simplicity, here we have considered only five operation codes that will be used
in writing our example program. Like this there can be more than hundred
operation codes available in the instruction set of a particular computer.
Mnemonic Opcode Meaning HLT
Halt, used at the end of program to stop
Clear and add into A register
Add to the contents of A register
Subtract from the contents of A register
Store A register
Figure 12.3. A subset of the set of instructions supported by a computer.
View Full Document
- Spring '14