SlideShare a Scribd company logo
1 of 59
Download to read offline
I. INTRODUCTION
Microcomputer Systems:
Basic Computer Organization
The Basic Organization of a Microcomputer



                  CPU

                   CU

   INPUT
                 REGISTER        MEMORY
                   FILE
   OUTPUT



                   ALU
Von Neumann’s Simple Computer



                    CPU

                    CU

   INPUT       PC        MAR
                                MEMORY
               IR        MBR
   OUTPUT
                     A



                    ALU
The Fetch-Decode-Execute Cycle

 1. Get the instruction from the memory
    using the address contained in PC.
 2. Put the instruction into IR.
 3. Increment the value in PC.
 4. Decode the value in IR.
 5. Execute the operation specified in the
    instruction.
 6. Repeat step number 1.
Quiz


              CPU        MEMORY   address

              CU
                         inst 1    001
  INPUT                  inst 2    002
            PC = ?
                         inst 3    003
  OUTPUT   IR = inst 1
                          ...      004



              ALU
I. INTRODUCTION

Assembly Programming Process
Outline



   1. Assembly Programming Environment

   2. Number Systems Conversion

   3. Developing Assembly Programs
Assembly Programming Environment

  Assembler
    – a computer program for translating
      assembly language (a mnemonic
      representation of machine language)
      into object code.
    – TASM, MASM, NASM
Assembly Programming Environment

  Linker
    – a program that combines libraries
      (modules) together to form an
      executable file
    – TLINK, MLINK, ALINK, LD
Assembly Programming Environment

  Disassembler
    – a computer program which translates
      machine language into assembly
      language, performing the inverse
      operation to that of an assembler.
High-level PL to Executable Programs


   HIGH-LEVEL LANGUAGE
     (Program Code File)   OBJECT CODE + LIBRARIES




          COMPILER                  LINKER




   MACHINE LANGUAGE         MACHINE LANGUAGE
    (Object Code File)       (Executable File)
Assembly to Executable Programs


   ASSEMBLY LANGUAGE
    (Program Code File)   OBJECT CODE + LIBRARIES




         ASSEMBLER                 LINKER




   MACHINE LANGUAGE        MACHINE LANGUAGE
    (Object Code File)      (Executable File)
Assembly Programming Environment

 32-bit Assembly Programming
  x86 machine instructions

 Linux
  Use Linux services and system calls
Executing Assembly Programs

 nasm –f elf <file>.asm
  produces <file>.o

 ld -o <file> <file>.o
  produces <file>.exe

 ./<file>
  run <file>
Review

  Number Systems Conversion
Binary to Decimal



 Binary         0    0     1   0   0   1   1   0


                         Decimal
     Hex


  Decimal

            Binary
Binary to Decimal

              128 64 32 16 8           4   2   1
 Binary         0    0     1   0   0   1   1   0


                         Decimal
     Hex


  Decimal

            Binary
Binary to Decimal

              128 64 32 16 8           4   2   1
 Binary         0    0     1   0   0   1   1   0


                         Decimal       3   8
     Hex


  Decimal

            Binary
Decimal to Binary

              128 64 32 16 8         4   2   1
 Binary         0    0   0   1   1   0   0   0


                     Decimal
     Hex


  Decimal

            Binary
Decimal to Binary

              128 64 32 16 8         4   2   1
 Binary         0    0   0   1   1   0   0   0


                     Decimal         2   4
     Hex


  Decimal

            Binary
Binary to Decimal

              128 64 32 16     8 4   2   1
 Binary



                     Decimal    5    7
     Hex


  Decimal

            Binary
Binary to Decimal

              128 64 32 16       8 4     2   1
 Binary         0    0   1   1   1   0   0   1


                     Decimal         5   7
     Hex


  Decimal

            Binary
Decimal to Binary

              128 64 32 16 8 4           2   1
 Binary         1    0   0   0   0   0   1   1


                 Decimal
     Hex


  Decimal

            Binary
Decimal to Binary

              128 64 32 16 8 4               2   1
 Binary         1    0   0   0   0   0       1   1


                 Decimal         1       3
     Hex                                         1
  Decimal

            Binary
Decimal to Binary

              128 64 32 16   8 4       2   1
 Binary



                 Decimal     1     5
     Hex                                   0
  Decimal

            Binary
Decimal to Binary

              128 64 32 16       8 4         2   1
 Binary         1    0   0   1   0   1       1   0


                 Decimal         1       5
     Hex                                         0
  Decimal

            Binary
