This preview shows page 1. Sign up to view the full content.
Unformatted text preview: assembler for the data items of the
assembly language program of Figure 12.4.
The next instruction of the assembly language program is CLA FRST, which the
assembler translates into 10 1000 by translating CLA into 10 with the help of
Figure 12.3 and FRST into 1000 with the help of Figure 12.5. Similarly, the
assembler will translate the instruction ADD SCND into 14 1001, and the
instruction STA ANSR into 30 1002. Finally it translates the next instruction HLT
into 00, thus providing the complete machine language program for the given
assembly language program. The resulting machine language program is shown in
Figure 12.6. Memory
Clear and add the number stored at FRST to A
Add the number stored at SCND to the contents
of A register
Store the contents of A register into ANSR
Halt Reserved for FRST 1001
Reserved for SCND
Reserved for ANSR
The equivalent machine language program for the assembly
language program given in Figure 12.4.
Advantages of Assembly Language over Machine Language
Assembly languages have the following advantages over machine languages:
Easier to understand and use.
Due to the use of mnemonics instead of
op-codes and symbolic names for data locations instead of numeric
addresses, assembly language programs are much easier to understand and use as
compared to machine language programs. Assembly language programming also
saves a lot of time and effort of the programmer because it is easier to write as
compared to machine language programs.
2. Easier to locate and correct errors. Because of the use of mnemonic op-codes
and symbolic names for data locations, and also because programmers need not
keep track of the storage locations of the data and instructions, fewer errors are
made while writing programs in assembly language, and those that are made are
easier to find and correct. Additionally, assemblers are designed to automaticall...
View Full Document
- Spring '14