Lecture 1
Lecture 1
Lecture 1
Assembly Language
Instructor: Asra Ashraf
[email protected]
Lecture 1
1
Outline
2
Course Information
• EE213 – Computer Organization and Assembly
Language (COAL)
• 3 + 1 Credit Hours
• 2 Lectures every week
• 3 hours of Lab work every week
• Pre Req. EE109 – CLD
3
Recommended Books
• Text Book(s)
– Assembly Language for x86 Processors by Kip R. Irvine
6th edition
– Computer Organization and Architecture by William
Stallings 9th edition
• Reference Book(s)
– Fundamentals of Computer Organization and
Architecture by Mostafa Abd- El- Barr
– Any other reference material will be provided through
slate
4
Marks Distribution
5
Attendance Policy
• In order to appear in final exam, 80% attendance is
must, and there will be zero tolerance on attendance
• Attendance will be called at the start of every class
and you will be marked as absent if you are more
than 10 minutes late
• Only excuses obtained officially are accepted.
Personal excuses are not accepted. No make-up
tests/quizzes/exams will be provided until instructed
by academic committee
6
General Guidelines
• Quizzes can be unannounced
• The environment of class will be friendly but
we have to respect the environment of the
class
• You are free to ask relevant questions during
the lecture
• Use of mobile phones/tablets/laptops is strictly
not allowed
• There will be no extension in the deadlines
7
Lets Start the Course
8
Why to Learn COAL?
• To Complete the Degree?
• There are many reasons and advantages to learn COAL
• Significance of Computer Organization
– How exactly each instruction is executed at the micro level
– Data flow
– Timing analysis
– Memory hierarchy
– Trade offs between execution cycles
– Hardware requirements/costs
– Software-hardware trade-offs
• All above are possible if you know about computer
organization
9
Why to Learn COAL?
• Significance of Assembly Language
– Accessibility to system hardware
• Assembly Language is useful for implementing system software
• Also useful for small embedded system applications
10
Difference between Computer
Organization & Computer Architecture
• Computer Architecture
– Computer Architecture is abstract model and are
those attributes that are visible to programmer
like instructions set, no of bits used for data,
addressing techniques
• Computer Organization
– A computer's organization expresses the realization of the
architecture. OR how features are implemented like these
registers ,those data paths or this connection to memory.
Contents of CO are ALU, CPU and memory organizations
11
Difference between Computer
Organization & Computer Architecture
•
• Computer Architecture Computer Organization
13
High Level Languages
• Called High Level because closer to human
language and farther from machine language
• Independent of a particular type of processor
• Easier to read, write and understand because
uses natural language elements
• Hides implementation details
• Must be translated to machine language
• C++, Jave, Python, Php etc
14
Assembly Language
• Low level programming language
• Used to interact with computer hardware
• Specific to a particular computer architecture
• Focuses on programming microprocessors
• Used to program
– Embedded system
– Device driver programming
– Computer viruses and boot loaders
15
Machine Language
• Lowest level programming language
• Sequence of 1s and 0s
• Easily understood by computers
• Almost impossible for humans to use
• Each CPU has its own unique machine
language
16
Low Level, High Level and Machine Languages
Application Programs
Machine specific
Low-Level Language
Assembly Language
Machine Language
Hardware
17
Conversion from High Level (HL) to
Low Level (LL) Language
• From Assembly to Machine
Language
– Assembler is used
• From High Level to Machine
Level Language
– Compiler converts High Level
Language to Object Code
– Assembler is used to convert
Assembly Language code to
Machine Code
18
Compiler and Assembler
19
Translation Between Computer
Languages
• Add 2 and 4 and store the result in a variable “a”
High Level
Language
Assembly
Language
Machine
Language
20
Advantages of High Level Languages
• Program development is faster
– High-level statements: fewer instructions to code
21
Assembly Language Programming Tools
• Editor
– Allows you to create and edit assembly language source
files
• Assembler
– Converts assembly language programs into object files
– Object files contain the machine instructions
• Linker
– Combines object files created by the assembler with link
libraries
– Produces a single executable program
• Debugger
– Allows you to trace the execution of a program
– Allows you to view machine instructions, memory, and 22
Assemble and Link Process
Source Object
File Assembler File
Link
Source Object
Assembler Libraries
File File