Binary to Hexadecimal



 Binary         0     0   1   0    0   1   1   0


                     Hexadecimal
     Hex


  Decimal

            Binary
Binary to Hexadecimal

                8     4   2   1    8   4   2   1
 Binary         0     0   1   0    0   1   1   0


                     Hexadecimal
     Hex


  Decimal

            Binary
Binary to Hexadecimal

                8     4   2   1    8   4       2   1
 Binary         0     0   1   0    0   1       1   0


                     Hexadecimal           2       6
     Hex


  Decimal

            Binary
Binary to Hexadecimal

                8      4   2   1   8   4   2   1
  Binary        0      0   1   1   1   0   1   1


                     Hexadecimal
     Hex


  Decimal

            Binary
Binary to Hexadecimal

                8      4   2   1   8   4       2   1
  Binary        0      0   1   1   1   0       1   1


                     Hexadecimal           3       B
     Hex


  Decimal

            Binary
Hexadecimal to Binary

                8      4   2   1   8   4       2   1
  Binary



                     Hexadecimal           F       4
     Hex


  Decimal

            Binary
Hexadecimal to Binary

                8      4   2   1   8   4       2   1
  Binary        1      1   1   1   0   1       0   0


                     Hexadecimal           F       4
     Hex


  Decimal

            Binary
Hexadecimal to Binary

  Binary
   8 4       2 1     8   4 2   1 8   4   2   1




     Hex
             Hexadecimal        1    3       1
  Decimal

            Binary
Hexadecimal to Binary

  Binary
   8 4          2 1     8   4 2     1 8     4   2   1
   0       0    0   1   0   0   1   1   0   0   0   1


     Hex
                Hexadecimal             1   3       1
  Decimal

               Binary
I. INTRODUCTION
Developing Assembly Language
Programs
Objectives

 At the end of this section, we should be able
   to:
  Discuss the parts of an assembly program
  Develop a simple assembly program
   implementing basic input/output and other
   sequential statements
The 32-bit Registers

   General Purpose Registers
    – EAX – Accumulator
    – EBX – Base
    – ECX – Counter
    – EDX – Data
The 32-bit Registers

   Segment Registers (16 bits)
     – CS – Code Segment
     – DS, ES, FS, GS – Data Segment
     – SS – Stack Segment

   Index Registers
     – ESI – Source Index
     – EDI – Destination Index
The 32-bit Registers

   Pointer Registers
     – EBP – Base Pointer
     – ESP – Stack Pointer

   EIP – Instruction Pointer (a.k.a. PC)
   eFlags – Flag Registers
Parts of an Assembly Program

  Section .data             Section .text
   initialized variables    instructions
                             program code
  Section .bss
   unintialized
    variables
Parts of an Assembly Program




                          Data Segment




                          Code Segment
Segments and Segment Registers


      CS
                   CODE
      DS
                   DATA

                   BSS     USER
                           PROGRAM



      SS           STACK

   SEGMENT
   REGISTERS
Data and Data Types

 High-level Programming Languages
  numeric
    – signed integer
    – unsigned integer
    – float or real
  non-numeric
    – characters and strings
    – boolean
    – sets
Data and Data Types

 Computers
  only know numbers (bits)
  data types are human abstractions
  data types depend on size of data and
   human interpretation
Instructions and Directives

  Instructions
   tell processor what to do
   assembled into machine code by
    assembler
   executed at runtime by the processor
   from the Intel x86 instruction set
Instructions and Directives

  Directives
   tell assembler what to do
   commands that are recognized and
    acted upon by the assembler
   not part of the instruction set
   used to declare code and data areas,
    define constants and memory for storage
   different assemblers have different
    directives
Assembler Directives

 EQU directive
  defines constants
    – label   equ value
    – count equ 100

  Data definition directive
   defines memory for data storage
   defines size of data
Assembler Directives

 Initialized Data
  db – define byte
  dw – define word
  dd – define double

   – label       directive   initial value
   – int         db          0
   – num         dw          100
Assembler Directives

 Character constants
  single quote delimited
  ‘A’

   – char   db   ‘!’
Assembler Directives

 String constants
  single quote delimited or sequence of
    characters separated by commas
  each character is one byte each
  ‘hello’
  ‘h’, ’e’, ’l’, ’l’, ’o’

   – prompt1    db    ‘Please enter number: ’
   – prompt2    db    ‘Please enter number: ’,10
