Characteristics Of A High-level Programming Language
Each statement in a high-level language corresponds to multiple machine instructions.
Characteristics Of A Low-level Programming Language
- One-to-one translation
- Hardware dependence
- Systems programming orientation
- Few abstractions
It is important to understand that the phrase assembly language differs from phrases such as Java language or C language because assembly does not refer to a single language.
Experienced programmers understand that consistency and clarity are usually more important than clever tricks or optimizations. Thus, experienced programmers develop idioms: patterns that they use consistently.
Although both a compiler and an assembler translate a source program into equivalent binary code, a compiler has more freedom to choose which values are kept in registers, the instructions used to implement each statement, and the allocation of variables to memory. An assembler merely provides a one-to-one translation of each statement in the source program to the equivalent binary form.
Conceptually, an assembler makes two passes over the source program: one to assign addresses and one to generate code.
Both a compiler and an assembler translate a source program into equivalent binary code.
However, according to the Figure 4.6, the compiler translates the source code into assembly code. What is going on here?
A macro expansion facility preprocesses an assembly language source program to produce another source program in which each macro invocation is replaced by the text of the macro. Because a macro processor uses textual substitution, incorrect arguments are not detected by the macro processor; errors are only detected by the assembler after the macro processor completes.