CS356 Unit 4 X86 Instruction Set 4.2 Why Learn Assembly

Total Page:16

File Type:pdf, Size:1020Kb

CS356 Unit 4 X86 Instruction Set 4.2 Why Learn Assembly 4.1 CS356 Unit 4 x86 Instruction Set 4.2 Why Learn Assembly • Understand hardware limitations • Understand performance • Use HW options that high-level languages don't allow (e.g., operating systems, utilizing special HW features, etc.) • Understand security vulnerabilities • Can help debugging 4.3 Compiling and Disassembling void abs_value (int x, int *res) { if(x < 0) { • From C to assembly code *res = -x; } else { $ gcc -Og -c ___ file1.c *res = x; } } • Looking at binary files Original Code $ gcc -Og -c file1.c Disassembly of section .text: $ ________ -C file1.o 0000000000000000 <abs_value>: 0: 85 ff test %edi,%edi 2: 78 03 js 7 “if(x<0) goto 7” • From binary to assembly 4: 89 3e mov %edi,(%rsi) 6: c3 retq $ gcc -Og -c file1.c 7: f7 df neg %edi 9: 89 3e mov %edi,(%rsi) $ ________ -d file1.o b: c3 retq Compiler Output (Machine code & Assembly) Notice how each instruction is turned CS:APP 3.2.2 into binary (shown in hex) 4.4 Basic Computer Organization Check the recorded lecture 4.5 x86-64 Memory Organization Recall variables live in memory & need to int x,y=5;z=8; be loaded into the • Because each byte of memory has its x = y+z; processor to be used own address we can picture memory A as one column of bytes (Fig. 2) Proc. 40 Mem. D • With 64-bit logical data bus we can 64 access up to 8-bytes of data at a time Fig. 2 … • We will usually show memory arranged in rows of 4 bytes (Fig. 3) or F8 0x000002 8 bytes 13 0x000001 5A 0x000000 – Still with separate addresses for each byte Logical Byte-Oriented View of Mem. … Fig. 3 b 8E a AD 9 33 8 29 0x000008 7 8E 6 AD 5 33 4 29 0x000004 3 7C 2 F8 1 13 0 5A 0x000000 Logical DWord-Oriented View 4.6 Memory & Word Size CS:APP 3.9.3 Double Word 4 • To refer to a chunk of memory we Word 6 Word 4 must provide: • The starting address Byte 7 Byte 6 Byte 5 Byte 4 • The size: B, W, D, L Byte 3 Byte 2 Byte 1 Byte 0 • There are rules for valid starting Quad Word 0 WordQuad Word 2 Word 0 addresses • A valid starting address should be a Double Word 0 multiple of the data size Byte • Words (2-byte chunks) must start on an Address Word even (divisible by 2) address … 0x4007 4006 • Double words (4-byte chunks) must start DWord 0x4006 Word on an address that is a multiple of 0x4004 0x4005 4004 (divisible by) 4 0x4004 Word … 0x4003 4002 • DWord Quad words (8-byte chunks) must start on 0x4002 an address that is a multiple of (divisible Word 0x4000 4000 QWord 4000 QWord 0x4001 by) 8 0x4000 4.7 Endian-ness CS:APP 2.1.3 • Endian-ness refers to the two alternate methods of ordering the The DWORD value: bytes in a larger unit (2, 4, 8 bytes) 0 x 12 34 56 78 – Big-Endian can be stored differently • PPC, Sparc, TCP/IP • MS byte is put at the starting address – Little-Endian 0x00 12 0x00 78 • used by Intel processors / original PCI 0x01 34 0x01 56 bus 0x02 56 0x02 34 • LS byte is put at the starting address 0x03 78 0x03 12 • Some processors (like ARM) and Big-Endian Little-Endian busses can be configured for either big- or little-endian 4.8 Big-endian vs. Little-endian • Big-endian • Little-endian – makes sense if you view your – makes sense if you view your memory as starting at the memory as starting at the top-left and addresses bottom-right and addresses increasing as you go down increasing as you go up 0 1 2 3 Addresses increasing Addresses … 000000 12345678 000004 000014 000008 000010 upward 00000C 00000C downward 000010 000008 000014 000004 … 12345678 000000 increasing Addresses 3 2 1 0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 Byte 0 Byte 1 Byte 2 Byte 3 Byte 3 Byte 2 Byte 1 Byte 0 4.9 Big-endian vs. Little-endian Issues • Issues arise when transferring data between different systems – Byte-wise copy of data from big-endian system to little-endian system – Major issue in networks (little-endian computer => big-endian computer) and even within a single computer (system memory => I/O device) Intel is Big-Endian Little-Endian 0 1 2 3 LITTLE-ENDIAN Addresses increasing Addresses Copy byte 0 to byte 0, … 000000 12345678 byte 1 to byte 1, etc. 000004 000014 000008 000010 upward 00000C 00000C downward 000010 DWORD @ 0 in big-endian 000008 system is now different than 000014 000004 DWORD @ 0 in little-endian … system 78563412 000000 increasing Addresses 3 2 1 0 1 2 3 4 5 6 7 8 DWORD @ addr. 0 7 8 5 6 3 4 1 2 wrong! Byte 0 Byte 1 Byte 2 Byte 3 Byte 3 Byte 2 Byte 1 Byte 0 4.10 x86-64 ASSEMBLY 4.11 x86-64 Data Sizes CS:APP 3.3 Integer Floating Point • 4 sizes • 2 sizes – __________ – Single (S) • 8-bits = 1 byte • 32-bits = 4 bytes – __________ – Double (D) • 16-bits = 2 bytes • 64-bits = 8 bytes – __________ • (For a 32-bit data bus, a • 32-bits = 4 bytes double would be accessed from memory in 2 reads) – __________ • 64-bits = 8 bytes In x86-64, instructions generally specify what size data to access from memory and then operate upon. 4.12 x86-64 Register Names CS:APP 3.4 b (1 byte) w (2 bytes) l (4 bytes) q (8 bytes) %rax %eax %ax accumulate %rbx %ebx %bx base %rcx %ecx %cx counter %rdx %edx %dx data %rsi %esi %si source index %rdi %edi %di destination index %rsp %esp %sp stack pointer %rbp %ebp %bp base pointer • In addition: %al, %bl, %cl, %dl, %sil, %dil, %spl, %bpl for least significant byte • In addition: %r8 to %r15 (%r8d / %r8w / %r8b for lower 4 / 2 / 1 bytes) 4.13 x86-64 Instruction Classes • _____________________ (mov instruction) – Moves data between registers, or between registers and memory (One operand must be a processor register.) – Specifies size via a suffix on the instruction (movb, movw, movl, movq) • ___________ Operations – One operand must be a processor register – Size and operation specified by instruction (addl, orq, andb, subw) • ___________________ Flow – Unconditional/Conditional Branch (cmpq, jmp, je, jne, jl, jge) – Subroutine Calls (call, ret) • _____________________ Instructions – Instructions that can only be used by OS or other “supervisor” software (e.g. int to access certain OS capabilities, etc.) 4.14 Operand Locations • Source operands must be in one of the following 3 locations: – A ___________ value (e.g. %rax) Proc. Mem. – A value in a __________ location 400 Inst. Reg. A (e.g. value at address 0x0200e8) 401 Inst. Reg. – A __________ stored in the D ... Data ALU instruction itself (known as Data “________________ value”) ... add $1,d0 – The $ indicates the constant/immediate • Destination operands must be – A register – A memory location (specified by its address 0x0200e8) 4.15 Intel x86 Register Set • 8-bit processors in late 1970s – 4 registers for integer data: ________________ – 4 registers for address/pointers: SP (stack pointer), BP (base pointer), SI (source index), DI (dest. index) • 16-bit processors extended registers to 16-bits but continued to support 8-bit access! – Use prefix/suffix to indicate size: ___ referenced the lower 8-bits of register A ___ the higher 8-bits of register A ___ referenced the full 16-bit value • 32-/64-bit processors (see next slide) 4.16 DATA TRANSFER INSTRUCTIONS 4.17 mov Instruction & Data Size CS:APP 3.4.2 • Moves data between memory and processor register • Always provide the LS-Byte address (little-endian) of the desired data • Size is explicitly defined by the instruction ________ ('mov[_____]') used • Recall: Start address should be divisible by size of access (Assume start address = A) Processor Register Memory / RAM 63 7 0 7654 3210 A+4 Byte operations only access the 1-byte at the Byte movb fedc ba98 A specified address movb leaves upper bits unaffected 63 15 0 7654 3210 A+4 Word operations access the 2-bytes starting at the Word movw fedc ba98 A specified address movw leaves upper bits unaffected 63 31 0 7654 3210 A+4 Word operations access the 4-bytes starting at the 0000 0000 Double Word movl fedc ba98 A specified address movl zeros the upper bits 63 0 7654 3210 A+4 Word operations access the 8-bytes starting at the Quad Word movq fedc ba98 A specified address 4.18 Mem/Register Transfer Examples Memory / RAM • mov[b,w,l,q] src, dst 7654 3210 0x00204 fedc ba98 0x00200 • Initial Conditions: Processor Register ffff ffff 1234 5678 rax – movq 0x200, %rax rax movl zeros the upper rax – movl 0x204, %eax bits of dest. reg – movw 0x202, %ax rax – movb 0x207, %al rax 0x004e4 – movb %al, 0x4e5 0x004e0 0x004e4 – movl %eax, 0x4e0 movl changes only 4 bytes here 0x004e0 Treat these instructions as a sequence where one affects the next. 4.19 Immediate Examples Memory / RAM • Immediate Examples 7654 3210 0x00204 fedc ba98 0x00200 Processor Register ffff ffff 1234 5678 rax – movl $0xfe1234, %eax rax – movw $0xaa55, %ax rax – movb $20, %al rax – movq $-1, %rax rax – movabsq $0x123456789ab, %rax rax – movq $-1, 0x4e0 0x004e4 0x004e0 Rules: • Immediates must be source operand • Indicate with '$' and can be specified in decimal (default) or hex (start with 0x) • movq can only support a 32-bit immediate (and will then sign-extend that value to fill the upper 32-bits) • Use movabsq for a full 64-bit immediate value 4.20 Variations: Zero / Sign Extension • There are several variations with register destination – Used to zero-extend or sign-extend the source • Normal mov does ____________ upper portions of registers (with exception of movl) • movzxy will _______________ the upper portion – movzbw (move a byte from the source but zero-extend it to a word in the destination register) – movzbw, movzbl, movzbq, movzwl, movzwq (but no movzlq!) • movsxy will _______________ the upper portion – movsbw (move a byte from the source but sign-extend it to a word in the destination register) – movsbw, movsbl, movsbq, movswl, movswq, movslq – cltq is equivalent to movslq %eax,%rax (but shorter encoding) 4.21 Zero/Signed Move Variations Memory / RAM • Initial Conditions: 7654 3210 0x00204 fedc ba98 0x00200 Processor Register 0123 4567 89ab cdef rdx – movl 0x200, %eax rax – movslq 0x200, %rax rax – movzwl 0x202, %eax rax – movsbw 0x201, %ax rax – movsbl 0x206, %eax rax – movzbq %dl, %rax rax Treat these instructions as a sequence where one affects the next.
Recommended publications
  • Computer Organization and Architecture Designing for Performance Ninth Edition
    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION William Stallings Boston Columbus Indianapolis New York San Francisco Upper Saddle River Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montréal Toronto Delhi Mexico City São Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo Editorial Director: Marcia Horton Designer: Bruce Kenselaar Executive Editor: Tracy Dunkelberger Manager, Visual Research: Karen Sanatar Associate Editor: Carole Snyder Manager, Rights and Permissions: Mike Joyce Director of Marketing: Patrice Jones Text Permission Coordinator: Jen Roach Marketing Manager: Yez Alayan Cover Art: Charles Bowman/Robert Harding Marketing Coordinator: Kathryn Ferranti Lead Media Project Manager: Daniel Sandin Marketing Assistant: Emma Snider Full-Service Project Management: Shiny Rajesh/ Director of Production: Vince O’Brien Integra Software Services Pvt. Ltd. Managing Editor: Jeff Holcomb Composition: Integra Software Services Pvt. Ltd. Production Project Manager: Kayla Smith-Tarbox Printer/Binder: Edward Brothers Production Editor: Pat Brown Cover Printer: Lehigh-Phoenix Color/Hagerstown Manufacturing Buyer: Pat Brown Text Font: Times Ten-Roman Creative Director: Jayne Conte Credits: Figure 2.14: reprinted with permission from The Computer Language Company, Inc. Figure 17.10: Buyya, Rajkumar, High-Performance Cluster Computing: Architectures and Systems, Vol I, 1st edition, ©1999. Reprinted and Electronically reproduced by permission of Pearson Education, Inc. Upper Saddle River, New Jersey, Figure 17.11: Reprinted with permission from Ethernet Alliance. Credits and acknowledgments borrowed from other sources and reproduced, with permission, in this textbook appear on the appropriate page within text. Copyright © 2013, 2010, 2006 by Pearson Education, Inc., publishing as Prentice Hall. All rights reserved. Manufactured in the United States of America.
    [Show full text]
  • Introduction to the Intel® Nios® II Soft Processor
    Introduction to the Intel® Nios® II Soft Processor For Quartus® Prime 18.1 1 Introduction This tutorial presents an introduction the Intel® Nios® II processor, which is a soft processor that can be instantiated on an Intel FPGA device. It describes the basic architecture of Nios II and its instruction set. The Nios II processor and its associated memory and peripheral components are easily instantiated by using Intel’s SOPC Builder or Platform Designer tool in conjunction with the Quartus® Prime software. A full description of the Nios II processor is provided in the Nios II Processor Reference Handbook, which is available in the literature section of the Intel web site. Introductions to the SOPC Builder and Platform Designer tools are given in the tutorials Introduction to the Intel SOPC Builder and Introduction to the Intel Platform Designer Tool, respectively. Both can be found in the University Program section of the web site. Contents: • Nios II System • Overview of Nios II Processor Features • Register Structure • Accessing Memory and I/O Devices • Addressing • Instruction Set • Assembler Directives • Example Program • Exception Processing • Cache Memory • Tightly Coupled Memory Intel Corporation - FPGA University Program 1 March 2019 ® ® INTRODUCTION TO THE INTEL NIOS II SOFT PROCESSOR For Quartus® Prime 18.1 2 Background Intel’s Nios II is a soft processor, defined in a hardware description language, which can be implemented in Intel’s FPGA devices by using the Quartus Prime CAD system. This tutorial provides a basic introduction to the Nios II processor, intended for a user who wishes to implement a Nios II based system on an Intel Development and Education board.
    [Show full text]
  • Computer Organization & Architecture Eie
    COMPUTER ORGANIZATION & ARCHITECTURE EIE 411 Course Lecturer: Engr Banji Adedayo. Reg COREN. The characteristics of different computers vary considerably from category to category. Computers for data processing activities have different features than those with scientific features. Even computers configured within the same application area have variations in design. Computer architecture is the science of integrating those components to achieve a level of functionality and performance. It is logical organization or designs of the hardware that make up the computer system. The internal organization of a digital system is defined by the sequence of micro operations it performs on the data stored in its registers. The internal structure of a MICRO-PROCESSOR is called its architecture and includes the number lay out and functionality of registers, memory cell, decoders, controllers and clocks. HISTORY OF COMPUTER HARDWARE The first use of the word ‘Computer’ was recorded in 1613, referring to a person who carried out calculation or computation. A brief History: Computer as we all know 2day had its beginning with 19th century English Mathematics Professor named Chales Babage. He designed the analytical engine and it was this design that the basic frame work of the computer of today are based on. 1st Generation 1937-1946 The first electronic digital computer was built by Dr John V. Atanasoff & Berry Cliford (ABC). In 1943 an electronic computer named colossus was built for military. 1946 – The first general purpose digital computer- the Electronic Numerical Integrator and computer (ENIAC) was built. This computer weighed 30 tons and had 18,000 vacuum tubes which were used for processing.
    [Show full text]
  • A Modular Soft Processor Core in VHDL
    A Modular Soft Processor Core in VHDL Jack Whitham 2002-2003 This is a Third Year project submitted for the degree of MEng in the Department of Computer Science at the University of York. The project will attempt to demonstrate that a modular soft processor core can be designed and implemented on an FPGA, and that the core can be optimised to run a particular embedded application using a minimal amount of FPGA space. The word count of this project (as counted by the Unix wc command after detex was run on the LaTeX source) is 33647 words. This includes all text in the main report and Appendices A, B and C. Excluding source code, the project is 70 pages in length. i Contents I. Introduction 1 1. Background and Literature 1 1.1. Soft Processor Cores . 1 1.2. A Field Programmable Gate Array . 1 1.3. VHSIC Hardware Definition Language (VHDL) . 2 1.4. The Motorola 68020 . 2 II. High-level Project Decisions 3 2. Should the design be based on an existing one? 3 3. Which processor should the soft core be based upon? 3 4. Which processor should be chosen? 3 5. Restating the aims of the project in terms of the chosen processor 4 III. Modular Processor Design Decisions 4 6. Processor Design 4 6.1. Alternatives to a complete processor implementation . 4 6.2. A real processor . 5 6.3. Instruction Decoder and Control Logic . 5 6.4. Arithmetic and Logic Unit (ALU) . 7 6.5. Register File . 7 6.6. Links between Components .
    [Show full text]
  • Assignment Solutions
    Week 1: Assignment Solutions 1. Which of the following statements are true? a. The ENIAC computer was built using mechanical relays. b. Harvard Mark1 computer was built using mechanical relays. c. PASCALINE computer could multiply and divide numbers by repeated addition and subtraction. d. Charles Babbage built his automatic computing engine in 19th century. Solution: ((b) and (c)) ENIAC was built using vacuum tubes. Charles Babbage designed his automatic computing engine but could not built it. 2. Which of the following statements are true for Moore’s law? a. Moore’s law predicts that power dissipation will double every 18 months. b. Moore’s law predicts that the number of transistors per chip will double every 18 months. c. Moore’s law predicts that the speed of VLSI circuits will double every 18 months. d. None of the above. Solution: (b) Moore’s law only predicts that number of transistors per chip will double every 18 months. 3. Which of the following generates the necessary signals required to execute an instruction in a computer? a. Arithmetic and Logic Unit b. Memory Unit c. Control Unit d. Input/Output Unit Solution: (c) Control unit acts as the nerve center of a computer and generates the necessary control signals required to execute an instruction. 4. An instruction ADD R1, A is stored at memory location 4004H. R1 is a processor register and A is a memory location with address 400CH. Each instruction is 32-bit long. What will be the values of PC, IR and MAR during execution of the instruction? a.
    [Show full text]
  • Register Are Used to Quickly Accept, Store, and Transfer Data And
    Register are used to quickly accept, store, and transfer data and instructions that are being used immediately by the CPU, there are various types of Registers those are used for various purpose. Among of the some Mostly used Registers named as AC or Accumulator, Data Register or DR, the AR or Address Register, program counter (PC), Memory Data Register (MDR) ,Index register,Memory Buffer Register. These Registers are used for performing the various Operations. While we are working on the System then these Registers are used by the CPU for Performing the Operations. When We Gives Some Input to the System then the Input will be Stored into the Registers and When the System will gives us the Results after Processing then the Result will also be from the Registers. So that they are used by the CPU for Processing the Data which is given by the User. Registers Perform:- 1) Fetch: The Fetch Operation is used for taking the instructions those are given by the user and the Instructions those are stored into the Main Memory will be fetch by using Registers. 2) Decode: The Decode Operation is used for interpreting the Instructions means the Instructions are decoded means the CPU will find out which Operation is to be performed on the Instructions. 3) Execute: The Execute Operation is performed by the CPU. And Results those are produced by the CPU are then Stored into the Memory and after that they are displayed on the user Screen. Types of Registers are as Followings 1. MAR stand for Memory Address Register This register holds the memory addresses of data and instructions.
    [Show full text]
  • IAR C/C++ Compiler Reference Guide for V850
    IAR Embedded Workbench® IAR C/C++ Compiler Reference Guide for the Renesas V850 Microcontroller Family CV850-9 COPYRIGHT NOTICE © 1998–2013 IAR Systems AB. No part of this document may be reproduced without the prior written consent of IAR Systems AB. The software described in this document is furnished under a license and may only be used or copied in accordance with the terms of such a license. DISCLAIMER The information in this document is subject to change without notice and does not represent a commitment on any part of IAR Systems. While the information contained herein is assumed to be accurate, IAR Systems assumes no responsibility for any errors or omissions. In no event shall IAR Systems, its employees, its contractors, or the authors of this document be liable for special, direct, indirect, or consequential damage, losses, costs, charges, claims, demands, claim for lost profits, fees, or expenses of any nature or kind. TRADEMARKS IAR Systems, IAR Embedded Workbench, C-SPY, visualSTATE, The Code to Success, IAR KickStart Kit, I-jet, I-scope, IAR and the logotype of IAR Systems are trademarks or registered trademarks owned by IAR Systems AB. Microsoft and Windows are registered trademarks of Microsoft Corporation. Renesas is a registered trademark of Renesas Electronics Corporation. V850 is a trademark of Renesas Electronics Corporation. Adobe and Acrobat Reader are registered trademarks of Adobe Systems Incorporated. All other product names are trademarks or registered trademarks of their respective owners. EDITION NOTICE Ninth edition: May 2013 Part number: CV850-9 This guide applies to version 4.x of IAR Embedded Workbench® for the Renesas V850 microcontroller family.
    [Show full text]
  • Computer Organization and Architecture Structure
    COMPUTER ORGANIZATION AND ARCHITECTURE Computer Architecture refers to those attributes of a system that have a direct impact on the logical execution of a program. Examples: o the instruction set o the number of bits used to represent various data types o I/O mechanisms o memory addressing techniques Computer Organization refers to the operational units and their interconnections that realize the architectural specifications. Examples are things that are transparent to the programmer: o control signals o interfaces between computer and peripherals o the memory technology being used So, for example, the fact that a multiply instruction is available is a computer architecture issue. How that multiply is implemented is a computer organization issue. • Architecture is those attributes visible to the programmer o Instruction set, number of bits used for data representation, I/O mechanisms, addressing techniques. o e.g. Is there a multiply instruction? • Organization is how features are implemented o Control signals, interfaces, memory technology. o e.g. Is there a hardware multiply unit or is it done by repeated addition? • All Intel x86 family share the same basic architecture • The IBM System/370 family share the same basic architecture • This gives code compatibility o At least backwards • Organization differs between different versions STRUCTURE AND FUNCTION • Structure is the way in which components relate to each other • Function is the operation of individual components as part of the structure • All computer functions are: o Data processing: Computer must be able to process data which may take a wide variety of forms and the range of processing. o Data storage: Computer stores data either temporarily or permanently.
    [Show full text]
  • Processor-Organaization.Pdf
    Computer Architecture Faculty Of Computers And Information Technology Second Term 2019- 2020 Dr.Khaled Kh. Sharaf Computer Architecture Chapter 7 CENTRAL PROCESSING UNIT ORGANIZATION Computer Architecture OBJECTIVES • Overview • Processor Unit • Control Unit • CPU Structure and Function • Arithmetic and Logic Unit • Instruction Formats • Addressing Modes • Data Transfer and Manipulation • RISC and CISC Computer Architecture Overview The part of the computer that performs the bulk of data processing operations is called the Central Processing Unit (CPU) and is the central component of a digital computer. Its purpose is to interpret instruction cycles received from memory and perform arithmetic, logic and control operations with data stored in internal register, memory words and I/O interface units. A CPU is usually divided into two parts namely processor unit (Register Unit and Arithmetic Logic Unit) and control unit. Register Unit Control Unit Arithmetic logic Unit (ALU) Components of CPU Computer Architecture Processor Unit The processor unit consists of arithmetic unit, logic unit, a number of registers and internal buses that provides data path for transfer of information between register and arithmetic logic unit. The block diagram of processor unit is shown in figure where all registers are connected through common buses. The registers communicate each other not only for direct data transfer but also while performing various micro-operations. Here two sets of multiplexers select register which perform input data for ALU. A decoder selects destination register by enabling its load input. The function select in ALU determines the particular operation that to be performed. Processor Unit Computer Architecture Processor Unit For an example to perform the operation: R3 = R1 + R2 1.
    [Show full text]
  • Computer Architectures an Overview
    Computer Architectures An Overview PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Sat, 25 Feb 2012 22:35:32 UTC Contents Articles Microarchitecture 1 x86 7 PowerPC 23 IBM POWER 33 MIPS architecture 39 SPARC 57 ARM architecture 65 DEC Alpha 80 AlphaStation 92 AlphaServer 95 Very long instruction word 103 Instruction-level parallelism 107 Explicitly parallel instruction computing 108 References Article Sources and Contributors 111 Image Sources, Licenses and Contributors 113 Article Licenses License 114 Microarchitecture 1 Microarchitecture In computer engineering, microarchitecture (sometimes abbreviated to µarch or uarch), also called computer organization, is the way a given instruction set architecture (ISA) is implemented on a processor. A given ISA may be implemented with different microarchitectures.[1] Implementations might vary due to different goals of a given design or due to shifts in technology.[2] Computer architecture is the combination of microarchitecture and instruction set design. Relation to instruction set architecture The ISA is roughly the same as the programming model of a processor as seen by an assembly language programmer or compiler writer. The ISA includes the execution model, processor registers, address and data formats among other things. The Intel Core microarchitecture microarchitecture includes the constituent parts of the processor and how these interconnect and interoperate to implement the ISA. The microarchitecture of a machine is usually represented as (more or less detailed) diagrams that describe the interconnections of the various microarchitectural elements of the machine, which may be everything from single gates and registers, to complete arithmetic logic units (ALU)s and even larger elements.
    [Show full text]
  • Understanding the Linux Kernel, 3Rd Edition by Daniel P
    1 Understanding the Linux Kernel, 3rd Edition By Daniel P. Bovet, Marco Cesati ............................................... Publisher: O'Reilly Pub Date: November 2005 ISBN: 0-596-00565-2 Pages: 942 Table of Contents | Index In order to thoroughly understand what makes Linux tick and why it works so well on a wide variety of systems, you need to delve deep into the heart of the kernel. The kernel handles all interactions between the CPU and the external world, and determines which programs will share processor time, in what order. It manages limited memory so well that hundreds of processes can share the system efficiently, and expertly organizes data transfers so that the CPU isn't kept waiting any longer than necessary for the relatively slow disks. The third edition of Understanding the Linux Kernel takes you on a guided tour of the most significant data structures, algorithms, and programming tricks used in the kernel. Probing beyond superficial features, the authors offer valuable insights to people who want to know how things really work inside their machine. Important Intel-specific features are discussed. Relevant segments of code are dissected line by line. But the book covers more than just the functioning of the code; it explains the theoretical underpinnings of why Linux does things the way it does. This edition of the book covers Version 2.6, which has seen significant changes to nearly every kernel subsystem, particularly in the areas of memory management and block devices. The book focuses on the following topics: • Memory management, including file buffering, process swapping, and Direct memory Access (DMA) • The Virtual Filesystem layer and the Second and Third Extended Filesystems • Process creation and scheduling • Signals, interrupts, and the essential interfaces to device drivers • Timing • Synchronization within the kernel • Interprocess Communication (IPC) • Program execution Understanding the Linux Kernel will acquaint you with all the inner workings of Linux, but it's more than just an academic exercise.
    [Show full text]
  • The Central Processing Unit (CPU)
    The Central Processing Unit (CPU) Crash Course Computer Science #7 The Central Processing Unit https://www.youtube.com/watch?v=FZGugFqdr60 Internals ● Arithmetic Logic Unit (ALU) ● Control Unit (CU) ● Registers ● Cache Memory ● The Fetch-Execute Cycle Arithmetic Logic Unit An arithmetic logic unit (ALU) is a digital circuit used to perform arithmetic and logic ​ operations. It represents the fundamental building block of the central processing unit ​ (CPU) of a computer. Modern CPUs contain very powerful and complex ALUs. In addition to ALUs, modern CPUs contain a control unit (CU). Most of the operations of a CPU are performed by one or more ALUs, which load data from ​ input registers. A register is a small amount of storage available as part of a CPU. The ​ control unit tells the ALU what operation to perform on that data and the ALU stores the result in an output register. The control unit moves the data between these registers, the ALU, and memory. Control Unit A control unit coordinates how data moves around a cpu. The control unit (CU) is a ​ ​ component of a computer's central processing unit (CPU) that directs operation of the processor. It tells the computer's memory, arithmetic/logic unit and input and output devices how to respond to a program's instructions. ● The control unit obtains data / instructions from memory ● Interprets / decodes the instructions into commands / signals ● Controls transfer of instructions and data in the CPU ● Coordinates the parts of the CPU Registers In computer architecture, a processor register is a quickly accessible location available ​ to a digital processor's central processing unit (CPU).
    [Show full text]