Assembler Directives




                       Declarations
Assembler Directives

 Uninitialized Data
  resb – reserve byte
  resw – reserve word
  resd – reserve double word

   – label   directive   value
   – num     resb        1     ; reserves 1 byte
   – nums    resb        10    ; reserves 10 bytes
Assembler Directives




                       Uninitialized
                       variables
Assembly Instructions

 Basic Format
   instruction operand1, operand2

 Operand
  Register
  Immediate
  Memory
Instruction Operands

 Register
  eax, ax, ah, al
  ebx, bx, bh, bl
  ecx, cx, ch, cl
  edx, dx, dh, dl
Instruction Operands

 Immediate
  character constants
    – character symbols enclosed in quotes
    – character ASCII code
  integer constants
    – begin with a number
    – ends with base modifier (B, O or H)
  ‘A’ = 65 = 41H = 01000001B
Instruction Operands

 Memory
  when using the value of a variable,
   enclose the variable name in square
   brackets
  [num]    -    value of num
  num      -    address of num
Instruction Operands

  If the operands are registers or
   memory locations, they must be of
   the same type.
  Two memory operands are not
   allowed in the instruction.

More Related Content

Similar to Chapter1b

Memory ECC - The Comprehensive of SEC-DED.
Memory ECC - The Comprehensive of SEC-DED. Memory ECC - The Comprehensive of SEC-DED.
Memory ECC - The Comprehensive of SEC-DED. Sk Cheah
 
Block Cipher.cryptography_miu_year5.pptx
Block Cipher.cryptography_miu_year5.pptxBlock Cipher.cryptography_miu_year5.pptx
Block Cipher.cryptography_miu_year5.pptxHodaAhmedBekhitAhmed
 
Decimal To Hexadecimal Conversion Tips
Decimal To Hexadecimal Conversion TipsDecimal To Hexadecimal Conversion Tips
Decimal To Hexadecimal Conversion TipsKathleenSSmith
 
Topic4 data encryption standard(des)
Topic4 data encryption standard(des)Topic4 data encryption standard(des)
Topic4 data encryption standard(des)MdFazleRabbi18
 
AES by example
AES by exampleAES by example
AES by exampleShiraz316
 
MaskedVByte: SIMD-accelerated VByte
MaskedVByte: SIMD-accelerated VByteMaskedVByte: SIMD-accelerated VByte
MaskedVByte: SIMD-accelerated VByteDaniel Lemire
 
Learning&Teaching Systems Ppt
Learning&Teaching Systems PptLearning&Teaching Systems Ppt
Learning&Teaching Systems Pptekul
 
Learning& Teaching Systems Ppt
Learning& Teaching  Systems PptLearning& Teaching  Systems Ppt
Learning& Teaching Systems PptNaruin
 
Learning&Teaching Systems Ppt
Learning&Teaching Systems PptLearning&Teaching Systems Ppt
Learning&Teaching Systems PptKyle
 
International Journal of Computational Engineering Research(IJCER)
 International Journal of Computational Engineering Research(IJCER)  International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER) ijceronline
 
Computer Systems
Computer SystemsComputer Systems
Computer Systemsdrs
 
New Computer Systems
New Computer SystemsNew Computer Systems
New Computer Systemsmrsmackenzie
 
Binary code - Beginning
Binary code - BeginningBinary code - Beginning
Binary code - BeginningDebbie Eitner
 
block ciphers
block ciphersblock ciphers
block ciphersAsad Ali
 
digital electronics nuMBER SYSTEM jjj.pptx
digital electronics nuMBER SYSTEM jjj.pptxdigital electronics nuMBER SYSTEM jjj.pptx
digital electronics nuMBER SYSTEM jjj.pptxBEENAHASSINA1
 
Embedding Languages Without Breaking Tools
Embedding Languages Without Breaking ToolsEmbedding Languages Without Breaking Tools
Embedding Languages Without Breaking ToolsLukas Renggli
 
Expl net fund_chapter_06_i_pv4_part_1
Expl net fund_chapter_06_i_pv4_part_1Expl net fund_chapter_06_i_pv4_part_1
Expl net fund_chapter_06_i_pv4_part_1kurtmctaggart
 

Similar to Chapter1b (20)

Memory ECC - The Comprehensive of SEC-DED.
Memory ECC - The Comprehensive of SEC-DED. Memory ECC - The Comprehensive of SEC-DED.
Memory ECC - The Comprehensive of SEC-DED.
 
