Lect.
1 : Computer Organization
& Assembly Language
1 – An Introduction
Computer Architecture
Computer Architecture refers to those attributes of
a system visible to a programmer
Those attributes that have direct impact on logical
execution of a program.
Architectural attributes include:
the instruction set,
no. of bits used to represent various data types
(numbers, characters etc),
I/O mechanisms and technology for addressing memory.
Example: Architectural design issue whether a
computer will have multiply instruction or not.
2
What is Computer Organization?
Organization is how features are implemented.
How does a Computer Work?
For Example: Is there a special hardware multiply unit
for multiplication operation or is it done by repeated
addition?
Computer Organization refers to the operational
units and their interconnections that realize the
architectural specifications.
Organizational attributes:
hardware details transparent to the programmer such as
control signals,
interfaces between peripherals and the computer,
the memory technology used.
3
Computer Organization vs.
Architecture
Architecture:
Logical aspects of computer hardware that are
visible to the programmer
What instruction a computer understands!
Organization:
Physical aspects of computer hardware that are
invisible to the programmer
How does the computer hardware carries out
instructions!
4
Computer Organization vs. Architecture
Contd..
Computer Organization must be designed to
implement a particular architectural
specifications.
It is possible to have same architecture but
different organizations.
All computers in the Intel Pentium series have the same
architecture.
Each version of the Pentium has a different organization
or implementation.
5
Computer Organization vs. Architecture
Contd..
Architectural Issues:
Reduced Instruction Set Computing (RISC)
Complex Instruction Set Computing (CISC)
Pipeline etc
Organizational Issues:
I/O, control unit, memory etc
6
Why Study Computer Organization?
Understand how computer works!
Computer functional components, their characteristics,
their performance, and their interactions.
How to select a system?
Understand tradeoff among various components, such
as memory size, CPU clock speed etc.
7
Assembly Language
Computer Level Hierarchy
Figure Reference:
9 http://users.dickinson.edu/~braught/courses/cs251f09/topics/slides/
Programming Languages
High-Level Languages (HLL)
Assembly Language
Machine Language
10
High-Level Language
Allow programmers to write programs that look
more like natural language.
Examples: C++, Java, C#.NET etc
A program called Compiler/Interpreter is
needed to translate a high-level language
program into machine code.
Each statement usually translates into multiple
machine language instructions.
11
Machine Language
The "native" language of the computer
Numeric instructions and operands that can be
stored in memory and are directly executed by
computer system.
Each ML instruction contains an op code (operation
code) and zero or more operands.
Examples:
Opcode Operand Meaning
-------------------------------------------------
40 increment the AX register
05 0005 add 0005 to AX
12
Assembly Language
Use instruction mnemonics that have one-to-one
correspondence with machine language.
An instruction is a symbolic representation of a single
machine instruction
Consists of:
label always optional
mnemonic always required
operand(s) required by some instructions
comment always optional
13
Sample Program
1. mov ax, 5 ax 05 Memory
011C
2. add ax, 10 ax 15 011E
35 0120
3. add ax, 20 ax 35 0122
0124
4. mov [0120], ax ax 35 0126
5. int 20
14
Figure: Machine Language Generation by
ASM and HLL programs.
ASM ML
ML
ML
HLL
ML
ML
15
Essential Tools
Assembler is a program that converts source-code programs
into a machine language (object file).
Linker joins together two or more object files and produces a
single executable file.
Debugger loads an executable program, displays the source
code, and lets the programmer step through the program one
instruction at a time, and display and modify memory.
Emulator allows you to load and run assembly language
programs, examine and change contents of registers. Example:
EMU8086
16
17
18
19
Why Learn Assembly Language?
Learn how a processor works
Explore the internal representation of data and
instructions
How to structure a program so it runs more efficiently.
Compilers/Device Drivers/ OS codes
Games/Embedded System
20