CSC232 Assem Language
CSC232 Assem Language
and Architecture
1.11
3.1 A Simple Machine
1.14
3.1 A Simple Machine
1.15
3.1 A Simple Machine
1.16
3.1 A Simple Machine
1.17
3.1 A Simple Machine
1.18
3.1 A Simple Machine
1.19
3.2 Instruction Mnemonics and Syntax
1.21
3.2 Instruction Mnemonics and Syntax
1.22
3.2 Instruction Mnemonics and Syntax
1.23
3.2 Instruction Mnemonics and Syntax
1.24
3.2 Instruction Mnemonics and Syntax
1.25
3.2 Instruction Mnemonics and Syntax
1.26
3.3 Assembler Directives and Commands
1.27
3.3 Assembler Directives and Commands
1.30
3.3 Assembler Directives and Commands
1.31
3.4 Assembly and Execution of Programs
• .
1.33
3.4 Assembly and Execution of Programs
• Assemblers
– Assemblers are programs that generate machine code
instructions from a source code program written in
assembly language.
– The assembler will replace symbolic addresses by
numeric addresses,
– Will replace symbolic operation codes by machine
operation codes,
– Will reserve storage for instructions and data, and
translate constants into machine representation..
1.34
3.4 Assembly and Execution of Programs
• Assemblers
– A simple assembler scans the entire assembly
program twice, where each scan is called a pass.
– During the first pass, it generates a table that
includes all symbols and their binary values. This
table is called the symbol table.
– During the second pass, the assembler will use the
symbol table and other tables to generate the object
program, and output some information that will be
needed by the linker.
1.35
3.4 Assembly and Execution of Programs
• Data Structures
• The assembler uses at least three tables to perform its
functions:
• symbol table: is generated in pass one, has an entry for
every symbol in the program.
• opcode table: provides information about the operation
codes. Associated with each symbolic opcode in the table
are its numerical value and other information about its
type, its instruction length, and its operands.
• pseudo instruction table: Each entry refers the assembler
to a procedure that processes the pseudo instruction when
encountered in the program..
1.36
3.4 Assembly and Execution of Programs
• Data Structures
– In order to keep track of the instruction
locations, the assembler maintains a variable
called Instruction Location Counter (ILC).
– The ILC contains the value of memory location
assigned to the instruction or operand being
processed.
– The ILC is initialized to 0 and is incremented
after processing each instruction.
1.37
3.4 Assembly and Execution of Programs
1.38
3.4 Assembly and Execution of Programs
1.39
3.4 Assembly and Execution of Programs
1.40
3.4 Assembly and Execution of Programs
1.41
3.4 Assembly and Execution of Programs
1.42
3.4 Assembly and Execution of Programs
1.43
3.4 Assembly and Execution of Programs
1.44
3.4 Assembly and Execution of Programs
1.45
3.4 Assembly and Execution of Programs
1.46
3.4 Assembly and Execution of Programs
1.47
3.4 Assembly and Execution of Programs
1.48
3.4 Assembly and Execution of Programs
1.49
3.4 Assembly and Execution of Programs
1.50
3.6 Summary
1.51
3.6 Summary