0% found this document useful (0 votes)
23 views20 pages

Week 1 Part I 28022023 010547pm

Uploaded by

xelawu4902
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views20 pages

Week 1 Part I 28022023 010547pm

Uploaded by

xelawu4902
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Computer Organization and

Assembly Language – CSC 395


Lecture 1
Instructor: Dr. Muhammad Asfand-e-yar

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Course Outline
Course Work
• Data and Control • Data Transfer, Addressing and Arithmetic
Operations
• Introduction to Registers and Flags
• Data Operators and Directives
• Addressing Modes
• Indirect Addressing, Arrays, Indexed Operands,
• Assembly Language Fundamentals Pointers
• Basic Elements of Assembly Language • Jump and Loop Instructions
• Assembling Linking and Running Program • Procedures, Linking to External Library, Stack
• Add-Sub Program Operations
• Defining Data, BYTE, WORD, DWORD, • Conditional Processing
SWORD, SDWORD, FWORD, Real Number • Conditional Jumps, Conditional Loop Instructions,
Data, Little Endian & Big Endian Order Conditional Structures
• Declaring Uninitialized Data • Shift and Rotate Instructions, Binary Multiplication
• Real Address Mode Programming • Multiplication and Division Instructions
• …
BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad
Recommended Books
Modern X86 Assembly Language Programming: Covers x86 64-
bit, AVX AVX2 and AVX-512 (2nd Edition) - 2018.
By Daniel Kusswurm

Intel Microprocessors 8086 8088 ... -Architecture, Programming


and Interfacing (8th Edition)
Barry B Brey
BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad
Course Objectives
Introduction to Intel Architecture

Familiarization with Assembly Language, macros, operators and


program structures

Learning Programming methodology to create system level


software tools and application programs

Understanding of relationship between hardware and software


BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad
Pre-Requisites

Digital Logic Design

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Rules and Regulations
Students must reach the class-room in time. Attendance shall be
marked within 10 minutes of beginning of the class
Late-comers may join the class, but are not entitled to be marked as “present”

Students, who are absent on the announcement date of Quiz / Test,


won’t have second chance

Assignment submission dead-line must be observed


Late submission will never be entertained

Mobile phones must be switched-off in the class-room

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad 6


Assembly Language
Microsoft Macro Assembler (MASM) will be used for
programming

Other Assemblers are TASM (Turbo Assembler), NASM (Net-


wide Assembler) and GNU assembler

TASM and NASM are somehow similar to MASM, but GNU


assembler is totally different in writing syntax

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
What Background Should I Have before starting Assembly Language?

You should have programmed in any of high-level language such as:


• Java
• C
• Python
• C++

You should also know how to use IF statements, arrays and functions.

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
Why we need to learn assembly language?

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
Why we need to learn assembly language?

1. First ever language came before high-level Language, it the


base concept of high-level Languages
2. Learning Machine Language
3. Learning Compiler converting High-level Language to Low-
level Language
4. How Instructions like move, branch, add, sub, etc. are used
instead of IF Statements, LOOPS and Operations

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
Why we need to learn assembly language?

5. It is important to know how instructions work at hardware level


i.e. at low level
6. If we don’t learn assembly language, then Computer will be a
MAGIC BOX and never know how High-Level Language
statements are executed.

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
Why we need to learn assembly language?

Most Importantly,
We learn the basic need of Computer Architecture,
1. How a processor executes instruction?
2. Which is clock cycle?
3. Why data bus are used in Computer?
4. What is the reason to use Cache, RAM and Hard drives?

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
Why we need to learn assembly language?

May be someone of you want to be a developer of Compiler, or


you need to develop you own Computer

It is required for developing


1. Real-time applications 2. Computer gaming consoles
3. Operating Systems 4. Micro-architectures
5. Device Drivers 6. Printer manufacturers
and many more
BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad
Assembly Language
How does Assembly language relate to Machine Language?

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
How does Assembly language relate to Machine Language?

Machine Language is a numeric language specially understanding a


computer’s processor (i.e CPU)

Assembly Language consist of statements written with short mnemonics


such ADD, MOV, SUB and CALL

Assembly Language has a one-to-one relationship with machine language


Each assembly language instruction corresponds to a single machine
instruction

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
How do we relate C++ to Assembly Language?

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
How do we relate C++ to Assembly Language?

C++ has a one-to-many relationship with assembly language

A single statement in C++ expand into multiple assembly language or


machine instruction

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
How do we relate C++ to Assembly Language?

For example;
int x = (y + 4) * 3;

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
How do we relate C++ to Assembly Language?

For example;
int x = (y + 4) * 3;

mov eax, y ; move “y” to the “eax” register


add eax, 4 ; add “4” to the “eax” register
mov ebx, 3 ; move “3” to the “ebx” register
mul ebx ; multiply “ebx” by “eax”
mov x, eax ; mov “eax” to “x”

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad


Assembly Language
Is Assembly Language being Portable?

BS (CS) – COAL Dr. Muhammad Asfand-e-yar, Bahria University, Islamabad

You might also like