Block Cipher.cryptography_miu_year5.pptx
Block Cipher.cryptography_miu_year5.pptxBlock Cipher.cryptography_miu_year5.pptx
Block Cipher.cryptography_miu_year5.pptx
 
Decimal To Hexadecimal Conversion Tips
Decimal To Hexadecimal Conversion TipsDecimal To Hexadecimal Conversion Tips
Decimal To Hexadecimal Conversion Tips
 
IDEA.ppt
IDEA.pptIDEA.ppt
IDEA.ppt
 
Digital Electronics Codes.pdf
Digital Electronics Codes.pdfDigital Electronics Codes.pdf
Digital Electronics Codes.pdf
 
Topic4 data encryption standard(des)
Topic4 data encryption standard(des)Topic4 data encryption standard(des)
Topic4 data encryption standard(des)
 
AES by example
AES by exampleAES by example
AES by example
 
MaskedVByte: SIMD-accelerated VByte
MaskedVByte: SIMD-accelerated VByteMaskedVByte: SIMD-accelerated VByte
MaskedVByte: SIMD-accelerated VByte
 
Learning&Teaching Systems Ppt
Learning&Teaching Systems PptLearning&Teaching Systems Ppt
Learning&Teaching Systems Ppt
 
Learning& Teaching Systems Ppt
Learning& Teaching  Systems PptLearning& Teaching  Systems Ppt
Learning& Teaching Systems Ppt
 
Learning&Teaching Systems Ppt
Learning&Teaching Systems PptLearning&Teaching Systems Ppt
Learning&Teaching Systems Ppt
 
International Journal of Computational Engineering Research(IJCER)
 International Journal of Computational Engineering Research(IJCER)  International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Computer Systems
Computer SystemsComputer Systems
Computer Systems
 
New Computer Systems
New Computer SystemsNew Computer Systems
New Computer Systems
 
Representation of Positive Numbers
Representation of Positive NumbersRepresentation of Positive Numbers
Representation of Positive Numbers
 
Binary code - Beginning
Binary code - BeginningBinary code - Beginning
Binary code - Beginning
 
block ciphers
block ciphersblock ciphers
block ciphers
 
digital electronics nuMBER SYSTEM jjj.pptx
digital electronics nuMBER SYSTEM jjj.pptxdigital electronics nuMBER SYSTEM jjj.pptx
digital electronics nuMBER SYSTEM jjj.pptx
 
Embedding Languages Without Breaking Tools
Embedding Languages Without Breaking ToolsEmbedding Languages Without Breaking Tools
Embedding Languages Without Breaking Tools
 
Expl net fund_chapter_06_i_pv4_part_1
Expl net fund_chapter_06_i_pv4_part_1Expl net fund_chapter_06_i_pv4_part_1
Expl net fund_chapter_06_i_pv4_part_1
 

More from MaeEstherMaguadMaralit (14)

Chapter2c
Chapter2cChapter2c
Chapter2c
 
Chapter2b
Chapter2bChapter2b
Chapter2b
 
Chapter2a
Chapter2aChapter2a
Chapter2a
 
Chapter1c
Chapter1cChapter1c
Chapter1c
 
Chapter1a
Chapter1aChapter1a
Chapter1a
 
linked list (CMSC 123)
linked list (CMSC 123)linked list (CMSC 123)
linked list (CMSC 123)
 
HTTP
HTTPHTTP
HTTP
 
The lovedare
The lovedareThe lovedare
The lovedare
 
Cmsc 100 (web content)
Cmsc 100  (web content)Cmsc 100  (web content)
Cmsc 100 (web content)
 
Cmsc 100 (web forms)
Cmsc 100 (web forms)Cmsc 100 (web forms)
Cmsc 100 (web forms)
 
Cmsc 100 xhtml and css
Cmsc 100 xhtml and cssCmsc 100 xhtml and css
Cmsc 100 xhtml and css
 
Cmsc 100 (web programming in a nutshell)
Cmsc 100 (web programming in a nutshell)Cmsc 100 (web programming in a nutshell)
Cmsc 100 (web programming in a nutshell)
 
Chapter2a
Chapter2aChapter2a
Chapter2a
 
Chapter1b
Chapter1bChapter1b
Chapter1b
 

Recently uploaded

Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 

Recently uploaded (20)

Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 

