Faculty of Computer and Mathematical
Sciences
An Introduction
to
Assembly Language
TOPIC 1
Faculty of Computer and Mathematical
Sciences
Introducing Assembly Language
• Assembly language is a specific set of instructions for a
particular computer system.
• It unlocks the secrets of your computer’s hardware and
software.
• It teaches you about the way the computer’s hardware and
OS work together and how application programs
communicate with the OS.
• It is a programming language with a one-to-one
correspondence between its statement and a computer’s main
machine language.
• To learn how a computer and its software really work, you
need to view them at machine level.
December 8, 2021 CSC428 - COMPUTER ORGANIZATION 2
Faculty of Computer and Mathematical
Sciences
Introducing Assembly Language (cont)
• There is no single assembly language.
• Each computer or family of computers uses a different
set of machine instructions and a different assembly
language (the computer’s design influences the
instructions it can execute).
• An assembler – a program that converts or translates
source-code programs into machine language, which
may in turn be executed by the computer (runs under the
disk operating systems MS-DOS or PC-DOS).
December 8, 2021 CSC428 - COMPUTER ORGANIZATION 3
Faculty of Computer and Mathematical
Sciences
Assembler vs. Compiler
Assembly Assembler Machine
Language Language
(Source code) (Object code)
High-level Compiler Machine
language Language
(Source code) (Object code)
December 8, 2021 CSC428 - COMPUTER ORGANIZATION 4
Faculty of Computer and Mathematical
Sciences
Why learn Assembly Language?
• To learn about the computer’s architecture and
OS.
• For its utility :
- Certain types of programming are difficult and
impossible to do in high-level languages.
- Assembly language has very few restrictions or
rules.
December 8, 2021 CSC428 - COMPUTER ORGANIZATION 5
Faculty of Computer and Mathematical
Sciences
Machine Instruction
• A machine instruction is a binary code that has a
special meaning for a computer’s CPU - it tells
the computer to perform a task.
• Each machine instruction is precisely defined
when the CPU is constructed, and it is specified to
that type of CPU. For example:
00000100 Add a number to the AL register.
10100011 Move the AX register to another
register.
December 8, 2021 CSC428 - COMPUTER ORGANIZATION 6
Faculty of Computer and Mathematical
Sciences
Machine Instruction (cont)
• Registers are high-speed storage locations inside
the CPU which are used by nearly every
instructions
• They are identified by 2-letter names, such as AH,
AL, AX and so on.
• We refer to machine instructions using hexadecimal
numbers because they take up less writing space.
December 8, 2021 CSC428 - COMPUTER ORGANIZATION 7
Faculty of Computer and Mathematical
Sciences
Assembly Language Instruction (cont)
• Mnemonic : a short alphabetic code that literally
“assists the memory” in remembering CPU instruction
• It may be an instruction or a directive
• E.g. an instruction MOV (move)
• E.g. a directive DB (definite byte, used to create
memory variables)
• An instruction may contain zero, one or two operands.
December 8, 2021 CSC428 - COMPUTER ORGANIZATION 8