Computer Architecture and Assembly Language

Total Page:16

File Type:pdf, Size:1020Kb

Computer Architecture and Assembly Language Computer Architecture and Assembly Language Gabriel Laskar EPITA 2015 License I Copyright c 2004-2005, ACU, Benoit Perrot I Copyright c 2004-2008, Alexandre Becoulet I Copyright c 2009-2013, Nicolas Pouillon I Copyright c 2014, Joël Porquet I Copyright c 2015, Gabriel Laskar Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being just ‘‘Copying this document’’, no Front-Cover Texts, and no Back-Cover Texts. Introduction Part I Introduction Gabriel Laskar (EPITA) CAAL 2015 3 / 378 Introduction Problem definition 1: Introduction Problem definition Outline Gabriel Laskar (EPITA) CAAL 2015 4 / 378 Introduction Problem definition What are we trying to learn? Computer Architecture What is in the hardware? I A bit of history of computers, current machines I Concepts and conventions: processing, memory, communication, optimization How does a machine run code? I Program execution model I Memory mapping, OS support Gabriel Laskar (EPITA) CAAL 2015 5 / 378 Introduction Problem definition What are we trying to learn? Assembly Language How to “talk” with the machine directly? I Mechanisms involved I Assembly language structure and usage I Low-level assembly language features I C inline assembly Gabriel Laskar (EPITA) CAAL 2015 6 / 378 I Programmers I Wise managers Introduction Problem definition Who do I talk to? I System gurus I Low-level enthusiasts Gabriel Laskar (EPITA) CAAL 2015 7 / 378 I Wise managers Introduction Problem definition Who do I talk to? I System gurus I Low-level enthusiasts I Programmers Gabriel Laskar (EPITA) CAAL 2015 7 / 378 I Wise managers Introduction Problem definition Who do I talk to? I System gurus I Low-level enthusiasts I Programmers C/C++ Gabriel Laskar (EPITA) CAAL 2015 7 / 378 I Wise managers Introduction Problem definition Who do I talk to? I System gurus I Low-level enthusiasts I Programmers C/C++, Objective-C Gabriel Laskar (EPITA) CAAL 2015 7 / 378 I Wise managers Introduction Problem definition Who do I talk to? I System gurus I Low-level enthusiasts I Programmers C/C++, Objective-C, C# Gabriel Laskar (EPITA) CAAL 2015 7 / 378 I Wise managers Introduction Problem definition Who do I talk to? I System gurus I Low-level enthusiasts I Programmers C/C++, Objective-C, C#, Java Gabriel Laskar (EPITA) CAAL 2015 7 / 378 I Wise managers Introduction Problem definition Who do I talk to? I System gurus I Low-level enthusiasts I Programmers C/C++, Objective-C, C#, Java, JS/AS Gabriel Laskar (EPITA) CAAL 2015 7 / 378 I Wise managers Introduction Problem definition Who do I talk to? I System gurus I Low-level enthusiasts I Programmers at any level: (C/C++, Objective-C, C#, Java, JS/AS, etc.) Gabriel Laskar (EPITA) CAAL 2015 7 / 378 Introduction Problem definition Who do I talk to? I System gurus I Low-level enthusiasts I Programmers at any level: (C/C++, Objective-C, C#, Java, JS/AS, etc.) I Wise managers Gabriel Laskar (EPITA) CAAL 2015 7 / 378 Introduction Outline 1: Introduction Problem definition Outline Gabriel Laskar (EPITA) CAAL 2015 8 / 378 Introduction Outline Course outline I Processor architecture I Memory I Memory mapping I Execution flow I Object file formats I Assembly programming I Focus on x86 I Focus on RISC processors I CPU-aware optimizations I Multi-/Many-core, heterogeneous systems Gabriel Laskar (EPITA) CAAL 2015 9 / 378 Processor architecture Part II Processor architecture Gabriel Laskar (EPITA) CAAL 2015 10 / 378 Processor architecture Overview 2: Processor architecture Overview Inside the processor Processor units Instructions Instruction flow Pipeline processor CISC & RISC architectures Gabriel Laskar (EPITA) CAAL 2015 11 / 378 Let’s design it! Processor architecture Overview What a processor is... A processor must be able to perform the following basic tasks: I Execute instructions I Read operands I Store results It needs several basic units to perform those tasks: I A control unit I An arithmetic and logical unit (ALU) I A register bank Gabriel Laskar (EPITA) CAAL 2015 12 / 378 Processor architecture Overview What a processor is... A processor must be able to perform the following basic tasks: I Execute instructions I Read operands I Store results It needs several basic units to perform those tasks: I A control unit I An arithmetic and logical unit (ALU) I A register bank Let’s design it! Gabriel Laskar (EPITA) CAAL 2015 12 / 378 Processor architecture Overview Basic architecture R0 R1 R2 = 0123 R3 = 0100 R4 = 0023 R5 Registers ALU Control Unit Gabriel Laskar (EPITA) CAAL 2015 13 / 378 Unfortunately, I Internal memory is expensive and hard to design I There is no communication I Updating the program may not be easy We need an access to memory, external devices, etc. Processor architecture Overview Basic architecture (2) In this model, the system state is entirely contained in the processor. I This might be sufficient for a very basic processor I More features could be leveraged by adding registers or program steps Gabriel Laskar (EPITA) CAAL 2015 14 / 378 We need an access to memory, external devices, etc. Processor architecture Overview Basic architecture (2) In this model, the system state is entirely contained in the processor. I This might be sufficient for a very basic processor I More features could be leveraged by adding registers or program steps Unfortunately, I Internal memory is expensive and hard to design I There is no communication I Updating the program may not be easy Gabriel Laskar (EPITA) CAAL 2015 14 / 378 Processor architecture Overview Basic architecture (2) In this model, the system state is entirely contained in the processor. I This might be sufficient for a very basic processor I More features could be leveraged by adding registers or program steps Unfortunately, I Internal memory is expensive and hard to design I There is no communication I Updating the program may not be easy We need an access to memory, external devices, etc. Gabriel Laskar (EPITA) CAAL 2015 14 / 378 It needs several basic units to perform those tasks: I A control unit I An arithmetic and logical unit (ALU) I A register bank I A program memory access I A data memory access Processor architecture Overview Revised processor model A processor must be able to perform the following basic tasks: I Fetch instructions from an external entity and understand them (fetch and decode) I Execute instructions I Store results to registers or external memory Gabriel Laskar (EPITA) CAAL 2015 15 / 378 Processor architecture Overview Revised processor model A processor must be able to perform the following basic tasks: I Fetch instructions from an external entity and understand them (fetch and decode) I Execute instructions I Store results to registers or external memory It needs several basic units to perform those tasks: I A control unit I An arithmetic and logical unit (ALU) I A register bank I A program memory access I A data memory access Gabriel Laskar (EPITA) CAAL 2015 15 / 378 Processor architecture Overview Revised processor model (2) R0 R1 R2 = 0123 R3 = 0100 R4 = 0023 R5 Registers ALU Control Unit Instruction @ Code Command R Data Data @ W Data Gabriel Laskar (EPITA) CAAL 2015 16 / 378 Processor architecture Overview Processor physical layout A processor is composed of many different units: I Caches, MMU I Integer unit, Control unit, Floating-point unit Each unit is: I implemented as an hardware component I made of switchable parts (transistors) In old processors: I Units used to be independent chips I Some were even optional “coprocessors” Today, processors are embedded on a single chip. Gabriel Laskar (EPITA) CAAL 2015 17 / 378 Processor architecture Inside the processor 2: Processor architecture Overview Inside the processor Processor units Instructions Instruction flow Pipeline processor CISC & RISC architectures Gabriel Laskar (EPITA) CAAL 2015 18 / 378 Processor architecture Inside the processor Processor package Gabriel Laskar (EPITA) CAAL 2015 19 / 378 Processor architecture Inside the processor Processor physical layout Gabriel Laskar (EPITA) CAAL 2015 20 / 378 Processor architecture Inside the processor Processor physical layout Gabriel Laskar (EPITA) CAAL 2015 21 / 378 Processor architecture Inside the processor Processor physical layout Transistor details Gabriel Laskar (EPITA) CAAL 2015 22 / 378 Processor architecture Processor units 2: Processor architecture Overview Inside the processor Processor units Instructions Instruction flow Pipeline processor CISC & RISC architectures Gabriel Laskar (EPITA) CAAL 2015 23 / 378 Processor architecture Processor units Units R0 R1 R2 = 0123 R3 = 0100 I Control unit fetches and R4 = 0023 decodes the instruction R5 Registers I Registers gives the data I ALU implements the operation ALU I Some instructionsControl Unit access external data Instruction @ Code Command R Data Data @ W Data Gabriel Laskar (EPITA) CAAL 2015 24 / 378 Processor architecture Processor units Registers May be seen as variables located inside the processor I 8, 16, 32, 64, 128, ... -bits large I General-purpose registers: I integer (int) I floating point (float, double) I Specialized registers: I flags I Zero, I Negative, I Carry, I Overflow, I etc. I system I Mode, I IRQ masking, I etc. Gabriel Laskar (EPITA) CAAL 2015 25 / 378 Processor architecture Processor units ALU: Arithmetic and Logical Unit An unit without registers! I Logical operations I AND, OR, XOR, NOT, NOR I Arithmetic operations I addition, subtraction, multiplication,
Recommended publications
  • Also Includes Slides and Contents From
    The Compilation Toolchain Cross-Compilation for Embedded Systems Prof. Andrea Marongiu ([email protected]) Toolchain The toolchain is a set of development tools used in association with source code or binaries generated from the source code • Enables development in a programming language (e.g., C/C++) • It is used for a lot of operations such as a) Compilation b) Preparing Libraries Most common toolchain is the c) Reading a binary file (or part of it) GNU toolchain which is part of d) Debugging the GNU project • Normally it contains a) Compiler : Generate object files from source code files b) Linker: Link object files together to build a binary file c) Library Archiver: To group a set of object files into a library file d) Debugger: To debug the binary file while running e) And other tools The GNU Toolchain GNU (GNU’s Not Unix) The GNU toolchain has played a vital role in the development of the Linux kernel, BSD, and software for embedded systems. The GNU project produced a set of programming tools. Parts of the toolchain we will use are: -gcc: (GNU Compiler Collection): suite of compilers for many programming languages -binutils: Suite of tools including linker (ld), assembler (gas) -gdb: Code debugging tool -libc: Subset of standard C library (assuming a C compiler). -bash: free Unix shell (Bourne-again shell). Default shell on GNU/Linux systems and Mac OSX. Also ported to Microsoft Windows. -make: automation tool for compilation and build Program development tools The process of converting source code to an executable binary image requires several steps, each with its own tool.
    [Show full text]
  • Risc I: a Reduced Instruction Set Vlsi Computer
    RISC I: A REDUCED INSTRUCTION SET VLSI COMPUTER DAVID A. PATTERSON and CARLO H. SEQUIN Computer Science Division University of California Berkeley, California ABSTRACT to implement CISC is the best way to use this “scarce” resource. The Reduced Instruction Set Computer (RISC) Project investigates an alternatrve to the general trend toward computers wrth increasingly complex instruction sets: With a The above findings led to the Reduced Instruction Set proper set of instructions and a corresponding architectural Computer (RISC) Project. The purpose of the project is design, a machine wrth a high effective throughput can be to explore alternatives to the general trend toward achieved. The simplicity of the instruction set and addressing architectural complexity. The hypothesis is that by modes allows most Instructions to execute in a single machine cycle, and the srmplicity of each instruction guarantees a short reducing the instruction set, VLSI architecture can be cycle time. In addition, such a machine should have a much designed that uses the scarce resources more effectively shorter design trme. than CISC. We also expect this approach to reduce design time, the number of design errors, and the This paper presents the architecture of RISC I and its novel execution time of individual instructions. hardware support scheme for procedure call/return. Overlapprng sets of regrster banks that can pass parameters directly to subrouttnes are largely responsible for the excellent Our initial version of such a computer is called RISC I. performance of RISC I. Static and dynamtc comparisons To meet our goals of simplicity and effective single-chip between this new architecture and more traditional machines implementation, we placed the following “constraints” are given.
    [Show full text]
  • Compiler Construction
    Compiler Construction Chapter 11 Compiler Construction Compiler Construction 1 A New Compiler • Perhaps a new source language • Perhaps a new target for an existing compiler • Perhaps both Compiler Construction Compiler Construction 2 Source Language • Larger, more complex languages generally require larger, more complex compilers • Is the source language expected to evolve? – E.g., Java 1.0 ! Java 1.1 ! . – A brand new language may undergo considerable change early on – A small working prototype may be in order – Compiler writers must anticipate some amount of change and their design must therefore be flexible – Lexer and parser generators (like Lex and Yacc) are therefore better than hand- coding the lexer and parser when change is inevitable Compiler Construction Compiler Construction 3 Target Language • The nature of the target language and run-time environment influence compiler construction considerably • A new processor and/or its assembler may be buggy Buggy targets make it difficult to debug compilers for that target! • A successful source language will persist over several target generations – E.g., 386 ! 486 ! Pentium ! . – Thus the design of the IR is important – Modularization of machine-specific details is also important Compiler Construction Compiler Construction 4 Compiler Performance Issues • Compiler speed • Generated code quality • Error diagnostics • Portability • Maintainability Compiler Construction Compiler Construction 5 Compiler Speed • Reduce the number of modules • Reduce the number of passes Perhaps generate machine
    [Show full text]
  • VME for Experiments Chairman: Junsei Chiba (KEK)
    KEK Report 89-26 March 1990 D PROCEEDINGS of SYMPOSIUM on Data Acquisition and Processing for Next Generation Experiments 9 -10 March 1989 KEK, Tsukuba Edited by H. FUJII, J. CHIBA and Y. WATASE NATIONAL LABORATORY FOR HIGH ENERGY PHYSICS PROCEEDINGS of SYMPOSIUM on Data Acquisition and Processing for Next Generation Experiments 9 - 10 March 1989 KEK, Tsukuba Edited H. Fiflii, J. Chiba andY. Watase i National Laboratory for High Energy Physics, 1990 KEK Reports are available from: Technical Infonnation&Libraiy National Laboratory for High Energy Physics 1-1 Oho, Tsukuba-shi Ibaraki-ken, 305 JAPAN Phone: 0298-64-1171 Telex: 3652-534 (Domestic) (0)3652-534 (International) Fax: 0298-64-4604 Cable: KEKOHO Foreword This symposium has been organized to foresee the next generation of data acquisition and processing system in high energy physics and nuclear physics experiments. The recent revolutionary progress in the semiconductor and computer technologies is giving us an oppotunity to extend our idea on the experiments. The high density electronics of LSI technology provides an ideal front-end electronics such as readout circuits for silicon strip detector and multi-anode phototubes as well as wire chambers. The VLSI technology has advantages over the obsolite discrete one in the various aspects ; reduction of noise, small propagation delay, lower power dissipation, small space for the installation, improvement of the system reliability and maintenability. The small sized front-end electronics will be mounted just on the detector and the digital data might be transfered off the detector to the computer room with optical fiber data transmission lines. Then, a monster of bandies of signal cables might disappear from the experimental area.
    [Show full text]
  • MIPS Assembly Language Programming Using Qtspim
    MIPS Assembly Language Programming using QtSpim Ed Jorgensen, Ph.D. Version 1.1.50 July 2019 Cover image: MIPS R3000 Custom Chip http://commons.wikimedia.org/wiki/File:RCP-NUS_01.jpg Spim is copyrighted by James Larus and distributed under a BSD license. Copyright (c) 1990-2011, James R. Larus. All rights reserved. Copyright © 2013, 2014, 2015, 2016, 2017 by Ed Jorgensen You are free: To Share — to copy, distribute and transmit the work To Remix — to adapt the work Under the following conditions: Attribution — you must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Noncommercial — you may not use this work for commercial purposes. Share Alike — if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one. Table of Contents 1.0 Introduction...........................................................................................................1 1.1 Additional References.........................................................................................1 2.0 MIPS Architecture Overview..............................................................................3 2.1 Architecture Overview........................................................................................3 2.2 Data Types/Sizes.................................................................................................4 2.3 Memory...............................................................................................................4
    [Show full text]
  • Design of the RISC-V Instruction Set Architecture
    Design of the RISC-V Instruction Set Architecture Andrew Waterman Electrical Engineering and Computer Sciences University of California at Berkeley Technical Report No. UCB/EECS-2016-1 http://www.eecs.berkeley.edu/Pubs/TechRpts/2016/EECS-2016-1.html January 3, 2016 Copyright © 2016, by the author(s). All rights reserved. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission. Design of the RISC-V Instruction Set Architecture by Andrew Shell Waterman A dissertation submitted in partial satisfaction of the requirements for the degree of Doctor of Philosophy in Computer Science in the Graduate Division of the University of California, Berkeley Committee in charge: Professor David Patterson, Chair Professor Krste Asanovi´c Associate Professor Per-Olof Persson Spring 2016 Design of the RISC-V Instruction Set Architecture Copyright 2016 by Andrew Shell Waterman 1 Abstract Design of the RISC-V Instruction Set Architecture by Andrew Shell Waterman Doctor of Philosophy in Computer Science University of California, Berkeley Professor David Patterson, Chair The hardware-software interface, embodied in the instruction set architecture (ISA), is arguably the most important interface in a computer system. Yet, in contrast to nearly all other interfaces in a modern computer system, all commercially popular ISAs are proprietary.
    [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]
  • Embedded Firmware Development Languages/Options
    Module -4 Embedded System Design Concepts Characteristics & Quality Attributes of Embedded Systems Characteristics of Embedded System Each Embedded System possess a set of characteristics which are unique to it. Some important characteristics of embedded systems are: Application & Domain Specific Reactive & Real Time Operates in ‘harsh’ environment Distributed Small size and Weight Power Concerns Quality Attributes of Embedded Systems: Represent the non-functional requirements that needs to be addressed in the design of an embedded system. The various quality attributes that needs to be addressed in any embedded system development are broadly classified into Operational Quality Attributes Refers to the relevant quality attributes related to tan embedded system when it is in the operational mode or ‘online ’ mode Non-Operational Quality Attributes The Quality attributes that needs to be addressed for the product ‘not’ on the basis of operational aspects are grouped under this category Operational Quality Attributes Response Throughput Reliability Maintainability Security Safety Non-Operational Quality Attributes Testability & Debug-ability Evolvability Portability Time to Prototype and Market Per Unit and Total Cost Washing Machine – Application Specific Embedded System V Extensively used in Home Automation for washing and drying clothes V Contains User Interface units (I/O) like Keypads, Display unit, LEDs for accepting user inputs and providing visual indications V Contains sensors like, water level sensor, temperature
    [Show full text]
  • Assembly Language Programming by James and Jarrod Parkes Abstract
    Technical Course Curriculum and Annotated Bibliography CS308: Assembly Language Programming By James and Jarrod Parkes Abstract At the University of Alabama in Huntsville, the Computer Science (CS) Department is facing a decreased student interest in their CS 308 assembly language course. As a result, this new course curriculum and annotated bibliography have been created to restore excitement into the program. Since today's students are seeking innovative applications for programming, this curriculum teaches the 6502 assembly language with a focus on the Nintendo Entertainment System (NES)--a vintage video game console. While linearly covering the required assembly language material, this curriculum incorporates interactive examples from classic NES titles such as Super Mario and The Legend of Zelda. With this curriculum, CS professors are also given the tools to guiding students through the development of their very own NES video games. By the end of the curriculum, professors will be fully equipped to teach the 6502 assembly language while providing students the rewarding experience of game development. Additionally, the annotated bibliography includes supplementary texts and online articles to help reinforce topics for professors and students. Source: Google Images ii Table of Contents Introduction to the Assembly Language Course....................................................... 1! What is an Assembly Language? .................................................................................. 1! How is this Course Structured?...................................................................................
    [Show full text]
  • Ultrasparc Architecture 2007
    UltraSPARC Architecture 2007 One Architecture ... Multiple Innovative Implementations Draft D0.9.4, 27 Sep 2010 Privilege Levels: Hyperprivileged, Privileged, and Nonprivileged Distribution: Public Part No.No: 950-5554-15 ReleaseRevision: 1.0, Draft 2002 D0.9.4, 27 Sep 2010 Oracle Corporation 4150 Network Circle Santa Clara, CA 95054 U.S.A. 650-960-1300 ii UltraSPARC Architecture 2007 • Draft D0.9.4, 27 Sep 2010 Copyright © 2007, 2011, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. UNIX is a registered trademark licensed through X/Open Company, Ltd.. Comments and "bug reports” regarding this document are welcome; they should be submitted to email address: [email protected] iv UltraSPARC Architecture 2007 • Draft D0.9.4, 27 Sep 2010 Contents Preface. i 1 Document Overview . 1 1.1 Navigating UltraSPARC Architecture 2007 . 1 1.2 Fonts and Notational Conventions . 2 1.2.1 Implementation Dependencies . 3 1.2.2 Notation for Numbers. 3 1.2.3 Informational Notes . 3 1.3 Reporting Errors in this Specification . 4 2 Definitions . 5 3 Architecture Overview. 15 3.1 The UltraSPARC Architecture 2007. 15 3.1.1 Features. 15 3.1.2 Attributes . 16 3.1.2.1 Design Goals .
    [Show full text]
  • Chapter 1 Basic Principles of Programming Languages
    Chapter 1 Basic Principles of Programming Languages Although there exist many programming languages, the differences among them are insignificant compared to the differences among natural languages. In this chapter, we discuss the common aspects shared among different programming languages. These aspects include: programming paradigms that define how computation is expressed; the main features of programming languages and their impact on the performance of programs written in the languages; a brief review of the history and development of programming languages; the lexical, syntactic, and semantic structures of programming languages, data and data types, program processing and preprocessing, and the life cycles of program development. At the end of the chapter, you should have learned: what programming paradigms are; an overview of different programming languages and the background knowledge of these languages; the structures of programming languages and how programming languages are defined at the syntactic level; data types, strong versus weak checking; the relationship between language features and their performances; the processing and preprocessing of programming languages, compilation versus interpretation, and different execution models of macros, procedures, and inline procedures; the steps used for program development: requirement, specification, design, implementation, testing, and the correctness proof of programs. The chapter is organized as follows. Section 1.1 introduces the programming paradigms, performance, features, and the development of programming languages. Section 1.2 outlines the structures and design issues of programming languages. Section 1.3 discusses the typing systems, including types of variables, type equivalence, type conversion, and type checking during the compilation. Section 1.4 presents the preprocessing and processing of programming languages, including macro processing, interpretation, and compilation.
    [Show full text]
  • Processor Architectures
    CS143 Handout 18 Summer 2008 30 July, 2008 Processor Architectures Handout written by Maggie Johnson and revised by Julie Zelenski. Architecture Vocabulary Let’s review a few relevant hardware definitions: register: a storage location directly on the CPU, used for temporary storage of small amounts of data during processing. memory: an array of randomly accessible memory bytes each identified by a unique address. Flat memory models, segmented memory models, and hybrid models exist which are distinguished by the way locations are referenced and potentially divided into sections. instruction set: the set of instructions that are interpreted directly in the hardware by the CPU. These instructions are encoded as bit strings in memory and are fetched and executed one by one by the processor. They perform primitive operations such as "add 2 to register i1", "store contents of o6 into memory location 0xFF32A228", etc. Instructions consist of an operation code (opcode) e.g., load, store, add, etc., and one or more operand addresses. CISC: Complex instruction set computer. Older processors fit into the CISC family, which means they have a large and fancy instruction set. In addition to a set of common operations, the instruction set has special purpose instructions that are designed for limited situations. CISC processors tend to have a slower clock cycle, but accomplish more in each cycle because of the sophisticated instructions. In writing an effective compiler back-end for a CISC processor, many issues revolve around recognizing how to make effective use of the specialized instructions. RISC: Reduced instruction set computer. Many modern processors are in the RISC family, which means they have a relatively lean instruction set, containing mostly simple, general-purpose instructions.
    [Show full text]