SlideShare une entreprise Scribd logo
1  sur  41
William Stallings
Computer Organization
and Architecture
8th Edition


Chapter 10
Instruction Sets:
Characteristics and Functions
What is an Instruction Set?
• The complete collection of instructions
  that are understood by a CPU
• Machine Code
• Binary
• Usually represented by assembly codes
Elements of an Instruction
• Operation code (Op code)
  —Do this
• Source Operand reference
  —To this
• Result Operand reference
  —Put the answer here
• Next Instruction Reference
  —When you have done that, do this...
Where have all the Operands Gone?
• Long time passing….
• (If you don’t understand, you’re too
  young!)
• Main memory (or virtual memory or
  cache)
• CPU register
• I/O device
Instruction Cycle State Diagram
Instruction Representation
• In machine code each instruction has a
  unique bit pattern
• For human consumption (well,
  programmers anyway) a symbolic
  representation is used
  —e.g. ADD, SUB, LOAD
• Operands can also be represented in this
  way
  —ADD A,B
Simple Instruction Format
Instruction Types
•   Data processing
•   Data storage (main memory)
•   Data movement (I/O)
•   Program flow control
Number of Addresses (a)
• 3 addresses
  —Operand 1, Operand 2, Result
  —a = b + c;
  —May be a forth - next instruction (usually
   implicit)
  —Not common
  —Needs very long words to hold everything
Number of Addresses (b)
• 2 addresses
  —One address doubles as operand and result
  —a = a + b
  —Reduces length of instruction
  —Requires some extra work
    – Temporary storage to hold some results
Number of Addresses (c)
• 1 address
  —Implicit second address
  —Usually a register (accumulator)
  —Common on early machines
Number of Addresses (d)
• 0 (zero) addresses
  —All addresses implicit
  —Uses a stack
  —e.g. push a
  —     push b
  —     add
  —     pop c

  —c = a + b
How Many Addresses
• More addresses
  —More complex (powerful?) instructions
  —More registers
    – Inter-register operations are quicker
  —Fewer instructions per program
• Fewer addresses
  —Less complex (powerful?) instructions
  —More instructions per program
  —Faster fetch/execution of instructions
Design Decisions (1)
• Operation repertoire
  —How many ops?
  —What can they do?
  —How complex are they?
• Data types
• Instruction formats
  —Length of op code field
  —Number of addresses
Design Decisions (2)
• Registers
  —Number of CPU registers available
  —Which operations can be performed on which
   registers?
• Addressing modes (later…)

• RISC v CISC
Types of Operand
• Addresses
• Numbers
   —Integer/floating point
• Characters
   —ASCII etc.
• Logical Data
   —Bits or flags
• (Aside: Is there any difference between numbers and
  characters? Ask a C programmer!)
x86 Data Types
• 8 bit Byte
• 16 bit word
• 32 bit double word
• 64 bit quad word
• 128 bit double quadword
• Addressing is by 8 bit unit
• Words do not need to align at even-
  numbered address
• Data accessed across 32 bit bus in units of
  double word read at addresses divisible by
  4
• Little endian
SMID Data Types
• Integer types
   — Interpreted as bit field or integer

• Packed byte and packed byte integer
   — Bytes packed into 64-bit quadword or 128-bit double
     quadword
• Packed word and packed word integer
   — 16-bit words packed into 64-bit quadword or 128-bit double
     quadword
• Packed doubleword and packed doubleword integer
   — 32-bit doublewords packed into 64-bit quadword or 128-bit
     double quadword
• Packed quadword and packed qaudword integer
   — Two 64-bit quadwords packed into 128-bit double quadword

• Packed single-precision floating-point and packed double-
  precision floating-point
   — Four 32-bit floating-point or two 64-bit floating-point values
     packed into a 128-bit double quadword
