Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am failing to understand why this mips assembly code is not working. I am using qtspim to run this code and when I try

I am failing to understand why this mips assembly code is not working. I am using qtspim to run this code and when I try to load it qtspim simply stops responding.

.globl main

.data

Name:

.ascii russelltessier .text

lui $sp 0x80000000 #initialize the stack pointer

main:

addiu $sp,$sp,-48

sw $31,44($sp)

sw $fp,40($sp)

move $fp,$sp

li $2,15 # 0xf

sw $2,32($fp)

sw $0,24($fp)

sw $0,28($fp)

$L5:

lw $3,28($fp)

lw $2,32($fp)

nop

slt $2,$3,$2

beq $2,$0,$L4

nop

lui $2,%hi(Name)

addiu $3,$2,%lo(Name)

lw $2,28($fp)

nop

addu $2,$3,$2

lb $2,0($2)

nop

move $4,$2

jal GetNumber(char)

nop

sw $2,36($fp)

lw $3,24($fp)

lw $2,36($fp)

nop

addu $2,$3,$2

sw $2,24($fp)

lw $2,28($fp)

nop

addiu $2,$2,1

sw $2,28($fp)

b $L5

nop

$L4:

lw $2,24($fp)

move $sp,$fp

lw $31,44($sp)

lw $fp,40($sp)

addiu $sp,$sp,48

j $31

nop

GetNumber(char):

addiu $sp,$sp,-24

sw $fp,20($sp)

move $fp,$sp

move $2,$4

sb $2,24($fp)

lb $2,24($fp)

nop

addiu $2,$2,-96

sw $2,8($fp)

lw $2,8($fp)

move $sp,$fp

lw $fp,20($sp)

addiu $sp,$sp,24

j $31

nop

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago