Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko
-
Upload
audra-rodriguez -
Category
Documents
-
view
38 -
download
6
description
Transcript of Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko
![Page 1: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/1.jpg)
Chapter 10
Instruction Sets:Characteristics and Functions
Suzy Hanko
![Page 2: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/2.jpg)
Machine Instructions
Machine instructions are the instructions executed by the processor.
These determine what the processor will do Inside the computer, each instruction is
represented as a series of bits. Because this is difficult to remember, symbolic
representation is common.
![Page 3: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/3.jpg)
Elements of Machine Instructions
Operation code (opcode): Tells the processor which operation to perform
Source operand reference: tells the processor where the operands can be found
Result operand reference: Tells the processor where to store the result
Next instruction reference: Tells the processor where to fetch the next instruction from
Not all elements are used in every instruction
![Page 4: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/4.jpg)
Types of Instructions
Four main types of instructions: Data processing: Arithmetic and logic Data storage: Moving data between registers
and memory locations Data movement: Transferring data and
programs to memory or the user Control: Tests the value of data and/or
branches to a different set of instructions
![Page 5: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/5.jpg)
Transfer of Control
This is when the next instruction performed is not the one that immediately follows the current one in memory.
Branch/Jump: jumps to an instruction other than the next one in sequence.
Skip: skips the next instruction in sequence Procedure call: executes a procedure before
coming back and executing the next instruction
![Page 6: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/6.jpg)
Types of Operands
Four main types of operands: Numbers Characters Logical data Addresses
The actual names and exact effects of the operands varies between machines
![Page 7: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/7.jpg)
Call/Return Instructions
These instructions call and return from functions.
Four Instructions in x86 architecture: Call, Enter, Leave, and Return
When a function is called must push the return point and frame pointer onto the stack, then move the frame pointer to a new frame and place the stack pointer in that frame.
![Page 8: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/8.jpg)
Condition Codes
Condition codes set status flags, which are set by certain operations and used in conditional branch instructions.
Each status flag, and some combinations of status flags, can be tested as a condition for a jump.
![Page 9: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/9.jpg)
Stacks
A stack is a LIFO (last-in-first-out) data structure
A stack (called the run-time stack) is used to manage procedure calls and returns, and variables.
![Page 10: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/10.jpg)
Stacks (continued)
To operate the stack, three addresses are needed to be kept in registers:
The stack pointer, which contains the address of the top of the stack.
The stack base, which contains the address of the bottom of the reserved block.
The stack limit, which contains the address of the top of the reserved block.
![Page 11: Chapter 10 Instruction Sets: Characteristics and Functions Suzy Hanko](https://reader036.fdocuments.in/reader036/viewer/2022062408/56813426550346895d9b1356/html5/thumbnails/11.jpg)
Little- and Big-Endian
There are two main ways to store numbers in a computer
Big-endian stores the most significant byte in the lowest numerical address, similar to the way we write numbers
Little-endian stores the most significant byte in the highest numerical address
Both styles have advantages and disadvantages, with neither being better on average.