SlideShare une entreprise Scribd logo
1  sur  37
Assembly Language Instruction Addressing and Execution Motaz K. Saad Spring 2007 Motaz K. Saad, Dept. of CS
Lesson plan ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
Recalling main concepts Motaz K. Saad, Dept. of CS
Recalling main concepts Motaz K. Saad, Dept. of CS
Recalling main concepts ,[object Object],[object Object],Motaz K. Saad, Dept. of CS
Recalling main concepts Stack Segment Data Segment Code Segment SS DS CS Segment  Registers Motaz K. Saad, Dept. of CS
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
Types of programs ,[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
Loading *.exe program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
PSP Motaz K. Saad, Dept. of CS
Assembly directive to define memory model to use in the program . MODEL SMALL, .STACK .DATA MESSAGE DB "HELLO EVERYBODY! I AM LEARNING ASSEMBLY LANGUAGE!","$" .CODE MAIN PROC MOV AX, @DATA MOV DS,AX MOV AH,09 LEA DX,MESSAGE INT 21H MOV AX,4C00H INT 21H MAIN ENDP END MAIN Motaz K. Saad, Dept. of CS
Memory Model ,[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
Real and Protected mode Motaz K. Saad, Dept. of CS Real Mode  16-bit Protected Mode  32-bit Protected Mode  Segment base address   20-bit 24-bit, from  descriptor   32-bit, from  descriptor   Segment size (limit)  16-bit, 64K bytes (fixed)  16-bit, 1-64K bytes  20-bit, 1-1M bytes or 4K-4G bytes  Segment protection  no  yes  yes  Segment register  segment base address / 16  selector   selector
Protected mode ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
Booting process ,[object Object],[object Object],Motaz K. Saad, Dept. of CS cold boot Process of turning on a computer after it has been powered off completely warm boot Process of restarting a computer that is already powered on Also called a warm start
Booting process ,[object Object],processor BIOS hard disk CD-ROM drive (RAM) memory modules CMOS floppy disk drive Step 6 expansion cards Motaz K. Saad, Dept. of CS
How does a personal computer boot up? ,[object Object],[object Object],Motaz K. Saad, Dept. of CS
How does a personal computer boot up? ,[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
How does a personal computer boot up? ,[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
How does a personal computer boot up? ,[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
BIOS Boot process BIOS routine FFFF0H Interrupt  Vector Table BIOS Data  Areas Access  the bootstrap loader Check ports Initialize  devices Motaz K. Saad, Dept. of CS
BIOS Boot process ,[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
Assembly directive to define stack to use in the program . model small . STACK .DATA MESSAGE DB "HELLO EVERYBODY! I AM LEARNING ASSEMBLY LANGUAGE!","$" .CODE MAIN PROC MOV AX, @DATA MOV DS,AX MOV AH,09 LEA DX,MESSAGE INT 21H MOV AX,4C00H INT 21H MAIN ENDP END MAIN Motaz K. Saad, Dept. of CS
STACK ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
STACK ,[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
Lesson plan ,[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
Loading *.exe file Access *.exe from disk 256-byte  Program Segment Prefix  (PSP) on a paragraph boundary Store the program immediately following the PSP Load address of PSP in the DS & ES Load code segment in CS, set IP  Load address of the stack to SS, set SP Transfer control to the program for execution Motaz K. Saad, Dept. of CS
Loading *.exe file ,[object Object],[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
Practice 2B360H PSP Stack Segment Data Segment Code Segment Memory Motaz K. Saad, Dept. of CS
Practice 2B360H PSP Stack Segment Data Segment Code Segment Memory PSP  2B360H PSP size  100 H Offset  0H SS  2B460H (stored as 2B46) 2B46H SS Motaz K. Saad, Dept. of CS
Practice 2B360H PSP Stack Segment Data Segment Code Segment Memory 2B46H SS PSP  2B360H PSP size  100H Offset  30H     70H CS  2B500H (stored as 2B50) CS 2B50H Motaz K. Saad, Dept. of CS
Practice 2B360H PSP Stack Segment Data Segment Code Segment Memory 2B46H SS CS 2B50H 2B36H 2B36H DS ES SP 0030H Motaz K. Saad, Dept. of CS
Instruction Execution and Addressing ,[object Object],[object Object],[object Object],[object Object],Motaz K. Saad, Dept. of CS
Example 4AF0 CS 0013 IP   4AF13H   04B1 DS Motaz K. Saad, Dept. of CS CS segment address: 4AF00H IP offset:   0013H ________________________ + Instruction address:
Example 4AF0 CS 0013 IP   4AF13H A01200 Memory 04B1 DS Decode instruction: AO: MOV [0012] to AL Motaz K. Saad, Dept. of CS
Example 4AF0 CS 0013 IP   04B03H A01200 Memory 04B1 DS 04B22H Motaz K. Saad, Dept. of CS DS segment address:04B10H IP offset:   0012H ________________________ + Data address:
Example 4AF0 CS 0013 IP   04B03H A01200 1B Memory 04B1 DS 04B22 Data address: 04B22H Motaz K. Saad, Dept. of CS | 1B AX AX AH AL

Contenu connexe

Tendances

Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference InstructionsRabin BK
 
Assembly language (addition and subtraction)
Assembly language (addition and subtraction)Assembly language (addition and subtraction)
Assembly language (addition and subtraction)Muhammad Umar Farooq
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Bilal Amjad
 
Assembly Langauge Chap 1
Assembly Langauge Chap 1Assembly Langauge Chap 1
Assembly Langauge Chap 1warda aziz
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...Bilal Amjad
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly languageAhmed M. Abed
 
Assembly language (coal)
Assembly language (coal)Assembly language (coal)
Assembly language (coal)Hareem Aslam
 
Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)Bilal Amjad
 
8086 instructions
8086 instructions8086 instructions
8086 instructionsRavi Anand
 
Microprocessor 8086 instruction description
Microprocessor 8086 instruction descriptionMicroprocessor 8086 instruction description
Microprocessor 8086 instruction descriptionDheeraj Suri
 
Register Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceRegister Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceTransweb Global Inc
 
Computer registers
Computer registersComputer registers
Computer registersDeepikaT13
 
Solution manual of assembly language programming and organization of the ibm ...
Solution manual of assembly language programming and organization of the ibm ...Solution manual of assembly language programming and organization of the ibm ...
Solution manual of assembly language programming and organization of the ibm ...Tayeen Ahmed
 
Chapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registersChapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registerswarda aziz
 
8086 Microprocessor powerpoint
8086  Microprocessor  powerpoint8086  Microprocessor  powerpoint
8086 Microprocessor powerpointRandhir Kumar
 
Organization of the ibm personal computers
Organization of the ibm personal computersOrganization of the ibm personal computers
Organization of the ibm personal computerswarda aziz
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Bilal Amjad
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 

Tendances (20)

Registers
RegistersRegisters
Registers
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
 
Assembly language (addition and subtraction)
Assembly language (addition and subtraction)Assembly language (addition and subtraction)
Assembly language (addition and subtraction)
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
Assembly Langauge Chap 1
Assembly Langauge Chap 1Assembly Langauge Chap 1
Assembly Langauge Chap 1
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 8 (The Stack and...
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
 
Assembly language (coal)
Assembly language (coal)Assembly language (coal)
Assembly language (coal)
 
Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)
 
8086 instructions
8086 instructions8086 instructions
8086 instructions
 
Microprocessor 8086 instruction description
Microprocessor 8086 instruction descriptionMicroprocessor 8086 instruction description
Microprocessor 8086 instruction description
 
Register Reference Instructions | Computer Science
Register Reference Instructions | Computer ScienceRegister Reference Instructions | Computer Science
Register Reference Instructions | Computer Science
 
Memory mapping
Memory mappingMemory mapping
Memory mapping
 
Computer registers
Computer registersComputer registers
Computer registers
 
Solution manual of assembly language programming and organization of the ibm ...
Solution manual of assembly language programming and organization of the ibm ...Solution manual of assembly language programming and organization of the ibm ...
Solution manual of assembly language programming and organization of the ibm ...
 
Chapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registersChapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registers
 
8086 Microprocessor powerpoint
8086  Microprocessor  powerpoint8086  Microprocessor  powerpoint
8086 Microprocessor powerpoint
 
Organization of the ibm personal computers
Organization of the ibm personal computersOrganization of the ibm personal computers
Organization of the ibm personal computers
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 

Similaire à Assembly Language Lecture 1

Instruction addressing and execution
Instruction addressing and executionInstruction addressing and execution
Instruction addressing and executionSilvia
 
The x86 Family
The x86 FamilyThe x86 Family
The x86 FamilyMotaz Saad
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly LanguageAhmed M. Abed
 
Assembly Language Lecture 2
Assembly Language Lecture 2Assembly Language Lecture 2
Assembly Language Lecture 2Motaz Saad
 
Computer Hardware & Software Lab Manual 2
Computer Hardware & Software Lab Manual 2Computer Hardware & Software Lab Manual 2
Computer Hardware & Software Lab Manual 2senayteklay
 
C Dos Bas
C Dos BasC Dos Bas
C Dos BasCTIN
 
Buffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackBuffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackTomer Zait
 
Session01_Intro.pdf
Session01_Intro.pdfSession01_Intro.pdf
Session01_Intro.pdfRahnerJames
 
8086 MICROPROCESSOR
8086 MICROPROCESSOR8086 MICROPROCESSOR
8086 MICROPROCESSORAlxus Shuvo
 
Rapid Prototyping with AWS IoT and Mongoose OS on ESP32 Platform
Rapid Prototyping with AWS IoT and Mongoose OS on ESP32 PlatformRapid Prototyping with AWS IoT and Mongoose OS on ESP32 Platform
Rapid Prototyping with AWS IoT and Mongoose OS on ESP32 PlatformAmazon Web Services
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)Ashim Saha
 
Bnt202 understanding pc & trouble shooting
Bnt202 understanding pc & trouble shootingBnt202 understanding pc & trouble shooting
Bnt202 understanding pc & trouble shootingsmumbahelp
 
Keyboard interrupt
Keyboard interruptKeyboard interrupt
Keyboard interruptTech_MX
 

Similaire à Assembly Language Lecture 1 (20)

Instruction addressing and execution
Instruction addressing and executionInstruction addressing and execution
Instruction addressing and execution
 
The x86 Family
The x86 FamilyThe x86 Family
The x86 Family
 
MASM.pptx
MASM.pptxMASM.pptx
MASM.pptx
 
IMD 203 - Ch06
IMD 203 - Ch06IMD 203 - Ch06
IMD 203 - Ch06
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly Language
 
Assembly Language Lecture 2
Assembly Language Lecture 2Assembly Language Lecture 2
Assembly Language Lecture 2
 
Computer Hardware & Software Lab Manual 2
Computer Hardware & Software Lab Manual 2Computer Hardware & Software Lab Manual 2
Computer Hardware & Software Lab Manual 2
 
Project eprom progr
Project eprom progrProject eprom progr
Project eprom progr
 
C Dos Bas
C Dos BasC Dos Bas
C Dos Bas
 
Buffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackBuffer overflow – Smashing The Stack
Buffer overflow – Smashing The Stack
 
Chapter 3 programming concepts-ii
Chapter 3  programming concepts-iiChapter 3  programming concepts-ii
Chapter 3 programming concepts-ii
 
Session01_Intro.pdf
Session01_Intro.pdfSession01_Intro.pdf
Session01_Intro.pdf
 
ROM BIOS & POST
ROM BIOS & POSTROM BIOS & POST
ROM BIOS & POST
 
ROM BIOS & POST
ROM BIOS & POSTROM BIOS & POST
ROM BIOS & POST
 
8086 MICROPROCESSOR
8086 MICROPROCESSOR8086 MICROPROCESSOR
8086 MICROPROCESSOR
 
Rapid Prototyping with AWS IoT and Mongoose OS on ESP32 Platform
Rapid Prototyping with AWS IoT and Mongoose OS on ESP32 PlatformRapid Prototyping with AWS IoT and Mongoose OS on ESP32 Platform
Rapid Prototyping with AWS IoT and Mongoose OS on ESP32 Platform
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)
 
Mp &mc programs
Mp &mc programsMp &mc programs
Mp &mc programs
 
Bnt202 understanding pc & trouble shooting
Bnt202 understanding pc & trouble shootingBnt202 understanding pc & trouble shooting
Bnt202 understanding pc & trouble shooting
 
Keyboard interrupt
Keyboard interruptKeyboard interrupt
Keyboard interrupt
 

Plus de Motaz Saad

Cross Language Concept Mining
Cross Language Concept Mining Cross Language Concept Mining
Cross Language Concept Mining Motaz Saad
 
Hewahi, saad 2006 - class outliers mining distance-based approach
Hewahi, saad   2006 - class outliers mining distance-based approachHewahi, saad   2006 - class outliers mining distance-based approach
Hewahi, saad 2006 - class outliers mining distance-based approachMotaz Saad
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignMotaz Saad
 
Open Source Business Models
Open Source Business ModelsOpen Source Business Models
Open Source Business ModelsMotaz Saad
 
OS Lab: Introduction to Linux
OS Lab: Introduction to LinuxOS Lab: Introduction to Linux
OS Lab: Introduction to LinuxMotaz Saad
 
Introduction to CLIPS Expert System
Introduction to CLIPS Expert SystemIntroduction to CLIPS Expert System
Introduction to CLIPS Expert SystemMotaz Saad
 
Intel 64bit Architecture
Intel 64bit ArchitectureIntel 64bit Architecture
Intel 64bit ArchitectureMotaz Saad
 
Assembly Language Lecture 5
Assembly Language Lecture 5Assembly Language Lecture 5
Assembly Language Lecture 5Motaz Saad
 
Assembly Language Lecture 3
Assembly Language Lecture 3Assembly Language Lecture 3
Assembly Language Lecture 3Motaz Saad
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly LanguageMotaz Saad
 
Class Outlier Mining
Class Outlier MiningClass Outlier Mining
Class Outlier MiningMotaz Saad
 
Browsing The Source Code of Linux Packages
Browsing The Source Code of Linux PackagesBrowsing The Source Code of Linux Packages
Browsing The Source Code of Linux PackagesMotaz Saad
 
مقدمة في تكنواوجيا المعلومات
مقدمة في تكنواوجيا المعلوماتمقدمة في تكنواوجيا المعلومات
مقدمة في تكنواوجيا المعلوماتMotaz Saad
 
Data Mining and Business Intelligence Tools
Data Mining and Business Intelligence ToolsData Mining and Business Intelligence Tools
Data Mining and Business Intelligence ToolsMotaz Saad
 
Browsing Linux Kernel Source
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel SourceMotaz Saad
 

Plus de Motaz Saad (15)

Cross Language Concept Mining
Cross Language Concept Mining Cross Language Concept Mining
Cross Language Concept Mining
 
Hewahi, saad 2006 - class outliers mining distance-based approach
Hewahi, saad   2006 - class outliers mining distance-based approachHewahi, saad   2006 - class outliers mining distance-based approach
Hewahi, saad 2006 - class outliers mining distance-based approach
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and Design
 
Open Source Business Models
Open Source Business ModelsOpen Source Business Models
Open Source Business Models
 
OS Lab: Introduction to Linux
OS Lab: Introduction to LinuxOS Lab: Introduction to Linux
OS Lab: Introduction to Linux
 
Introduction to CLIPS Expert System
Introduction to CLIPS Expert SystemIntroduction to CLIPS Expert System
Introduction to CLIPS Expert System
 
Intel 64bit Architecture
Intel 64bit ArchitectureIntel 64bit Architecture
Intel 64bit Architecture
 
Assembly Language Lecture 5
Assembly Language Lecture 5Assembly Language Lecture 5
Assembly Language Lecture 5
 
Assembly Language Lecture 3
Assembly Language Lecture 3Assembly Language Lecture 3
Assembly Language Lecture 3
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly Language
 
Class Outlier Mining
Class Outlier MiningClass Outlier Mining
Class Outlier Mining
 
Browsing The Source Code of Linux Packages
Browsing The Source Code of Linux PackagesBrowsing The Source Code of Linux Packages
Browsing The Source Code of Linux Packages
 
مقدمة في تكنواوجيا المعلومات
مقدمة في تكنواوجيا المعلوماتمقدمة في تكنواوجيا المعلومات
مقدمة في تكنواوجيا المعلومات
 
Data Mining and Business Intelligence Tools
Data Mining and Business Intelligence ToolsData Mining and Business Intelligence Tools
Data Mining and Business Intelligence Tools
 
Browsing Linux Kernel Source
Browsing Linux Kernel SourceBrowsing Linux Kernel Source
Browsing Linux Kernel Source
 

Dernier

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Assembly Language Lecture 1

  • 1. Assembly Language Instruction Addressing and Execution Motaz K. Saad Spring 2007 Motaz K. Saad, Dept. of CS
  • 2.
  • 3. Recalling main concepts Motaz K. Saad, Dept. of CS
  • 4. Recalling main concepts Motaz K. Saad, Dept. of CS
  • 5.
  • 6. Recalling main concepts Stack Segment Data Segment Code Segment SS DS CS Segment Registers Motaz K. Saad, Dept. of CS
  • 7.
  • 8.
  • 9.
  • 10. PSP Motaz K. Saad, Dept. of CS
  • 11. Assembly directive to define memory model to use in the program . MODEL SMALL, .STACK .DATA MESSAGE DB "HELLO EVERYBODY! I AM LEARNING ASSEMBLY LANGUAGE!","$" .CODE MAIN PROC MOV AX, @DATA MOV DS,AX MOV AH,09 LEA DX,MESSAGE INT 21H MOV AX,4C00H INT 21H MAIN ENDP END MAIN Motaz K. Saad, Dept. of CS
  • 12.
  • 13. Real and Protected mode Motaz K. Saad, Dept. of CS Real Mode 16-bit Protected Mode 32-bit Protected Mode Segment base address 20-bit 24-bit, from descriptor 32-bit, from descriptor Segment size (limit) 16-bit, 64K bytes (fixed) 16-bit, 1-64K bytes 20-bit, 1-1M bytes or 4K-4G bytes Segment protection no yes yes Segment register segment base address / 16 selector selector
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. BIOS Boot process BIOS routine FFFF0H Interrupt Vector Table BIOS Data Areas Access the bootstrap loader Check ports Initialize devices Motaz K. Saad, Dept. of CS
  • 22.
  • 23. Assembly directive to define stack to use in the program . model small . STACK .DATA MESSAGE DB "HELLO EVERYBODY! I AM LEARNING ASSEMBLY LANGUAGE!","$" .CODE MAIN PROC MOV AX, @DATA MOV DS,AX MOV AH,09 LEA DX,MESSAGE INT 21H MOV AX,4C00H INT 21H MAIN ENDP END MAIN Motaz K. Saad, Dept. of CS
  • 24.
  • 25.
  • 26.
  • 27. Loading *.exe file Access *.exe from disk 256-byte Program Segment Prefix (PSP) on a paragraph boundary Store the program immediately following the PSP Load address of PSP in the DS & ES Load code segment in CS, set IP Load address of the stack to SS, set SP Transfer control to the program for execution Motaz K. Saad, Dept. of CS
  • 28.
  • 29. Practice 2B360H PSP Stack Segment Data Segment Code Segment Memory Motaz K. Saad, Dept. of CS
  • 30. Practice 2B360H PSP Stack Segment Data Segment Code Segment Memory PSP 2B360H PSP size 100 H Offset 0H SS 2B460H (stored as 2B46) 2B46H SS Motaz K. Saad, Dept. of CS
  • 31. Practice 2B360H PSP Stack Segment Data Segment Code Segment Memory 2B46H SS PSP 2B360H PSP size 100H Offset 30H 70H CS 2B500H (stored as 2B50) CS 2B50H Motaz K. Saad, Dept. of CS
  • 32. Practice 2B360H PSP Stack Segment Data Segment Code Segment Memory 2B46H SS CS 2B50H 2B36H 2B36H DS ES SP 0030H Motaz K. Saad, Dept. of CS
  • 33.
  • 34. Example 4AF0 CS 0013 IP 4AF13H 04B1 DS Motaz K. Saad, Dept. of CS CS segment address: 4AF00H IP offset: 0013H ________________________ + Instruction address:
  • 35. Example 4AF0 CS 0013 IP 4AF13H A01200 Memory 04B1 DS Decode instruction: AO: MOV [0012] to AL Motaz K. Saad, Dept. of CS
  • 36. Example 4AF0 CS 0013 IP 04B03H A01200 Memory 04B1 DS 04B22H Motaz K. Saad, Dept. of CS DS segment address:04B10H IP offset: 0012H ________________________ + Data address:
  • 37. Example 4AF0 CS 0013 IP 04B03H A01200 1B Memory 04B1 DS 04B22 Data address: 04B22H Motaz K. Saad, Dept. of CS | 1B AX AX AH AL