Keith Carolus and Dr. Alphonce

Slides:



Advertisements
Similar presentations
Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
Advertisements

1 Lecture 4: Procedure Calls Today’s topics:  Procedure calls  Large constants  The compilation process Reminder: Assignment 1 is due on Thursday.
Chapter 2 Machine Language.
SPARC Architecture & Assembly Language
Fall EE 333 Lillevik 333f06-l4 University of Portland School of Engineering Computer Organization Lecture 4 Assembly language programming ALU and.
Syscall in MIPS Xinhui Hu Yuan Wang.
MIPS Assembly Language Programming
1 Computer Architecture MIPS Simulator and Assembly language.
The University of Adelaide, School of Computer Science
Assembly Language Working with the CPU.
1 COMS 361 Computer Organization Title: Instructions Date: 9/28/2004 Lecture Number: 10.
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Computer Architecture CPSC 321 E. J. Kim. Overview Logical Instructions Shifts.
RISC Concepts, MIPS ISA and the Mini–MIPS project
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
MIPS Instruction Set Advantages
Joseph L. Lindo Assembly Programming Sir Joseph Lindo University of the Cordilleras.
University of Washington CSE 351 : The Hardware/Software Interface Section 5 Structs as parameters, buffer overflows, and lab 3.
Writing an Assembly-language program Atmel assembly language CS-280 Dr. Mark L. Hornick 1.
Computer Organization - Syscalls David Monismith Jan. 28, 2015 Based on notes from Patterson and Hennessy Text and from Dr. Bill Siever.
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
CS-2710 Dr. Mark L. Hornick 1 Defining and calling procedures (subroutines) in assembly And using the Stack.
Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 7: Assembly Language.
Instruction Set Architecture
Chapter 3 Elements of Assembly Language. 3.1 Assembly Language Statements.
Programmer's view on Computer Architecture by Istvan Haller.
ITEC 352 Lecture 12 ISA(3). Review Buses Memory ALU Registers Process of compiling.
Memory and Addressing How and Where Information is Stored.
The x86 PC Assembly Language, Design, and Interfacing By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey © 2010, 2003, 2000, 1998 Pearson.
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 3 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Csci 136 Computer Architecture II – Summary of MIPS ISA Xiuzhen Cheng
ECEG-3202 Computer Architecture and Organization Chapter 6 Instruction Sets: Addressing Modes and Formats.
Intro to SPIM Justin Fiore Nathan Parish. Installing SPIM on Windows Download pcspim.zip from the SPIM website:
Department of Electronic & Electrical Engineering Lecture 3. ● Template program. ● Introduction to IO ● PORTA PORTB TRISA TRISB ● Using a subroutine ●
LECTURE 3 Translation. PROCESS MEMORY There are four general areas of memory in a process. The text area contains the instructions for the application.
Writing an Assembly-language program MIPS assembly language using MARS: MIPS Assembler and Runtime Simulator CS-2710 Dr. Mark L. Hornick 1.
Computer Organization Exam Review CS345 David Monismith.
Lecture 3 Translation.
Assembly language.
MIPS Instruction Set Advantages
CC410: System Programming
Lecture 4: MIPS Instruction Set
ACOE301: Computer Architecture II Labs
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Procedures (Functions)
William Stallings Computer Organization and Architecture 8th Edition
Java Virtual Machine Complete subject details are available at:
The HP OpenVMS Itanium® Calling Standard
Lecture 4: MIPS Instruction Set
CSCI206 - Computer Organization & Programming
MIPS Instructions.
The University of Adelaide, School of Computer Science
The University of Adelaide, School of Computer Science
ECEG-3202 Computer Architecture and Organization
MIPS History MIPS is a computer family
Instruction encoding The ISA defines Format = Encoding
A Simple Two-Pass Assembler
Instruction encoding The ISA defines Format = Encoding
COMS 361 Computer Organization
UCSD ECE 111 Prof. Farinaz Koushanfar Fall 2018
Instruction encoding The ISA defines Format = Encoding
Instruction Set Principles
8051 ASSEMBLY LANGUAGE PROGRAMMING
Instruction encoding The ISA defines Format = Encoding
CS501 Advanced Computer Architecture
William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats.
Computer Organization and Assembly Language
Computer Architecture and System Programming Laboratory
Some Assembly
Presentation transcript:

Keith Carolus and Dr. Alphonce Smallpond Simulator Keith Carolus and Dr. Alphonce

Keith Carolus Senior computer engineering student keithcarolus.com linkedin.com/in/keithcarolus Previous CSE115/116, CSE341 TA Current CSE379 TA

Simulator Developed as a framework for simulating RISC, non-pipelined ISAs Targeting Smallpond ISA, providing assembler and simulator ~2000 lines of code Verbose assembly error reporting Front end interface with view of memory, registers, and current instruction

Smallpond Simulator From Linux terminal (Bash): Notes: > java -jar SmallpondSimulator.jar input_assembly.s mem_cap output_exec Notes: mem_cap: memory capacity in bytes (optional, default 500) output_exec: output executable (optional) May run jar in Eclipse, demo to come

Smallpond Assembly Syntax C/Java-like single line comments, i.e., prefaced by “//” Mnemonics, operands separated by whitespace and/or commas Registers, mnemonics, flags, condition codes all uppercase Labels expected on line of assembly Instructions described in reference manual

Registers and Register Aliases 32 registers, R0-R31 Aliases: A0-A3 T0-T7 S0-S5 + and - C+ and C- HP, FP, SP LR0-LR3 PC CPSR

Structure of Assembly File DATA block, optional MAIN subroutine, required e.g. DATA my_block BLOCK 50 MAIN ADDI T0, T0, #1 Demo later

Data Section For defining constants 6 types: BLOCK INT HEX BINARY REAL STRING *** all constants are padded to multiple of 4 bytes

Data Section Example my_block BLOCK 50 // a block of memory 50 bytes in size my_block INT 2 // a 32 bit integer of value 2 my_block HEX 0xF // a 32 bit integer of value 15 my_block BINARY 0b1 // a 32 bit integer of value 1 my_block REAL 2.5 // a 64 IEEE-754 standard floating point number of value 2.5 my_block STRING “this is a string” // a variable length string // STRING prefaced by 32 bit integer length in memory

How to Load a Data’s Address 2 instructions, ADDI and LUI e.g. ADDI T0, T0, my_data LUI T0, my_data This is very RISC-like

End of Execution Denoted by a “NOP” instruction Reason: We have no operating system to return to :) Suggested: Place NOP at end of MAIN subroutine and always return back to the MAIN subroutine at the end of your program

Layout in Memory Low addresses Set SP (end of code segment) Set HP (end of memory, grows backwards) Set CPSR (jump to code segment) Data segment Code segment (starting with MAIN) Stack ↓ High addresses Heap ↑

Beta Release This simulator is ~2000 lines of code Many moving parts Let me know if you encounter an issue or have any later questions Piazza kmcarolu@buffalo.edu

Questions?

Importing JAR as Eclipse project https://www.albany.edu/faculty/jmower/geog/gog692/ImportExportJARFiles.htm Main method located in package model.driver, class Driver.java Arguments may be set in “Run configurations...”

Immediates Immediate values are prefaced by ‘#’ and may be: Integer, e.g., #1 Hexadecimal (prefaced by 0x), e.g., #0xF Binary (prefaced by 0b), e.g., #0b1010 Example of usage: ADDI T0, 0, #0xAB

STRING Data Type Note that strings are interpretted literally i.e. there are no escaped characters