IWKS 3300: NAND to Tetris Spring John K. Bennett. Assembler

Size: px
Start display at page:

Download "IWKS 3300: NAND to Tetris Spring John K. Bennett. Assembler"

Transcription

1 IWKS 3300: NAND to Tetris Spring 2018 John K. Bennett Assembler Foundations of Global Networked Computing: Building a Modern Computer From First Principles This course is based upon the work of Noam Nisan and Shimon Schocken. More information can be found at (

2 Where We Are Human Thought Abstract design Chapters 9, 12 abstract interface H.L. Language & Operating Sys. Compiler Chapters abstract interface Virtual Machine Software Hierarchy VM Translator Chapters 7-8 abstract interface Assembly Language Assembler Chapter 6 abstract interface Machine Code Computer Architecture Chapters 4-5 Hardware Hierarchy abstract interface Hardware Platform Gate Logic Chapters 1-3 abstract interface Chips & Logic Gates Electrical Engineering Physics

3 Because Why Am I Making You Write an Assembler? Writing an assembler helps cement our understanding of the hardware architecture Assemblers demonstrate several programming techniques useful in language translation Assemblers are relatively simple to write Assemblers are the gateway drug to compiler writing

4 Assembly Example Assembly Source Code // Compute RAM[0] // And store the sum in M=1 // i = 1 M=0 // sum = 0 // if i>ram[0] goto D;JGT... // Etc. assemble Machine Code execute The program translation challenge (for any language translator) Extract the program s semantics from the source program, using the syntax rules of the source language Re-express the program s semantics in the target language, using the syntax rules of the target language An assembler generally translates line by line, making it relatively easy to write Translates each assembly command into one or more binary machine instructions Handles symbols (e.g. i, sum, LOOP, ).

5 Revisiting Hack Low-level Programming Assembly program (sum.asm) // Computes RAM[0] // And stores the sum in M=1 // i = 1 M=0 // sum = 0 // if i>ram[0] goto // sum += i // i++ // goto LOOP 0;JMP M=D // RAM[1] = the sum 0;JMP CPU emulator screen shot after running this program user supplied input program generated output The CPU emulator allows loading and executing symbolic Hack code. It resolves all the symbolic symbols to memory locations, and executes the code.

6 The Assembler s View of an Assembly Program Assembly Program // Computes RAM[0] // And stores the sum in M=1 // i = 1 M=0 // sum = 0 // if i>ram[0] goto // sum += i // i++ // goto LOOP 0;JMP M=D // RAM[1] = the sum 0;JMP The Hack assembly language program is a sequence of text lines, where each line is one of the following: A-instruction ) C-instruction ( dest=comp;jmp ; where dest= and ;jmp are optional) Symbol declaration: (SYMBOL) Comment or white space: // comment The Challenge: Translate the program into a sequence of 16-bit machine code instructions that can be executed by the target hardware platform.

7 Translating / Assembling A-instructions // Where value is either a non-negative decimal number // or a symbol referring to such number. value (v = 0 or 1) Binary: 0 v v v v v v v v v v v v v v v Translation to binary: If value is a non-negative decimal number, just translate to binary If value is a symbol, requires two passes (more later).

8 Translating / Assembling C-instructions Symbolic: dest=comp;jump // Either the dest or jump fields may be empty. // If dest is empty, the "=" is ommitted; // If jump is empty, the ";" is omitted. comp dest jump Binary: a c1 c2 c3 c4 c5 c6 d1 d2 d3 j1 j2 j3

9 Translation by Table Lookup: Example D=D+1;JLE n = 0xE000; // The first 3 bits are 1 int compvalue = 0; if (CTables.compTable.ContainsKey(comp)) compvalue = CTables.compTable[comp]; compvalue = compvalue << 6; } int destvalue = 0; if (dest!= null) if (CTables.destTable.ContainsKey(dest)) destvalue = CTables.destTable[dest]; destvalue = destvalue << 3; } int jumpvalue = 0; if (jump!= null) if (CTables.jumpTable.ContainsKey(jump)) jumpvalue = CTables.jumpTable[jump]; } comptable // a= 0 "D+1", 0x1f}, desttable "D", 2}, jumptable "JLE", 6},

10 Ctables More Detail namespace csasm public class CTables public static Dictionary<string, int> comptable = new Dictionary<string, int>() // a= 0 "0", 0x2a}, "1", 0x3f}, "-1", 0x3a}, "D", 0x0c}, "!D", 0x0d}, "-D", 0x0f}, "D+1", 0x1f}, "1+D", 0x1f}, }; "D&A", 0x00}, "A&D", 0x00}, "D A", 0x15}, "A D", 0x15}, // a = 1 "M", 0x30+0x40}, "!M", 0x31+0x40}, "-M", 0x33+0x40}, "M+1", 0x37+0x40}, "1+M", 0x37+0x40}, "M-1", 0x32+0x40}, "D M", 0x15+0x40}, "M D", 0x15+0x40}

11 Ctables More Detail public static Dictionary<string, int> desttable = new Dictionary<string, int>() // Allow all combinations of these letters (i.e., don't care about order); //this is not done in the book "", 0}, "M", 1}, "D", 2}, "A", 4}, "MD", 3}, "DM", 3}, "AM", 5}, "MA", 5}, "AD", 6}, "DA", 6}, "ADM", 7}, "AMD", 7}, "DAM", 7}, "DMA", 7}, "MAD", 7}, "MDA", 7} };

12 Ctables More Detail public static Dictionary<string, int> jumptable = new Dictionary<string, int>() "", 0}, "JGT", 1}, "JEQ", 2}, "JGE", 3}, "JLT", 4}, "JNE", 5}, "JLE", 6}, "JMP", 7}, }; } }