x86 Numeric Data Formats
ARM Data Types
• 8 (byte), 16 (halfword), 32 (word) bits
• Halfword and word accesses should be word aligned
• Nonaligned access alternatives
   — Default
        –   Treated as truncated
        –   Bits[1:0] treated as zero for word
        –   Bit[0] treated as zero for halfword
        –   Load single word instructions rotate right word aligned data transferred by
            non word-aligned address one, two or three bytesAlignment checking
   — Data abort signal indicates alignment fault for attempting unaligned
     access
   — Unaligned access
   — Processor uses one or more memory accesses to generate transfer of
     adjacent bytes transparently to the programmer
• Unsigned integer interpretation supported for all types
• Twos-complement signed integer interpretation supported for all
  types
• Majority of implementations do not provide floating-point
  hardware
   —   Saves power and area
   —   Floating-point arithmetic implemented in software
   —   Optional floating-point coprocessor
   —   Single- and double-precision IEEE 754 floating point data types
ARM Endian Support
• E-bit in system control register
• Under program control
Types of Operation
•   Data Transfer
•   Arithmetic
•   Logical
•   Conversion
•   I/O
•   System Control
•   Transfer of Control
Data Transfer
• Specify
  —Source
  —Destination
  —Amount of data
• May be different instructions for different
  movements
  —e.g. IBM 370
• Or one instruction and different addresses
  —e.g. VAX
Arithmetic
•   Add, Subtract, Multiply, Divide
•   Signed Integer
•   Floating point ?
•   May include
    —Increment (a++)
    —Decrement (a--)
    —Negate (-a)
Shift and Rotate Operations
Logical
• Bitwise operations
• AND, OR, NOT
Conversion
• E.g. Binary to Decimal
Input/Output
• May be specific instructions
• May be done using data movement
  instructions (memory mapped)
• May be done by a separate controller
  (DMA)
Systems Control
• Privileged instructions
• CPU needs to be in specific state
  —Ring 0 on 80386+
  —Kernel mode
• For operating systems use
Transfer of Control
• Branch
  —e.g. branch to x if result is zero
• Skip
  —e.g. increment and skip if zero
  —ISZ Register1
  —Branch xxxx
  —ADD A
• Subroutine call
  —c.f. interrupt call
Branch Instruction
Nested Procedure Calls
Use of Stack
Stack Frame Growth Using Sample
Procedures P and Q
Exercise For Reader
• Find out about instruction set for Pentium
  and ARM
• Start with Stallings
• Visit web sites
Byte Order
(A portion of chips?)
• What order do we read numbers that
  occupy more than one byte
• e.g. (numbers in hex to make it easy to
  read)
• 12345678 can be stored in 4x8bit
  locations as follows
Byte Order (example)
•   Address   Value (1)      Value(2)
•   184       12             78
•   185       34             56
•   186       56             34
•   186       78             12

• i.e. read top down or bottom up?
Byte Order Names
• The problem is called Endian
• The system on the left has the least
  significant byte in the lowest address
• This is called big-endian
• The system on the right has the least
  significant byte in the highest address
• This is called little-endian
Example of C Data Structure
Alternative View of Memory Map
Standard…What Standard?
• Pentium (x86), VAX are little-endian
• IBM 370, Moterola 680x0 (Mac), and most
  RISC are big-endian
• Internet is big-endian
  —Makes writing Internet programs on PC more
   awkward!
  —WinSock provides htoi and itoh (Host to
   Internet & Internet to Host) functions to
   convert

Contenu connexe

Tendances

10 Instruction Sets Characteristics
10  Instruction  Sets Characteristics10  Instruction  Sets Characteristics
10 Instruction Sets Characteristics
Jeanie Delos Arcos
 
Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architecture
Subesh Kumar Yadav
 
05 instruction set design and architecture
05 instruction set design and architecture05 instruction set design and architecture
05 instruction set design and architecture
Waqar Jamil
 

Tendances (20)

10 Instruction Sets Characteristics
10  Instruction  Sets Characteristics10  Instruction  Sets Characteristics
10 Instruction Sets Characteristics
 
12 processor structure and function
12 processor structure and function12 processor structure and function
12 processor structure and function
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
13 risc
13 risc13 risc
13 risc
 
