Você está na página 1de 24

Lecture No-02

Assembly Language
Date 23-11-2019
Instructor Name
MR. NADEEM AHMAD
Computer Organization & Assembly
Language
Reference Books:

 1. Robert Britton, MIPS Assembly Language Programming, Latest


Edition,

 2. Computer System Architecture, M. Morris Mano, Latest Edition,

 3. Assembly Language Programming for Intel- Computer, Latest


Edition
What is Computer & Types of Computer…?

An electronic device for storing and processing data, typically in binary from
according to instructions given it in a variable program.
Types of Computer
 Supercomputer.
 Workstation Computer.
 Personal Computer or PC.
 Microcomputer.
 Smartphone.
What is CPU…?

The central processing unit (CPU) is the unit which performs most of the
processing inside a computer. To control instructions and data flow to other parts
of the computer.
The CPU has two components:
 Control Unit: Extracts instructions from memory and decodes and executes them.

 Arithmetic Logic Unit (ALU): Handles arithmetic and logical operations


Difference between Software & Hardware

Software:
A Set of Instruction given to the computer to solve problems is called software.
 MS Package
 Operating Systems
Hardware:
Computer hardware is the collection of physical parts of computer system.
For example monitor, keyboard, and mouse.
What is System Software ...?

The programs that control and manage the basic operations of a computer are
generally referred to as system software. System software typically includes the
following types of programs:
 Operating Systems (Windows, Mac OS, Linux)
 Utility Programs (virus scanners)
 Software Development Tools (Assemblers, compilers, and interpreters)
What is Application Software…?

Application software is use to entertain the user.


Programs that make a computer useful for everyday tasks are known as
application software. These are the programs that people normally
spend most of their time running on their computers.

 Microsoft Word
 PowerPoint
 Web Browsers
What is Programming Language…?

A programming language is a vocabulary and set of grammatical rules for


instructing a computer or computing device to perform specific tasks.
1. C, C++
2. PHP
3. Java
4. Python
Programming Languages

1. High Level Language


2. Low Level Language
 High Level Language:
A language that human can understand easily called High Level Language.

 Low Level Language :


A language that Computer can understand easily called Low Level Language.
What is Programming statements?

The individual instructions that you use to write a program in a high-level


programming language are called statements. A programming statement
may consist on key words, operators, punctuation, and other allowable
programming elements, arranged in the proper sequence to perform an
operation.
Language Translators

A Software that is used to translate high level language in to the


machine language is called Language Translators.
Types of Language Translators:
1. Compiler
2. Interpreter
3. Assembler
Compiler

A compiler is a program that translates a high-level language program


as a whole into a machine language program that can be executed any
time when it is needed.

10100001
Compiler 10111000
print ("Hello World")
10011110
Interpreter

A Interpreter is a program that translates a high-level language program line


by line into a machine language program that can be executed any time when
it is needed.

10100001
10111000
10011110
Executing a high-level program with an
interpreter

print 10100001
("Hello Interpreter 10111000
World") 10011110
What is Assembly Language

Computer scans assembly code as it encounters words it looks them up in a


table to convert to binary converts numbers to binary, then assembles the
binary pieces into an instruction
1. Computer scans assembly code
2. As it encounters words it looks them up in a table to convert to binary
3. Converts numbers to binary, then assembles the binary pieces into an
instruction
What is Assembly Language…?

Each personal computer has a microprocessor that manages the computer's


arithmetical, logical and control activities.
Each processors has its own set of instructions for handling various
operations like getting input from keyboard, displaying information on
screen and performing various other jobs. These set of instructions are
called 'machine language instruction'.
Basic Features of PC Hardware

The main internal hardware of a PC consists:


1. Processor
2. Memory
3. Registers
The registers are processor components that hold data and address. To execute a
program the system copies it from the external device into the internal memory.
The processor executes the program instructions.
Fetch Decode Execution Cycle

The computer retrieves a program instruction from its memory. It then


establishes and carries out the actions that are required for that
instruction.

The cycle of fetching, decoding, and executing an instruction is


frequently repeated by the CPU even as the computer is turned on.
Fetch Decode Execute Cycle

1. Fetching the instruction from memory


2. Decoding or identifying the instruction
3. Executing the instruction

Fetch

Execute Decode
Fetch Decode Execute Cycle

 FETCH: The first step the CPU carries out is to fetch some data
and instructions (program) from main memory then store them in
its own internal temporary memory areas.

 DECODE: The next step is for the CPU to make sense of the
instruction it has just fetched.

 EXECUTE: All Code Execute


Assembler

 Editor: Simple text editor that can create assembly language source
files.
1. Text pad
2. Notepad
3. Visual Studio
 Assembler: An assembler is a program that converts source-code
programs from assembly language into machine language.
Assembler

 Linker: A companion program which combines individual files


created by an assembler into a single executable program. There are
two Linkers.

1. LINK.EXE (Microsoft 16 bit)


2. LINK32.EXE (Microsoft 32 bit)
Assembler

 Debugger: Third program provide the way to programmer to trace the


execution of a program and examine the contents of memory.
1. MASM provide 16 bit debugger name CodeView.
2. TASM provide Turbo debugger.
3. Microsoft Visual Studio provide msdev.exe

 There are two assemblers:


1. MASM (Microsoft Assembler)
2. TASM (Turbo Assembler)

Você também pode gostar