13 Translation by Table lookup: Example D=D+1;JLE Symbolic: dest=comp;jump // Either the dest or jump fields may be empty. // Assemble the whole instruction (as an integer) // If dest is empty, the "=" is ommitted; // If jump is empty, the ";" is omitted. n = compvalue destvalue jumpvalue; comp dest jump Binary: n = compvalue = destvalue = a c1 c2 c3 c4 c5 c6 d1 d2 d3 j1 j2 j jumpvalue = n = = D=D+1;JLE

14 The Overall Assembly Logic Assembly program // Computes RAM[0] // And stores the sum in M=1 // i = 1 M=0 // sum = 0 // if i>ram[0] goto // sum += i // i++ // goto LOOP 0;JMP M=D // RAM[1] = the sum 0;JMP For each (real) command Parse the command, i.e. break it into its underlying fields A-instruction: replace the symbolic reference (if any) with the corresponding memory address, which is a number (how to do this in a moment) C-instruction: for each field in the instruction, generate the corresponding binary code Assemble the translated binary codes into a complete 16-bit machine instruction Write the 16-bit instruction to the output (text) file.

15 Handling Symbols (symbol resolution) Assembly programs typically have many symbols: Labels that mark destinations of jump commands Labels that mark special memory locations (e.g., SCREEN) Variables These symbols fall into two categories: User defined symbols (created by programmers) Pre-defined symbols (used by the Hack platform) Typical symbolic Hack M=D D;JGT 0;JMP

16 Handling Symbols: User-defined Symbols Label symbols: Used to label destinations of jump commands. Declared by the pseudo-command (XXX). This directive defines the symbol XXX to refer to the instruction memory (ROM) location holding the next command in the program Variable symbols: Any user-defined symbol xxx appearing in an assembly program that is not defined elsewhere using the (xxx) directive is treated as a variable, and is automatically assigned a unique RAM address, starting at RAM address 16 (RAM addresses 0-15 are reserved) By convention, Hack programs use lower-case and upper-case to represent variable and label names, respectively (nothing enforces this convention) These assignments are the responsibility of the assembler, requiring the construction of a symbol table. Typical symbolic Hack M=D D;JGT 0;JMP

17 Handling symbols: Pre-defined Symbols Virtual registers: The symbols R0,, R15 are predefined to refer to RAM addresses 0,,15 I/O pointers: The symbols SCREEN and KBD are predefined to refer to RAM addresses and 24576, respectively (base addresses of the screen and keyboard memory maps) VM control pointers: the symbols SP, LCL, ARG, THIS, and THAT (these do not appear in the code example on the right) are predefined to refer to RAM addresses 0 to 4, respectively (The VM control pointers, which overlap R0,, R4, will come to play in the virtual machine implementation, covered in the next chapter) These assignments are also the responsibility of the assembler, requiring the construction of a symbol table. Typical symbolic Hack M=D D;JGT 0;JMP

18 Handling Symbols: Symbol Table Source code (example) // Computes RAM[0] // And stored the sum in M=1 // i = 1 M=0 // sum = 0 // if i>ram[0] goto // sum += i // i++ // goto LOOP 0;JMP M=D // RAM[1] = the sum 0;JMP Symbol Table R0 0 R1 1 R R15 15 SCREEN KBD SP 0 LCL 1 ARG 2 THIS 3 THAT 4 WRITE 18 END 22 i 16 sum 17 (Note: LOOP is missing) This symbol table is generated by the assembler, and used to translate the symbolic code into binary code.

19 Handling symbols: Constructing the Symbol Table Source code (example) // Computes RAM[0] // And stored the sum in M=1 // i = 1 M=0 // sum = 0 // if i>ram[0] goto // sum += i // i++ // goto LOOP 0;JMP M=D // RAM[1] = the sum 0;JMP Symbol table R0 0 R1 1 R R15 15 SCREEN KBD SP 0 LCL 1 ARG 2 THIS 3 THAT 4 WRITE 18 END 22 i 16 sum 17 Initialization: create an empty symbol table and populate it with all the pre-defined symbols First pass: go through the entire source code, and add all the user-defined label symbols to the symbol table (without generating any code) Second pass: go again through the source code, and use the symbol table to translate all the commands. In the process, handle all the userdefined variable symbols.

