Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6194249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:15:51+00:00 2026-05-24T03:15:51+00:00

I like to make an array with mips by means of syscalls but i

  • 0

I like to make an array with mips by means of syscalls but i get the error Error in D:\mips\create array line 20: Runtime exception at 0x00400028: request (1074003968) exceeds available heap storage (syscall 9).

mine code is:

.data
    question1_msg: .asciiz "How much integer do you want to give?\n"
    question2_msg: .asciiz "give a number?\n"
.text

question_numbers:
    la $a0, question1_msg #load the question in $a0
    li $v0, 4
    syscall

answer_numbers: 
    li $v0, 5  #read the anwser of previous question
    syscall
    move $t0, $a0

generate_array:   
    sll $t0, $t0, 2 #create array
    move $a0, $t0
    li $v0, 9
    syscall
    move $t3, $v0 #put the stack pointer in a temperay register

add_numbers_array:
    bge $t1, $t0, exit # if $t1 > $t0 then exit

    #ask questions
    la $a0, question2_msg #load the question in $a0
    li $v0, 4
    syscall

    #read numbers
    li $v0, 5
    syscall
    move $t2, $a0

    #add number en go to the next array point
    sw $t2, ($t3)
    add $t3, $t3, 4

    #get back to the begin of the loop
    b add_numbers_array


exit :
li $v0 , 10 # let the code end
syscall
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:15:52+00:00Added an answer on May 24, 2026 at 3:15 am

    According to this: http://www.doc.ic.ac.uk/lab/secondyear/spim/node8.html the integer returned by syscall 5 is in $v0, so you are passing garbage to the next syscall where you try to allocate memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When you have an array like this: int foo[3][2][2]; and you make: int *bar
Simple task like make AJAX request , pass one parameter and return result, can
I'd like to make a debug logging function with the same parameters as printf
I would like to make a nightly cron job that fetches my stackoverflow page
I would like to make an ajax call to a different server (same domain
I would like to make a child class that has a method of the
I'd like to make status icons for a C# WinForms TreeList control. The statuses
I'd like to make some custom MenuHeaders in WPF so I can have (for
I would like to make a list of remarkable robot simulation environments including advantages
I'd like to make a click event fire on an <input type=file> tag programmatically.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.