10 instruction sets characteristics
10 instruction sets characteristics10 instruction sets characteristics
10 instruction sets characteristics
 
18 parallel processing
18 parallel processing18 parallel processing
18 parallel processing
 
Lecture 2 computer evolution and performance
Lecture 2 computer evolution and performanceLecture 2 computer evolution and performance
Lecture 2 computer evolution and performance
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Introduction to Computer Architecture and Organization
Introduction to Computer Architecture and OrganizationIntroduction to Computer Architecture and Organization
Introduction to Computer Architecture and Organization
 
05 internal memory
05 internal memory05 internal memory
05 internal memory
 
MEMORY & I/O SYSTEMS
MEMORY & I/O SYSTEMS                          MEMORY & I/O SYSTEMS
MEMORY & I/O SYSTEMS
 
PARALLELISM IN MULTICORE PROCESSORS
PARALLELISM  IN MULTICORE PROCESSORSPARALLELISM  IN MULTICORE PROCESSORS
PARALLELISM IN MULTICORE PROCESSORS
 
Glow introduction
Glow introductionGlow introduction
Glow introduction
 
Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architecture
 
Ch8 main memory
Ch8   main memoryCh8   main memory
Ch8 main memory
 
05 instruction set design and architecture
05 instruction set design and architecture05 instruction set design and architecture
05 instruction set design and architecture
 
Chapter 2 - Computer Evolution and Performance
Chapter 2 - Computer Evolution and PerformanceChapter 2 - Computer Evolution and Performance
Chapter 2 - Computer Evolution and Performance
 
MIPS Assembly Language I
MIPS Assembly Language IMIPS Assembly Language I
MIPS Assembly Language I
 
Frist slider share
Frist slider shareFrist slider share
Frist slider share
 
27 multicore
27 multicore27 multicore
27 multicore
 

En vedette

03 top level view of computer function and interconnection
03 top level view of computer function and interconnection03 top level view of computer function and interconnection
03 top level view of computer function and interconnection
Sher Shah Merkhel
 
02 computer evolution and performance
02 computer evolution and performance02 computer evolution and performance
02 computer evolution and performance
Sher Shah Merkhel
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
Sher Shah Merkhel
 

En vedette (6)

01 introduction
01 introduction01 introduction
01 introduction
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
03 top level view of computer function and interconnection
03 top level view of computer function and interconnection03 top level view of computer function and interconnection
03 top level view of computer function and interconnection
 
02 computer evolution and performance
02 computer evolution and performance02 computer evolution and performance
02 computer evolution and performance
 
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 

Similaire à 10 instruction sets characteristics

(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)
Alveena Saleem
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
Kanika Thakur
 
11_ Instruction Sets addressing modes .ppt
11_ Instruction Sets addressing modes .ppt11_ Instruction Sets addressing modes .ppt
11_ Instruction Sets addressing modes .ppt
SwarajKumarPradhan
 