20 Symbol Table Initialization (C#) using System.Collections.Generic; // This class creates a symbol table and initializes it. // We also implement the book ST functions. // This is straight from the book, except where noted // Dictionaries in C# make this really easy namespace assembler class SymbolTable public static Dictionary<string, int> symboltable = new Dictionary<string, int>() "SP", 0}, "LCL", 1}, "ARG", 2}, "THIS", 3}, "THAT", 4}, "R0", 0}, "R1", 1}, "R2", 2}, "R3", 3}, "R4", 4}, "R5", 5}, "R6", 6}, "R7", 7}, "R8", 8}, "R9", 9}, "R10", 10}, "R11", 11}, "R12", 12}, "R13", 13}, "R14", 14}, "R15", 15}, "SCREEN", 0x4000}, "KBD", 0x6000} };

21 Symbol Table Functions (C#) public static bool contains(string symbol) return (symboltable.containskey(symbol)); } public static void addentry(string symbol, int address) symboltable.add(symbol, address); } public static int getaddress(string symbol) // We only call this after we check to see that the symbol is present return symboltable[symbol]; }

22 The Assembly Process (in more detail) Initialization: create the symbol table and initialize it with the pre-defined symbols First pass: walk through the source code without generating any code. For each label declaration (LABEL) that appears in the source code, add the pair <LABEL,n > to the symbol table, where n is the current ROM address Second pass: walk again through the source code, and process each line: If the line is a C-instruction, translate as previously described If the line where nnn is a number, create an A instruction If the line and xxx is a symbol, look up xxx in the symbol table and proceed as follows: If xxx is found, create an A instruction using xxx as the numeric value If the symbol is not found, then it must represent a new variable: add the pair <xxx,n > to the symbol table, where n is the next available RAM address, and complete the command s translation. (Platform design decision: the allocated RAM addresses are continuous, starting at address 16).

23 The Result... Source code (example) // Computes RAM[0] // And stored the sum in M=1 // i = 1 M=0 // sum = 0 // if i>ram[0] goto // sum += i // i++ // goto LOOP 0;JMP M=D // RAM[1] = the sum 0;JMP assemble Target code Note that comment lines and pseudo-commands (label declarations) generate no code.

24 Suggested Assembler Implementation An assembler program can be written in any high-level language. The book suggests a language-independent design, as follows. Software modules: Parser: Unpacks each command into its underlying fields Code: Translates each field into its corresponding binary value, and assembles the resulting values SymbolTable: Manages the symbol table Main: Initializes I/O files and drives the show. Suggested implementation stages Stage I: Build a basic assembler for programs with no symbols Stage II: Extend the basic assembler with symbol handling capabilities.

25 Parser (a software module in the assembler program) enum Parser_CommandType Parser_NO_COMMAND=0, Parser_A_COMMAND, Parser_C_COMMAND, Parser_L_COMMAND }; while ((line = file.readline())!= null) // encapsulates the book s "hasmorecommands" and "advance"

26 Parser (a software module in the assembler program) / continued In Pass 1: In Pass 2: switch (commandtype) case Parser_CommandType.Parser_A_COMMAND: case Parser_CommandType.Parser_C_COMMAND: // Command will require one word in the ROM ++romaddr; break; case Parser_CommandType.Parser_L_COMMAND: // The label's address is the current ROM address. // Labels don't require any space in the ROM. SymbolTable.addEntry(symbol, romaddr); break; case Parser_CommandType.Parser_NO_COMMAND: // Do nothing. break; switch (commandtype) case Parser_CommandType.Parser_A_COMMAND: if (SymbolTable.contains(symbol)) n = SymbolTable.getAddress(symbol); } else // Allocate a new RAM variable n = ramaddr++; SymbolTable.addEntry(symbol, n); }

27 Code (a software module in the assembler program) Let s revisit how to translate C Instructions

28 Translating / Assembling C-instructions Symbolic: dest=comp;jump // Either the dest or jump fields may be empty. // If dest is empty, the "=" is ommitted; // If jump is empty, the ";" is omitted. comp dest jump Binary: a c1 c2 c3 c4 c5 c6 d1 d2 d3 j1 j2 j3

29 Translation by Table Lookup: Example D=D+1;JLE n = 0xE000; // The first 3 bits are 1 int compvalue = 0; if (CTables.compTable.ContainsKey(comp)) compvalue = CTables.compTable[comp]; compvalue = compvalue << 6; } int destvalue = 0; if (dest!= null) if (CTables.destTable.ContainsKey(dest)) destvalue = CTables.destTable[dest]; destvalue = destvalue << 3; } int jumpvalue = 0; if (jump!= null) if (CTables.jumpTable.ContainsKey(jump)) jumpvalue = CTables.jumpTable[jump]; } comptable // a= 0 "D+1", 0x1f}, desttable "D", 2}, jumptable "JLE", 6},

30 Translation by Table lookup: Example D=D+1;JLE Symbolic: dest=comp;jump // Either the dest or jump fields may be empty. // Assemble the whole instruction (as an integer) // If dest is empty, the "=" is ommitted; // If jump is empty, the ";" is omitted. n = compvalue destvalue jumpvalue; comp dest jump Binary: n = compvalue = destvalue = a c1 c2 c3 c4 c5 c6 d1 d2 d3 j1 j2 j jumpvalue = n = = D=D+1;JLE

31 SymbolTable (a software module in the assembler program) Note that these in-class examples omit some important logic, e.g., deleting white space and comments, checking that symbols are valid, the numbers in A instructions are within range, how to write a hack file, etc.

32 Example: What Constitutes a Valid Symbol? // Alphabetics, numerics, _. $ : allowed. // Numerics not allowed as first character. // Example code to test symbol validity bool first = true; bool valid = true; int i = 0; int symlen = sym.length; while (valid && (i < symlen)) valid = false; if (!first && sym[i] >= '0' && sym[i] <= '9') valid = true; else if (!first && sym[i] >= '0' && sym[i] <= '9') valid = true; else if (sym[i] >= 'A' && sym[i] <= 'Z') valid = true; else if (sym[i] >= 'a' && sym[i] <= 'z') valid = true; else if (sym[i] == '_' sym[i] == '.' sym[i] == '$' sym[i] == ':') valid = true; i++; first = false;

33 Example: Deal With White Space // Strip comments and white space. char [] outtemp = new char [line.length]; // need a char array since strings are read-only // j is our non-whitespace index int j = 0; for (int i=0; i < line.length; i++) if (line[i] == '/') if (i == line.length - 2) // have to do this first so we don't get an out of bounds //error if the "//" is at the end of the line // end of line "//"; done with this line break; } else if (line[i+1] == '/') // not at end of line but still a comment, so ignore the rest of the line break; } } // not a comment, keep going with this line if (!char.iswhitespace(line,i)) outtemp[j] = line[i]; // only copy if it's not whitespace j++; } } string temp = new string(outtemp); temp = temp.substring(0, j);

34 Perspective Simple machine language, simple assembler Most assemblers are not stand-alone, but rather encapsulated in a higher level language translator Modern compilers have good to excellent optimizers, so we need to code in assembly only in very rare cases. Examples of such cases: real-time systems, which need guaranteed response times; systems with limited memory (e.g., deep space probes); critical I/O functions (e.g., disk drivers); interrupt handlers (requiring careful coordination of multiple tasks). Writing an assembler is good practice for writing more challenging translators, for example, the VM Translator and compiler that we will tackle next.

Assembler. Building a Modern Computer From First Principles.

Assembler. Building a Modern Computer From First Principles. Assembler Building a Modern Computer From First Principles www.nand2tetris.org Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org, Chapter 6: Assembler slide 1 Where we are

More information

Assembler Human Thought

Assembler Human Thought Where we are at: Assembler Human Thought Abstract design Chapters 9, 12 H.L. Language & Operating Sys. Compiler Chapters 10-11 Virtual Machine Software hierarchy VM Translator Chapters 7-8 Assembly Language

More information

Chapter 6: Assembler

Chapter 6: Assembler Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005 www.idc.ac.il/tecs Chapter 6: Assembler Usage and Copyright Notice: Copyright 2005 Noam Nisan and Shimon Schocken This presentation contains

More information

Machine (Assembly) Language

Machine (Assembly) Language Machine (Assembly) Language Building a Modern Computer From First Principles www.nand2tetris.org Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org, Chapter 4: Machine Language

More information

Chapter 6: The Assembler The Assembler Hack Assembly-to-Binary Translation Specification

Chapter 6: The Assembler The Assembler Hack Assembly-to-Binary Translation Specification Chapter 6: The Assembler 1 1. Introduction Work in progress. 6. The Assembler 1 2. Hack Assembly-to-Binary Translation Specification This section gives a complete specification of the translation between

More information

IWKS 2300/5300 Fall John K. Bennett. Machine Language

IWKS 2300/5300 Fall John K. Bennett. Machine Language IWKS 2300/5300 Fall 2017 John K. Bennett Machine Language Assembly Language / Machine Code Abstraction implementation duality: Assembly language (the instruction set architecture) can be viewed as a (sort-of)

More information

Machine (Assembly) Language Human Thought

Machine (Assembly) Language Human Thought Where we are at: Machine (Assembly) Language Human Thought Abstract design hapters 9, 12 abstract interface H.L. Language & Operating Sys. ompiler hapters 10-11 abstract interface Virtual Machine Software

More information

Computer Architecture

Computer Architecture Computer Architecture Building a Modern Computer From First Principles www.nand2tetris.org Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org, Chapter 5: Computer Architecture

More information

STEVEN R. BAGLEY THE ASSEMBLER

STEVEN R. BAGLEY THE ASSEMBLER STEVEN R. BAGLEY THE ASSEMBLER INTRODUCTION Looking at how to build a computer from scratch Started with the NAND gate and worked up Until we can build a CPU Reached the divide between hardware and software

More information

Assembler. Building a Modern Computer From First Principles.

Assembler. Building a Modern Computer From First Principles. Assembler Buldng a Modern Computer From Frst Prncples www.nand2tetrs.org Elements of Computng Systems, Nsan & Schocken, MIT Press, www.nand2tetrs.org, Chapter 6: Assembler slde Where we are at: Human Thought

More information

Virtual Machine. Part I: Stack Arithmetic. Building a Modern Computer From First Principles.

Virtual Machine. Part I: Stack Arithmetic. Building a Modern Computer From First Principles. Virtual Machine Part I: Stack Arithmetic Building a Modern Computer From First Principles www.nand2tetris.org Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org, Chapter 7:

More information

Introduction: From Nand to Tetris

Introduction: From Nand to Tetris Introduction: From Nand to Tetris Building a Modern Computer From First Principles www.nand2tetris.org Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org, Introduction slide

More information

Virtual Machine Where we are at: Part I: Stack Arithmetic. Motivation. Compilation models. direct compilation:... 2-tier compilation:

Virtual Machine Where we are at: Part I: Stack Arithmetic. Motivation. Compilation models. direct compilation:... 2-tier compilation: Where we are at: Virtual Machine Part I: Stack Arithmetic Human Thought Abstract design Chapters 9, 12 H.L. Language & Operating Sys. Compiler Chapters 10-11 Virtual Machine Software hierarchy Translator

More information

Introduction: Hello, World Below

Introduction: Hello, World Below Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005 www.idc.ac.il/tecs Introduction: Hello, World Below Usage and Copyright Notice: Copyright 2005 Noam Nisan and Shimon Schocken This presentation

More information

Virtual Machine. Part II: Program Control. Building a Modern Computer From First Principles.

Virtual Machine. Part II: Program Control. Building a Modern Computer From First Principles. Virtual Machine Part II: Program Control Building a Modern Computer From First Principles www.nand2tetris.org Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org, Chapter 8:

More information

Chapter 11: Compiler II: Code Generation

Chapter 11: Compiler II: Code Generation Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005 Chapter 11: Compiler II: Code Generation www.idc.ac.il/tecs Usage and Copyright Notice: Copyright 2005 Noam Nisan and Shimon Schocken This

More information

Chapter 10: Compiler I: Syntax Analysis

Chapter 10: Compiler I: Syntax Analysis Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005 Chapter 10: Compiler I: Syntax Analysis www.idc.ac.il/tecs Usage and Copyright Notice: Copyright 2005 Noam Nisan and Shimon Schocken This

More information

Compiler II: Code Generation Human Thought

Compiler II: Code Generation Human Thought Course map Compiler II: Code Generation Human Thought Abstract design Chapters 9, 12 abstract interface H.L. Language & Operating Sys. Compiler Chapters 1-11 abstract interface Virtual Machine Software

More information

Chapter 8: Virtual Machine II: Program Control

Chapter 8: Virtual Machine II: Program Control Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005 Chapter 8: Virtual Machine II: Program Control www.idc.ac.il/tecs Usage and Copyright Notice: Copyright 2005 Noam Nisan and Shimon Schocken

More information

Course overview. Introduction to Computer Yung-Yu Chuang. with slides by Nisan & Schocken (

Course overview. Introduction to Computer Yung-Yu Chuang. with slides by Nisan & Schocken ( Course overview Introduction to Computer Yung-Yu Chuang with slides by Nisan & Schocken (www.nand2tetris.org) Logistics Meeting time: 2:20pm-5:20pm, Tuesday Classroom: CSIE Room 101 Instructor: 莊永裕 Yung-Yu

More information

Course overview. Introduction to Computer Yung-Yu Chuang. with slides by Nisan & Schocken (www.nand2tetris.org)

Course overview. Introduction to Computer Yung-Yu Chuang. with slides by Nisan & Schocken (www.nand2tetris.org) Course overview Introduction to Computer Yung-Yu Chuang with slides by Nisan & Schocken (www.nand2tetris.org) Logistics Meeting time: 2:20pm-5:20pm, Tuesday Classroom: CSIE Room 104 Instructor: 莊永裕 Yung-Yu

More information

Motivation. Compiler. Our ultimate goal: Hack code. Jack code (example) Translate high-level programs into executable code. return; } } return

Motivation. Compiler. Our ultimate goal: Hack code. Jack code (example) Translate high-level programs into executable code. return; } } return Motivation Jack code (example) class class Main Main { { static static int int x; x; function function void void main() main() { { Inputs Inputs and and multiplies multiplies two two numbers numbers var

More information

Compiler I: Sytnax Analysis

Compiler I: Sytnax Analysis Elements of Computing Systems, Nisan & Schocken, MIT Press www.idc.ac.il/tecs Compiler I: Sytnax Analysis Usage and Copyright Notice: Copyright 2005 Noam Nisan and Shimon Schocken This presentation contains

More information

Course overview. Introduction to Computer Yung-Yu Chuang. with slides by Nisan & Schocken (

Course overview. Introduction to Computer Yung-Yu Chuang. with slides by Nisan & Schocken ( Course overview Introduction to Computer Yung-Yu Chuang with slides by Nisan & Schocken (www.nand2tetris.org) Logistics Meeting time: 2:20pm-5:20pm, Tuesday Instructor: 莊永裕 Yung-Yu Chuang Webpage: http://www.csie.ntu.edu.tw/~cyy/introcs

More information

Boolean Arithmetic. From Nand to Tetris Building a Modern Computer from First Principles. Chapter 2

Boolean Arithmetic. From Nand to Tetris Building a Modern Computer from First Principles. Chapter 2 From Nand to Tetris Building a Modern Computer from First Principles Chapter 2 Boolean Arithmetic These slides support chapter 2 of the book The Elements of Computing Systems By Noam Nisan and Shimon Schocken

More information

EP1200 Introduktion till datorsystemteknik Tentamen tisdagen den 3 juni 2014, till 18.00

EP1200 Introduktion till datorsystemteknik Tentamen tisdagen den 3 juni 2014, till 18.00 EP1200 Introduktion till datorsystemteknik Tentamen tisdagen den 3 juni 2014, 14.00 till 18.00 Inga hjälpmedel är tillåtna utom de som följer med tentamenstexten Skriv kurskod, namn och personnummer på

More information

Computer Architecture

Computer Architecture IWKS 3300: NAND to Tetris Spring 2018 John K. Bennett Computer Architecture Foundations of Global Networked Computing: Building a Modern Computer From First Principles This course is based upon the work

More information

Computer Architecture

Computer Architecture omputer Architecture Building a Modern omputer From First Principles www.nand2tetris.org Elements of omputing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org, hapter 5: omputer Architecture slide

More information

4 Programing Paradigms in 45 Minutes

4 Programing Paradigms in 45 Minutes 4 Programing Paradigms in 45 Minutes Aja Hammerly () RubyHACK 2018 1 Aja Hammerly http://github.com/thagomizer http://www.thagomizer.com Lawyer Cat Says: Any code is copyright Google and licensed Apache

More information

Compiler I: Syntax Analysis

Compiler I: Syntax Analysis Compiler I: Syntax Analysis Building a Modern Computer From First Principles www.nand2tetris.org Elements of Computing Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org, Chapter 10: Compiler I:

More information

4. Computer Architecture 1

4. Computer Architecture 1 Chapter 4: Computer Architecture 1 4. Computer Architecture 1 Make everything as simple as possible, but not simpler. (Albert Einstein, 1879-1955) This chapter is the pinnacle of the "hardware" part of

More information

4 Programing Paradigms in 45 Minutes

4 Programing Paradigms in 45 Minutes 4 Programing Paradigms in 45 Minutes Aja Hammerly () Ruby Conf 2017 1 Aja Hammerly http://github.com/thagomizer http://www.thagomizer.com Lawyer Cat Says: Any code is copyright Google and licensed Apache

More information

//converts a string to a non-negative number string2int(string s){

//converts a string to a non-negative number string2int(string s){ EP1200 Introduktion till datorsystemteknik Omtenta fredagen den 22 augusti 2014, 9.00 till 13.00 Possible solutions added with red. Other solutions may of course exist and worth full point. Inga hjälpmedel

More information

Harvard University CS 101 Fall 2005, Shimon Schocken. Assembler. Elements of Computing Systems 1 Assembler (Ch. 6)

Harvard University CS 101 Fall 2005, Shimon Schocken. Assembler. Elements of Computing Systems 1 Assembler (Ch. 6) Harvard Unversty CS 101 Fall 2005, Shmon Schocken Assembler Elements of Computng Systems 1 Assembler (Ch. 6) Why care about assemblers? Because Assemblers employ some nfty trcks Assemblers are the frst

More information

EP1200 Introduction to Computing Systems Engineering. Computer Architecture

EP1200 Introduction to Computing Systems Engineering. Computer Architecture EP1200 Introduction to omputing Systems Engineering omputer Architecture Perspective on Machine and Assembly Languages Hack is a simple machine language Designed for the simple Hack computer architecture

More information

Virtual Machine (Part II)

Virtual Machine (Part II) Harvard University CS 101 Fall 2005, Shimon Schocken Virtual Machine (Part II) Elements of Computing Systems 1 Virtual Machine II (Ch. 8) Where we are at: Human Thought Abstract design Chapters 9, 12 H.L.

More information

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette COMP 250: Java Programming I Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette Variables and types [Downey Ch 2] Variable: temporary storage location in memory.

More information

Assembler. Shimon Schocken. Spring Elements of Computing Systems 1 Assembler (Ch. 6) Compiler. abstract interface.

Assembler. Shimon Schocken. Spring Elements of Computing Systems 1 Assembler (Ch. 6) Compiler. abstract interface. IDC Herzlya Shmon Schocken Assembler Shmon Schocken Sprng 2005 Elements of Computng Systems 1 Assembler (Ch. 6) Where we are at: Human Thought Abstract desgn Chapters 9, 12 abstract nterface H.L. Language

More information

Creating a C++ Program

Creating a C++ Program Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer. 1 Creating a C++ Program created using an

More information

Introduction to C# Applications

Introduction to C# Applications 1 2 3 Introduction to C# Applications OBJECTIVES To write simple C# applications To write statements that input and output data to the screen. To declare and use data of various types. To write decision-making

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

7. The Virtual Machine II: Flow Control 1

7. The Virtual Machine II: Flow Control 1 Chapter 7: The Virtual Machine 1 7. The Virtual Machine II: Flow Control 1 It s like building something where you don t have to order the cement. You can create a world of your own, your own environment,

More information

Intel x86 Jump Instructions. Part 5. JMP address. Operations: Program Flow Control. Operations: Program Flow Control.

Intel x86 Jump Instructions. Part 5. JMP address. Operations: Program Flow Control. Operations: Program Flow Control. Part 5 Intel x86 Jump Instructions Control Logic Fly over code Operations: Program Flow Control Operations: Program Flow Control Unlike high-level languages, processors don't have fancy expressions or

More information

6.096 Introduction to C++ January (IAP) 2009

6.096 Introduction to C++ January (IAP) 2009 MIT OpenCourseWare http://ocw.mit.edu 6.096 Introduction to C++ January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Welcome to 6.096 Lecture

More information

CS107 Handout 13 Spring 2008 April 18, 2008 Computer Architecture: Take II

CS107 Handout 13 Spring 2008 April 18, 2008 Computer Architecture: Take II CS107 Handout 13 Spring 2008 April 18, 2008 Computer Architecture: Take II Example: Simple variables Handout written by Julie Zelenski and Nick Parlante A variable is a location in memory. When a variable

More information

Intel x86 Jump Instructions. Part 5. JMP address. Operations: Program Flow Control. Operations: Program Flow Control.

Intel x86 Jump Instructions. Part 5. JMP address. Operations: Program Flow Control. Operations: Program Flow Control. Part 5 Intel x86 Jump Instructions Control Logic Fly over code Operations: Program Flow Control Operations: Program Flow Control Unlike high-level languages, processors don't have fancy expressions or

More information

This lecture presents ordered lists. An ordered list is one which is maintained in some predefined order, such as alphabetical or numerical order.

This lecture presents ordered lists. An ordered list is one which is maintained in some predefined order, such as alphabetical or numerical order. 6.1 6.2 This lecture presents ordered lists. An ordered list is one which is maintained in some predefined order, such as alphabetical or numerical order. A list is numerically ordered if, for every item

More information

We will study the MIPS assembly language as an exemplar of the concept.

We will study the MIPS assembly language as an exemplar of the concept. MIPS Assembly Language 1 We will study the MIPS assembly language as an exemplar of the concept. MIPS assembly instructions each consist of a single token specifying the command to be carried out, and

More information

BASIC ELEMENTS OF A COMPUTER PROGRAM

BASIC ELEMENTS OF A COMPUTER PROGRAM BASIC ELEMENTS OF A COMPUTER PROGRAM CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING LOGO Contents 1 Identifier 2 3 Rules for naming and declaring data variables Basic data types 4 Arithmetic operators

More information

CS2141 Software Development using C/C++ C++ Basics

CS2141 Software Development using C/C++ C++ Basics CS2141 Software Development using C/C++ C++ Basics Integers Basic Types Can be short, long, or just plain int C++ does not define the size of them other than short

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

1 Lexical Considerations

1 Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Decaf Language Thursday, Feb 7 The project for the course is to write a compiler

More information

INTRODUCTION 1 AND REVIEW

INTRODUCTION 1 AND REVIEW INTRODUTION 1 AND REVIEW hapter SYS-ED/ OMPUTER EDUATION TEHNIQUES, IN. Programming: Advanced Objectives You will learn: Program structure. Program statements. Datatypes. Pointers. Arrays. Structures.

More information

The MARIE Architecture

The MARIE Architecture The MARIE Machine Architecture that is Really Intuitive and Easy. We now define the ISA (Instruction Set Architecture) of the MARIE. This forms the functional specifications for the CPU. Basic specifications

More information

Compiler Code Generation COMP360

Compiler Code Generation COMP360 Compiler Code Generation COMP360 Students who acquire large debts putting themselves through school are unlikely to think about changing society. When you trap people in a system of debt, they can t afford

More information

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types

More information

x = 3 * y + 1; // x becomes 3 * y + 1 a = b = 0; // multiple assignment: a and b both get the value 0

x = 3 * y + 1; // x becomes 3 * y + 1 a = b = 0; // multiple assignment: a and b both get the value 0 6 Statements 43 6 Statements The statements of C# do not differ very much from those of other programming languages. In addition to assignments and method calls there are various sorts of selections and

More information

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing Introduction 1 Chapter 5 TH EDITION Lewis & Loftus java Software Solutions Foundations of Program Design 2007 Pearson Addison-Wesley. All rights reserved Focus of the Course Object-Oriented Software Development

More information

McGill University School of Computer Science COMP-202A Introduction to Computing 1

McGill University School of Computer Science COMP-202A Introduction to Computing 1 McGill University School of Computer Science COMP-202A Introduction to Computing 1 Midterm Exam Thursday, October 26, 2006, 18:00-20:00 (6:00 8:00 PM) Instructors: Mathieu Petitpas, Shah Asaduzzaman, Sherif

More information

EMBEDDED SYSTEMS PROGRAMMING Language Basics

EMBEDDED SYSTEMS PROGRAMMING Language Basics EMBEDDED SYSTEMS PROGRAMMING 2015-16 Language Basics "The tower of Babel" by Pieter Bruegel the Elder Kunsthistorisches Museum, Vienna (PROGRAMMING) LANGUAGES ABOUT THE LANGUAGES C (1972) Designed to replace

More information

Chapter 9: High Level Language

Chapter 9: High Level Language Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005 www.idc.ac.il/tecs Chapter 9: High Level Language Usage and Copyright Notice: Copyright 2005 Noam Nisan and Shimon Schocken This presentation

More information

2 rd class Department of Programming. OOP with Java Programming

2 rd class Department of Programming. OOP with Java Programming 1. Structured Programming and Object-Oriented Programming During the 1970s and into the 80s, the primary software engineering methodology was structured programming. The structured programming approach

More information

Hash Table and Hashing

Hash Table and Hashing Hash Table and Hashing The tree structures discussed so far assume that we can only work with the input keys by comparing them. No other operation is considered. In practice, it is often true that an input

More information

CS 11 C track: lecture 8

CS 11 C track: lecture 8 CS 11 C track: lecture 8 n Last week: hash tables, C preprocessor n This week: n Other integral types: short, long, unsigned n bitwise operators n switch n "fun" assignment: virtual machine Integral types

More information

Memory Addressing, Binary, and Hexadecimal Review

Memory Addressing, Binary, and Hexadecimal Review C++ By A EXAMPLE Memory Addressing, Binary, and Hexadecimal Review You do not have to understand the concepts in this appendix to become well-versed in C++. You can master C++, however, only if you spend

More information

COMP 202 Java in one week

COMP 202 Java in one week COMP 202 Java in one week... Continued CONTENTS: Return to material from previous lecture At-home programming exercises Please Do Ask Questions It's perfectly normal not to understand everything Most of

More information

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments. Java How to Program, 9/e Education, Inc. All Rights Reserved. } Java application programming } Use tools from the JDK to compile and run programs. } Videos at www.deitel.com/books/jhtp9/ Help you get started

More information

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved. Assoc. Prof. Dr. Marenglen Biba (C) 2010 Pearson Education, Inc. All rights reserved. Java application A computer program that executes when you use the java command to launch the Java Virtual Machine

More information

What the CPU Sees Basic Flow Control Conditional Flow Control Structured Flow Control Functions and Scope. C Flow Control.

What the CPU Sees Basic Flow Control Conditional Flow Control Structured Flow Control Functions and Scope. C Flow Control. C Flow Control David Chisnall February 1, 2011 Outline What the CPU Sees Basic Flow Control Conditional Flow Control Structured Flow Control Functions and Scope Disclaimer! These slides contain a lot of

More information

Programming (1.0hour)

Programming (1.0hour) COMPETITOR S INSTRUCTION:- Attempt all questions: Where applicable circle the letter that indicates the correct answer. Otherwise answer questions as instructed D1.1 Embedded code is used widely in modern

More information

Maciej Sobieraj. Lecture 1

Maciej Sobieraj. Lecture 1 Maciej Sobieraj Lecture 1 Outline 1. Introduction to computer programming 2. Advanced flow control and data aggregates Your first program First we need to define our expectations for the program. They

More information

BASIC COMPUTER ORGANIZATION. Operating System Concepts 8 th Edition

BASIC COMPUTER ORGANIZATION. Operating System Concepts 8 th Edition BASIC COMPUTER ORGANIZATION Silberschatz, Galvin and Gagne 2009 Topics CPU Structure Registers Memory Hierarchy (L1/L2/L3/RAM) Machine Language Assembly Language Running Process 3.2 Silberschatz, Galvin

More information

Intermediate Code Generation

Intermediate Code Generation Intermediate Code Generation In the analysis-synthesis model of a compiler, the front end analyzes a source program and creates an intermediate representation, from which the back end generates target

More information

Memory, Data, & Addressing II CSE 351 Spring

Memory, Data, & Addressing II CSE 351 Spring Memory, Data, & Addressing II CSE 351 Spring 2018 http://xkcd.com/138/ Review Questions 1) If the word size of a machine is 64-bits, which of the following is usually true? (pick all that apply) a) 64

More information

C Review. MaxMSP Developers Workshop Summer 2009 CNMAT

C Review. MaxMSP Developers Workshop Summer 2009 CNMAT C Review MaxMSP Developers Workshop Summer 2009 CNMAT C Syntax Program control (loops, branches): Function calls Math: +, -, *, /, ++, -- Variables, types, structures, assignment Pointers and memory (***

More information

Decaf Language Reference Manual

Decaf Language Reference Manual Decaf Language Reference Manual C. R. Ramakrishnan Department of Computer Science SUNY at Stony Brook Stony Brook, NY 11794-4400 cram@cs.stonybrook.edu February 12, 2012 Decaf is a small object oriented

More information

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol.

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol. 1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol. B. Outputs to the console a floating point number f1 in scientific format

More information

Assembly Language Manual for the STACK Computer

Assembly Language Manual for the STACK Computer Computer Science 301 1 Assembly Language Manual for the STACK Computer Assembly language programmers should read the hardware description of the STACK computer together with information about the effect

More information

CS 6353 Compiler Construction Project Assignments

CS 6353 Compiler Construction Project Assignments CS 6353 Compiler Construction Project Assignments In this project, you need to implement a compiler for a language defined in this handout. The programming language you need to use is C or C++ (and the

More information

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University Unit 1 Programming Language and Overview of C 1. State whether the following statements are true or false. a. Every line in a C program should end with a semicolon. b. In C language lowercase letters are

More information

Real instruction set architectures. Part 2: a representative sample

Real instruction set architectures. Part 2: a representative sample Real instruction set architectures Part 2: a representative sample Some historical architectures VAX: Digital s line of midsize computers, dominant in academia in the 70s and 80s Characteristics: Variable-length

More information

Sequential Logic. Building a Modern Computer From First Principles.

Sequential Logic. Building a Modern Computer From First Principles. Sequential Logic Buildg a Modern Computer From First Prciples www.nand2tetris.org Elements of Computg Systems, Nisan & Schocken, MIT Press, www.nand2tetris.org, Chapter 3: Sequential Logic slide 1 Usage

More information

GraphQuil Language Reference Manual COMS W4115

GraphQuil Language Reference Manual COMS W4115 GraphQuil Language Reference Manual COMS W4115 Steven Weiner (Systems Architect), Jon Paul (Manager), John Heizelman (Language Guru), Gemma Ragozzine (Tester) Chapter 1 - Introduction Chapter 2 - Types

More information

Lecture 03 Bits, Bytes and Data Types

Lecture 03 Bits, Bytes and Data Types Lecture 03 Bits, Bytes and Data Types Computer Languages A computer language is a language that is used to communicate with a machine. Like all languages, computer languages have syntax (form) and semantics

More information

Building a Virtual Computer

Building a Virtual Computer uilding a Virtual Computer From Gates to Operating System Student Researcher: Elisa Elshamy Faculty Mentor: Dr. Victoria Gitman bstract modern computer can carry a plethora of multifaceted computations.

More information

A Short Summary of Javali

A Short Summary of Javali A Short Summary of Javali October 15, 2015 1 Introduction Javali is a simple language based on ideas found in languages like C++ or Java. Its purpose is to serve as the source language for a simple compiler

More information

DEPARTMENT OF MATHS, MJ COLLEGE

DEPARTMENT OF MATHS, MJ COLLEGE T. Y. B.Sc. Mathematics MTH- 356 (A) : Programming in C Unit 1 : Basic Concepts Syllabus : Introduction, Character set, C token, Keywords, Constants, Variables, Data types, Symbolic constants, Over flow,

More information

Machine Language Instructions Introduction. Instructions Words of a language understood by machine. Instruction set Vocabulary of the machine

Machine Language Instructions Introduction. Instructions Words of a language understood by machine. Instruction set Vocabulary of the machine Machine Language Instructions Introduction Instructions Words of a language understood by machine Instruction set Vocabulary of the machine Current goal: to relate a high level language to instruction

More information

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java Introduction Objectives An overview of object-oriented concepts. Programming and programming languages An introduction to Java 1-2 Problem Solving The purpose of writing a program is to solve a problem

More information

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING CHAPTER 2 8051 ASSEMBLY LANGUAGE PROGRAMMING Registers Register are used to store information temporarily: A byte of data to be processed An address pointing to the data to be fetched The vast majority

More information

Tail Calls. CMSC 330: Organization of Programming Languages. Tail Recursion. Tail Recursion (cont d) Names and Binding. Tail Recursion (cont d)

Tail Calls. CMSC 330: Organization of Programming Languages. Tail Recursion. Tail Recursion (cont d) Names and Binding. Tail Recursion (cont d) CMSC 330: Organization of Programming Languages Tail Calls A tail call is a function call that is the last thing a function does before it returns let add x y = x + y let f z = add z z (* tail call *)

More information

10. The Compiler II: Code Generation 1

10. The Compiler II: Code Generation 1 Chapter 10: The Compiler II: Code Generation 1 10. The Compiler II: Code Generation 1 This document describes the usage and input syntax of the Unix Vax-11 assembler As. As is designed for assembling code

More information

last time Assembly part 2 / C part 1 condition codes reminder: quiz

last time Assembly part 2 / C part 1 condition codes reminder: quiz last time Assembly part 2 / C part 1 linking extras: different kinds of relocations addresses versus offset to addresses dynamic linking (briefly) AT&T syntax destination last O(B, I, S) B + I S + O jmp

More information

Computer Organization & Systems Exam I Example Questions

Computer Organization & Systems Exam I Example Questions Computer Organization & Systems Exam I Example Questions 1. Pointer Question. Write a function char *circle(char *str) that receives a character pointer (which points to an array that is in standard C

More information

8. The C++ language, 1. Programming and Algorithms II Degree in Bioinformatics Fall 2017

8. The C++ language, 1. Programming and Algorithms II Degree in Bioinformatics Fall 2017 8. The C++ language, 1 Programming and Algorithms II Degree in Bioinformatics Fall 2017 Hello world #include using namespace std; int main() { } cout

More information

WYSE Academic Challenge Computer Science Test (State) 2013 Solution Set

WYSE Academic Challenge Computer Science Test (State) 2013 Solution Set WYSE Academic Challenge Computer Science Test (State) 2013 Solution Set 1. Correct Answer: E 2's complement systems are often used in computing because negating a number involves simple operations in the

More information

CMPE-013/L. Introduction to C Programming

CMPE-013/L. Introduction to C Programming CMPE-013/L Introduction to C Programming Bryant Wenborg Mairs Spring 2014 What we will cover in 13/L Embedded C on a microcontroller Specific issues with microcontrollers Peripheral usage Reading documentation

More information

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program Objectives Chapter 2: Basic Elements of C++ In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

Computer Systems and Networks. ECPE 170 Jeff Shafer University of the Pacific. MIPS Assembly

Computer Systems and Networks. ECPE 170 Jeff Shafer University of the Pacific. MIPS Assembly ECPE 170 Jeff Shafer University of the Pacific MIPS Assembly 2 Lab Schedule This Week Activities MIPS discussion Practice problems (whiteboard) Using the QtSPIM simulator Discuss available resources Lab

More information

Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information