Svu Ce450 Spring 2013 Hw #1-Id a3082

download Svu Ce450 Spring 2013 Hw #1-Id a3082

of 9

Transcript of Svu Ce450 Spring 2013 Hw #1-Id a3082

  • 7/29/2019 Svu Ce450 Spring 2013 Hw #1-Id a3082

    1/9

    SVU CE450 Spring 2013

    Homework #1

    Due date: 1/19/2013

    In this homework, you are to get familiar with the MIPS Processor Simulator - SPIM, by followingthe steps as below:

    1. Download and install the SPIM simulator from sourceforge.net, a website that hosts open-sourcesoftware for free, to your personal computer. After installation, take a screen shot of theinstallation completion using screen capture utility snipping tool (for window), and print ahardcopy (proof of your installation)

    2. Run the provided assembly program below with the SPIM simulator, and show the final result ofall CPU registers, Memory content, and program counter. Take a screen shot again, and print

    the hardcopy. Using a high-light marker, point out the PC, r28, r29, and r31 values.

    main.s####################################

    .file 1 "main.c"# .section .mdebug.abi32# .previous# .gnu_attribute 4, 1

    .text

    .align 2# .globl main#.LFB0 = .# .cfi_startproc

    .set nomips16.set nomicromips

    .ent main# .type main, @functionmain:

    .frame $fp,16,$31 # vars= 8, regs= 1/0, args= 0, gp= 0

    .mask 0x40000000,-4

    .fmask 0x00000000,0

    .set noreorder

    .set nomacroaddiu $sp,$sp,-16

    # .cfi_def_cfa_offset 16sw $fp,12($sp)move $fp,$sp

    # .cfi_offset 30, -4# .cfi_def_cfa_register 30

    sw $0,4($fp)sw $0,0($fp)j .L2nop

    .L3:lw $3,4($fp)

  • 7/29/2019 Svu Ce450 Spring 2013 Hw #1-Id a3082

    2/9

    lw $2,0($fp)nopaddu $2,$3,$2sw $2,4($fp)lw $2,0($fp)nop

    addiu $2,$2,1sw $2,0($fp)

    .L2:lw $2,0($fp)nopslt $2,$2,11andi $2,$2,0x00ffbne $2,$0,.L3nop

    lw $2,4($fp)move $sp,$fplw $fp,12($sp)addiu $sp,$sp,16j $31nop

    .set macro

    .set reorder

    .end main# .cfi_endproc#.LFE0:# .size main, .-main# .ident "GCC: (Sourcery CodeBench Lite 2011.09-76) 4.5.2"

    .asm

    CE450 COMPUTER ARCHITECTURE Spring 2013

    ASSIGNMENT 1

  • 7/29/2019 Svu Ce450 Spring 2013 Hw #1-Id a3082

    3/9

    ID Number: A3082Name : Moulika Bandi

    1) Downloading and installing SPIM simulator

    2) Run the program with simulator

    CPU Registers

  • 7/29/2019 Svu Ce450 Spring 2013 Hw #1-Id a3082

    4/9

    Program counter(PC)

    R28,R29,R31 values

  • 7/29/2019 Svu Ce450 Spring 2013 Hw #1-Id a3082

    5/9

    In most processors, PC is incremented after fetching an instruction, and holds the memory address of (points to) the

    next instruction that would be executed. (In a processor where the incrementation precedes the fetch, PC points to the

    current instruction being executed.)

    Memory content:

    Memory content of text and instructions

    Program counter

    http://en.wikipedia.org/wiki/Instruction_(computer_science)http://en.wikipedia.org/wiki/Memory_addresshttp://en.wikipedia.org/wiki/Instruction_(computer_science)http://en.wikipedia.org/wiki/Memory_address
  • 7/29/2019 Svu Ce450 Spring 2013 Hw #1-Id a3082

    6/9

  • 7/29/2019 Svu Ce450 Spring 2013 Hw #1-Id a3082

    7/9

  • 7/29/2019 Svu Ce450 Spring 2013 Hw #1-Id a3082

    8/9

    Kernel text segment

  • 7/29/2019 Svu Ce450 Spring 2013 Hw #1-Id a3082

    9/9

    Summary : 1)downloaded SPIM, captured screen shots2)Run the program with SPIM-CPU registers, program counter and memory content

    screen shots with R28, R29, R31 values are captured

    Note : I am submitting the assignment1 on Jan 23rd as the very first class I have attended is on jan 18th and the

    professor has given one week time. so due date for submitting the assignment is Jan 25th.