Micro[processor
Micro[processorMicro[processor
Micro[processor
college
 

Similaire à 10 instruction sets characteristics (20)

CO_Chapter2.ppt
CO_Chapter2.pptCO_Chapter2.ppt
CO_Chapter2.ppt
 
CNIT 127 Ch 1: Before you Begin
CNIT 127 Ch 1: Before you BeginCNIT 127 Ch 1: Before you Begin
CNIT 127 Ch 1: Before you Begin
 
(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)(246431835) instruction set principles (2) (1)
(246431835) instruction set principles (2) (1)
 
Computer organization basics
Computer organization  basicsComputer organization  basics
Computer organization basics
 
CNIT 127 Ch Ch 1: Before you Begin
CNIT 127 Ch Ch 1: Before you BeginCNIT 127 Ch Ch 1: Before you Begin
CNIT 127 Ch Ch 1: Before you Begin
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
Cis cvs risc
Cis cvs riscCis cvs risc
Cis cvs risc
 
Ch12- instruction sets- char & funct.pdf
Ch12- instruction sets- char & funct.pdfCh12- instruction sets- char & funct.pdf
Ch12- instruction sets- char & funct.pdf
 
cs-procstruc.ppt
cs-procstruc.pptcs-procstruc.ppt
cs-procstruc.ppt
 
Lec05
Lec05Lec05
Lec05
 
CNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 DisassemblyCNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 4: A Crash Course in x86 Disassembly
 
06 mips-isa
06 mips-isa06 mips-isa
06 mips-isa
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...
 
Practical Malware Analysis: Ch 4 A Crash Course in x86 Disassembly
Practical Malware Analysis: Ch 4 A Crash Course in x86 Disassembly Practical Malware Analysis: Ch 4 A Crash Course in x86 Disassembly
Practical Malware Analysis: Ch 4 A Crash Course in x86 Disassembly
 
11_ Instruction Sets addressing modes .ppt
11_ Instruction Sets addressing modes .ppt11_ Instruction Sets addressing modes .ppt
11_ Instruction Sets addressing modes .ppt
 
Micro[processor
Micro[processorMicro[processor
Micro[processor
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
pipeline and pipeline hazards
pipeline and pipeline hazards pipeline and pipeline hazards
pipeline and pipeline hazards
 
11_ InstructionSetsAddressingModes .pdf
11_ InstructionSetsAddressingModes .pdf11_ InstructionSetsAddressingModes .pdf
11_ InstructionSetsAddressingModes .pdf
 

Dernier

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Dernier (20)

Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 

10 instruction sets characteristics

  • 1. William Stallings Computer Organization and Architecture 8th Edition Chapter 10 Instruction Sets: Characteristics and Functions
  • 2. What is an Instruction Set? • The complete collection of instructions that are understood by a CPU • Machine Code • Binary • Usually represented by assembly codes
  • 3. Elements of an Instruction • Operation code (Op code) —Do this • Source Operand reference —To this • Result Operand reference —Put the answer here • Next Instruction Reference —When you have done that, do this...
  • 4. Where have all the Operands Gone? • Long time passing…. • (If you don’t understand, you’re too young!) • Main memory (or virtual memory or cache) • CPU register • I/O device
  • 6. Instruction Representation • In machine code each instruction has a unique bit pattern • For human consumption (well, programmers anyway) a symbolic representation is used —e.g. ADD, SUB, LOAD • Operands can also be represented in this way —ADD A,B
  • 8. Instruction Types • Data processing • Data storage (main memory) • Data movement (I/O) • Program flow control
  • 9. Number of Addresses (a) • 3 addresses —Operand 1, Operand 2, Result —a = b + c; —May be a forth - next instruction (usually implicit) —Not common —Needs very long words to hold everything
  • 10. Number of Addresses (b) • 2 addresses —One address doubles as operand and result —a = a + b —Reduces length of instruction —Requires some extra work – Temporary storage to hold some results
  • 11. Number of Addresses (c) • 1 address —Implicit second address —Usually a register (accumulator) —Common on early machines
  • 12. Number of Addresses (d) • 0 (zero) addresses —All addresses implicit —Uses a stack —e.g. push a — push b — add — pop c —c = a + b
  • 13. How Many Addresses • More addresses —More complex (powerful?) instructions —More registers – Inter-register operations are quicker —Fewer instructions per program • Fewer addresses —Less complex (powerful?) instructions —More instructions per program —Faster fetch/execution of instructions
  • 14. Design Decisions (1) • Operation repertoire —How many ops? —What can they do? —How complex are they? • Data types • Instruction formats —Length of op code field —Number of addresses
  • 15. Design Decisions (2) • Registers —Number of CPU registers available —Which operations can be performed on which registers? • Addressing modes (later…) • RISC v CISC
  • 16. Types of Operand • Addresses • Numbers —Integer/floating point • Characters —ASCII etc. • Logical Data —Bits or flags • (Aside: Is there any difference between numbers and characters? Ask a C programmer!)
  • 17. x86 Data Types • 8 bit Byte • 16 bit word • 32 bit double word • 64 bit quad word • 128 bit double quadword • Addressing is by 8 bit unit • Words do not need to align at even- numbered address • Data accessed across 32 bit bus in units of double word read at addresses divisible by 4 • Little endian
  • 18. SMID Data Types • Integer types — Interpreted as bit field or integer • Packed byte and packed byte integer — Bytes packed into 64-bit quadword or 128-bit double quadword • Packed word and packed word integer — 16-bit words packed into 64-bit quadword or 128-bit double quadword • Packed doubleword and packed doubleword integer — 32-bit doublewords packed into 64-bit quadword or 128-bit double quadword • Packed quadword and packed qaudword integer — Two 64-bit quadwords packed into 128-bit double quadword • Packed single-precision floating-point and packed double- precision floating-point — Four 32-bit floating-point or two 64-bit floating-point values packed into a 128-bit double quadword
  • 19. x86 Numeric Data Formats
  • 20. ARM Data Types • 8 (byte), 16 (halfword), 32 (word) bits • Halfword and word accesses should be word aligned • Nonaligned access alternatives — Default – Treated as truncated – Bits[1:0] treated as zero for word – Bit[0] treated as zero for halfword – Load single word instructions rotate right word aligned data transferred by non word-aligned address one, two or three bytesAlignment checking — Data abort signal indicates alignment fault for attempting unaligned access — Unaligned access — Processor uses one or more memory accesses to generate transfer of adjacent bytes transparently to the programmer • Unsigned integer interpretation supported for all types • Twos-complement signed integer interpretation supported for all types • Majority of implementations do not provide floating-point hardware — Saves power and area — Floating-point arithmetic implemented in software — Optional floating-point coprocessor — Single- and double-precision IEEE 754 floating point data types
  • 21. ARM Endian Support • E-bit in system control register • Under program control
  • 22. Types of Operation • Data Transfer • Arithmetic • Logical • Conversion • I/O • System Control • Transfer of Control
  • 23. Data Transfer • Specify —Source —Destination —Amount of data • May be different instructions for different movements —e.g. IBM 370 • Or one instruction and different addresses —e.g. VAX
  • 24. Arithmetic • Add, Subtract, Multiply, Divide • Signed Integer • Floating point ? • May include —Increment (a++) —Decrement (a--) —Negate (-a)
  • 25. Shift and Rotate Operations
  • 28. Input/Output • May be specific instructions • May be done using data movement instructions (memory mapped) • May be done by a separate controller (DMA)
  • 29. Systems Control • Privileged instructions • CPU needs to be in specific state —Ring 0 on 80386+ —Kernel mode • For operating systems use
  • 30. Transfer of Control • Branch —e.g. branch to x if result is zero • Skip —e.g. increment and skip if zero —ISZ Register1 —Branch xxxx —ADD A • Subroutine call —c.f. interrupt call
  • 34. Stack Frame Growth Using Sample Procedures P and Q
  • 35. Exercise For Reader • Find out about instruction set for Pentium and ARM • Start with Stallings • Visit web sites
  • 36. Byte Order (A portion of chips?) • What order do we read numbers that occupy more than one byte • e.g. (numbers in hex to make it easy to read) • 12345678 can be stored in 4x8bit locations as follows
  • 37. Byte Order (example) • Address Value (1) Value(2) • 184 12 78 • 185 34 56 • 186 56 34 • 186 78 12 • i.e. read top down or bottom up?
  • 38. Byte Order Names • The problem is called Endian • The system on the left has the least significant byte in the lowest address • This is called big-endian • The system on the right has the least significant byte in the highest address • This is called little-endian
  • 39. Example of C Data Structure
  • 40. Alternative View of Memory Map
  • 41. Standard…What Standard? • Pentium (x86), VAX are little-endian • IBM 370, Moterola 680x0 (Mac), and most RISC are big-endian • Internet is big-endian —Makes writing Internet programs on PC more awkward! —WinSock provides htoi and itoh (Host to Internet & Internet to Host) functions to convert