Section 1: Fundamental Concepts & Language Types
Why is machine code considered the only language a CPU can “use”?
Because it is the only language the hardware is designed to interpret directly as binary, because the hardware is made out of transistors and logic gates that can only process 0s and 1s. Any language that is not machine code needs to be translated before the CPU can understand it.
Is machine code machine dependent?
Yes, every different type of computer has its own set of machine code instructions.
What is an instruction?
A single operation preformed by the CPU.
How does the “length” of an assembly program compare to a high-level language program?
A program in assembly language requires many more instructions than a high-level language to perform the same task.
What are opcodes and operands?
Opcodes: Short for operation code. The part of the machine code instruction that identifies what action the CPU will do.
Operand: The part of a machine code instruction that identifies the data to be used by the CPU.
Define “Mnemonic” in the context of Assembly.
A short, abbreviated name (like LDD or STO) used in assembly language to represent a specific machine code opcode.
What is source code?
A computer program before translation into machine code.
Section 2: The Two-Pass Assembler (Pass 1)
What is an assembler? What are the different types of assemblers?
A computer program that translates programming code written in assembly language into machine code.
Assemblers can be one-pass or two-pass
What do single pass assemblers do (one-pass)?
It puts the machine code instructions straight into the computer memory to be executed.
What is the first thing an assembler does in Pass 1 regarding code formatting (in a two-pass assembler)?
It checks the syntax and removes all comments.
In Pass 1, what happens when the assembler encounters a symbolic address for the first time (in a two-pass assembler)?
It checks the symbol table; if it’s not there, it adds it to the “symbolic address” column with a corresponding “unknown” address in the address column.
What is a “Literal Table”?
A table created during Pass 1 (in a two-pass assembler) if the programmer has used constants in the program.
What are macros?
They are a group of instructions given a name (subroutine), can be executed multiple times within a program.
They are written once and called whenever needed.
Explain “Macro Expansion” during Pass 1.
The assembler replaces the macro call with the actual group of instructions defined in the macro.
What are directives?
commands that provide instructions to the assembler, but do not result in actual machine code instructions (information for assembler).
What happens to “Directives” during the first pass?
They are acted upon (e.g., memory is reserved or origin points are set), but they do not generate machine code.
Section 3: The Two-Pass Assembler (Pass 2)
What is the primary output of Pass 2?
The object code (the actual machine code instructions consisting of opcode and operand).
What happens in Pass 2?
What is the specific role of a “Loader”?
It is a program required to load an object program (produced by a two-pass assembler) into memory so it can be executed.
Section 4: Detailed Addressing Modes
What is the “formula” for Indexed Addressing?
Effective Address = Operand Address + Contents of Index Register (IX).