Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

CS3 Reviewer – Midterm  Other advantages of using assembly language

are:
Executable instructions or Instructions
 It requires less memory and execution time
- Type of statement each executable instruction
 It allows hardware-specific complex jobs in
generates one machine language instruction
an easier way
- Type of statement tells processor what to do
 It is suitable for time-critical jobs
- Type of statement each instruction consists of
an operation code (opcode)
Compiling and Linking an Assembly Program in NASM
Segment Address or Offset
- Memory address that starting addresses of
Assembly program can be divided into three sections:
memory segment with offset value
 The data section
Fetch decode execute cycle or execution cycle
 The bss section
- Process through which processor controls
 The text section
execution of instructions

Two parts a basic instruction.


Processor components that hold data and address:
 The name of the instruction (mnemonic)
 Registers
 Operands or parameter of the commands
 Assembler Directives
 The text section
Registers – type of statement tells assembles about
various aspects of assembly process
Three types of statements in Assembly language
Assembler Directives or Pseudo-ops
program:
- Type of statement non-executable and not
 Executable instructions or instructions
generate machine language instructions
Macros – type of statement basically a text substitution  Assemble directives or pseudo-ops
mechanism  Macros
Name of the instruction or mnemonic
- First part of basic instruction which is to be Arrange
executed
Text section Two kinds of memory addresses:
- section is used for keeping actual code  Absolute address
- section must begin with declaration global  Segment Address (or offset)
main, which tells kernel where program
execution begins Absolute Address – direct reference of specific location
bss section Segment Address (or offset) – staring address of
- section use for declaring variables memory segment with offset value
data section
- section use for declaring initialized data or Acronyms:
constants TASM – Turbo Assembler
absolute address GAS – GNU Assembler
- memory address that the directs reference of MASM – Microsoft Macro Assembler
specific location NASM - Netwide Assembler
bit; could be on (1) or off (0)
- fundamental unit of computer storage Processor supports following data sizes:
byte  Word: 2-byte data item
- group of nine related bits  Doubleword: 4-byte (32 bit) data item
 Quadword: 8-byte (64 bit) data item
Advantages of Assembly Language An understanding of  Paragraph: 16-byte (128 bit) area
assembly language provides knowledge of:  Kilobyte: 1024 bytes
 Interface of programs with OS  Megabyte: 1,048,576 bytes
 Processor and BIOS
 Representation of data in memory and other
external devices
 How processor accesses and executes
instruction
 How instructions accesses and process data
 How a program access external devices

You might also like