Chapter1b

  • 2. The Basic Organization of a Microcomputer CPU CU INPUT REGISTER MEMORY FILE OUTPUT ALU
  • 3. Von Neumann’s Simple Computer CPU CU INPUT PC MAR MEMORY IR MBR OUTPUT A ALU
  • 4. The Fetch-Decode-Execute Cycle 1. Get the instruction from the memory using the address contained in PC. 2. Put the instruction into IR. 3. Increment the value in PC. 4. Decode the value in IR. 5. Execute the operation specified in the instruction. 6. Repeat step number 1.
  • 5. Quiz CPU MEMORY address CU inst 1 001 INPUT inst 2 002 PC = ? inst 3 003 OUTPUT IR = inst 1 ... 004 ALU
  • 7. Outline 1. Assembly Programming Environment 2. Number Systems Conversion 3. Developing Assembly Programs
  • 8. Assembly Programming Environment  Assembler – a computer program for translating assembly language (a mnemonic representation of machine language) into object code. – TASM, MASM, NASM
  • 9. Assembly Programming Environment  Linker – a program that combines libraries (modules) together to form an executable file – TLINK, MLINK, ALINK, LD
  • 10. Assembly Programming Environment  Disassembler – a computer program which translates machine language into assembly language, performing the inverse operation to that of an assembler.
  • 11. High-level PL to Executable Programs HIGH-LEVEL LANGUAGE (Program Code File) OBJECT CODE + LIBRARIES COMPILER LINKER MACHINE LANGUAGE MACHINE LANGUAGE (Object Code File) (Executable File)
  • 12. Assembly to Executable Programs ASSEMBLY LANGUAGE (Program Code File) OBJECT CODE + LIBRARIES ASSEMBLER LINKER MACHINE LANGUAGE MACHINE LANGUAGE (Object Code File) (Executable File)
  • 13. Assembly Programming Environment 32-bit Assembly Programming  x86 machine instructions Linux  Use Linux services and system calls
  • 14. Executing Assembly Programs nasm –f elf <file>.asm  produces <file>.o ld -o <file> <file>.o  produces <file>.exe ./<file>  run <file>
  • 15. Review  Number Systems Conversion
  • 16. Binary to Decimal Binary 0 0 1 0 0 1 1 0 Decimal Hex Decimal Binary
  • 17. Binary to Decimal 128 64 32 16 8 4 2 1 Binary 0 0 1 0 0 1 1 0 Decimal Hex Decimal Binary
  • 18. Binary to Decimal 128 64 32 16 8 4 2 1 Binary 0 0 1 0 0 1 1 0 Decimal 3 8 Hex Decimal Binary
  • 19. Decimal to Binary 128 64 32 16 8 4 2 1 Binary 0 0 0 1 1 0 0 0 Decimal Hex Decimal Binary
  • 20. Decimal to Binary 128 64 32 16 8 4 2 1 Binary 0 0 0 1 1 0 0 0 Decimal 2 4 Hex Decimal Binary
  • 21. Binary to Decimal 128 64 32 16 8 4 2 1 Binary Decimal 5 7 Hex Decimal Binary
  • 22. Binary to Decimal 128 64 32 16 8 4 2 1 Binary 0 0 1 1 1 0 0 1 Decimal 5 7 Hex Decimal Binary
  • 23. Decimal to Binary 128 64 32 16 8 4 2 1 Binary 1 0 0 0 0 0 1 1 Decimal Hex Decimal Binary
  • 24. Decimal to Binary 128 64 32 16 8 4 2 1 Binary 1 0 0 0 0 0 1 1 Decimal 1 3 Hex 1 Decimal Binary
  • 25. Decimal to Binary 128 64 32 16 8 4 2 1 Binary Decimal 1 5 Hex 0 Decimal Binary
  • 26. Decimal to Binary 128 64 32 16 8 4 2 1 Binary 1 0 0 1 0 1 1 0 Decimal 1 5 Hex 0 Decimal Binary
  • 27. Binary to Hexadecimal Binary 0 0 1 0 0 1 1 0 Hexadecimal Hex Decimal Binary
  • 28. Binary to Hexadecimal 8 4 2 1 8 4 2 1 Binary 0 0 1 0 0 1 1 0 Hexadecimal Hex Decimal Binary
  • 29. Binary to Hexadecimal 8 4 2 1 8 4 2 1 Binary 0 0 1 0 0 1 1 0 Hexadecimal 2 6 Hex Decimal Binary
  • 30. Binary to Hexadecimal 8 4 2 1 8 4 2 1 Binary 0 0 1 1 1 0 1 1 Hexadecimal Hex Decimal Binary
  • 31. Binary to Hexadecimal 8 4 2 1 8 4 2 1 Binary 0 0 1 1 1 0 1 1 Hexadecimal 3 B Hex Decimal Binary
  • 32. Hexadecimal to Binary 8 4 2 1 8 4 2 1 Binary Hexadecimal F 4 Hex Decimal Binary
  • 33. Hexadecimal to Binary 8 4 2 1 8 4 2 1 Binary 1 1 1 1 0 1 0 0 Hexadecimal F 4 Hex Decimal Binary
  • 34. Hexadecimal to Binary Binary 8 4 2 1 8 4 2 1 8 4 2 1 Hex Hexadecimal 1 3 1 Decimal Binary
  • 35. Hexadecimal to Binary Binary 8 4 2 1 8 4 2 1 8 4 2 1 0 0 0 1 0 0 1 1 0 0 0 1 Hex Hexadecimal 1 3 1 Decimal Binary
  • 37. Objectives At the end of this section, we should be able to:  Discuss the parts of an assembly program  Develop a simple assembly program implementing basic input/output and other sequential statements
  • 38. The 32-bit Registers  General Purpose Registers – EAX – Accumulator – EBX – Base – ECX – Counter – EDX – Data
  • 39. The 32-bit Registers  Segment Registers (16 bits) – CS – Code Segment – DS, ES, FS, GS – Data Segment – SS – Stack Segment  Index Registers – ESI – Source Index – EDI – Destination Index
  • 40. The 32-bit Registers  Pointer Registers – EBP – Base Pointer – ESP – Stack Pointer  EIP – Instruction Pointer (a.k.a. PC)  eFlags – Flag Registers
  • 41. Parts of an Assembly Program Section .data Section .text  initialized variables  instructions  program code Section .bss  unintialized variables
  • 42. Parts of an Assembly Program Data Segment Code Segment
  • 43. Segments and Segment Registers CS CODE DS DATA BSS USER PROGRAM SS STACK SEGMENT REGISTERS
  • 44. Data and Data Types High-level Programming Languages  numeric – signed integer – unsigned integer – float or real  non-numeric – characters and strings – boolean – sets
  • 45. Data and Data Types Computers  only know numbers (bits)  data types are human abstractions  data types depend on size of data and human interpretation
  • 46. Instructions and Directives Instructions  tell processor what to do  assembled into machine code by assembler  executed at runtime by the processor  from the Intel x86 instruction set
  • 47. Instructions and Directives Directives  tell assembler what to do  commands that are recognized and acted upon by the assembler  not part of the instruction set  used to declare code and data areas, define constants and memory for storage  different assemblers have different directives
  • 48. Assembler Directives EQU directive  defines constants – label equ value – count equ 100 Data definition directive  defines memory for data storage  defines size of data
  • 49. Assembler Directives Initialized Data  db – define byte  dw – define word  dd – define double – label directive initial value – int db 0 – num dw 100
  • 50. Assembler Directives Character constants  single quote delimited  ‘A’ – char db ‘!’
  • 51. Assembler Directives String constants  single quote delimited or sequence of characters separated by commas  each character is one byte each  ‘hello’  ‘h’, ’e’, ’l’, ’l’, ’o’ – prompt1 db ‘Please enter number: ’ – prompt2 db ‘Please enter number: ’,10
  • 52. Assembler Directives Declarations
  • 53. Assembler Directives Uninitialized Data  resb – reserve byte  resw – reserve word  resd – reserve double word – label directive value – num resb 1 ; reserves 1 byte – nums resb 10 ; reserves 10 bytes
  • 54. Assembler Directives Uninitialized variables
  • 55. Assembly Instructions Basic Format instruction operand1, operand2 Operand  Register  Immediate  Memory
  • 56. Instruction Operands Register  eax, ax, ah, al  ebx, bx, bh, bl  ecx, cx, ch, cl  edx, dx, dh, dl
  • 57. Instruction Operands Immediate  character constants – character symbols enclosed in quotes – character ASCII code  integer constants – begin with a number – ends with base modifier (B, O or H)  ‘A’ = 65 = 41H = 01000001B
  • 58. Instruction Operands Memory  when using the value of a variable, enclose the variable name in square brackets  [num] - value of num  num - address of num
  • 59. Instruction Operands  If the operands are registers or memory locations, they must be of the same type.  Two memory operands are not allowed in the instruction.