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 7865231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:01:26+00:00 2026-06-03T00:01:26+00:00

I am trying to store a integer that i am reading from the user

  • 0

I am trying to store a integer that i am reading from the user into a array, however when i try to store it into my array my data becomes unaligned.

This first block of code is where i initialize all the data. (Under the 1. is where i am trying to store the integer )

'#Constants
P_INT        = 1      #Syscall to print integer(value)
P_STRING     = 4      #Syscall to print a string(addr)
P_CHAR       = 11     #Syscall to print a char(char)
R_INT        = 5      #Syscall to read a integer(none)
EXIT         = 10     #Exit program(none)

'#Data
        .data
newline:
        .asciiz "\n"        

'#Space for the bored.

 1. 
board_rep:
        .space     578

'#The current node to be read in
cur_node:
        .word      0 

'#Size of the bored
size:
        .space     4
'#Plus sign
plus:
        .asciiz "+"
'#dash
dash:
        .asciiz "-"

Right here is where it becomes unaligned (the sw right after 2.) . The strange thing is that i am doing the exact same thing later (in the third code block) except that i am storing it in the size array.

'#Grabs user input for the bored and stores it
get_board_rep: 


        li       $v0,R_INT     '#Read next node and store it    
        syscall 
2.
        sw       $v0,0($s1)

        addi     $s1,$s1,4    ' #Increment next node addr

        lw       $a0,0($s1)
        j        prnt_node

At the store word (under the 3. ) it stores the read in integer fine.

        la        $s0, size      ' #Store the variable addr's
        la        $s1, board_rep  

        li        $v0,R_INT      ' #Get user input(size of bored)
        syscall 
3.
        sw        $v0,0($s0)     ' #Store the size of bored


        jal       get_board_rep      

I thought maybe the array was too large but i changed it to 4 (the same size that the other array that worked). But it still was unaligned.

Thanks in advance . This is a project and i know some people don't like helping with stuff like this. But i have done my homework and i cannot find a answer anywhere.

  • 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-06-03T00:01:28+00:00Added an answer on June 3, 2026 at 12:01 am

    That doesn’t look aligned to me, and if i’m wrong try explicitly aligning it anyway.

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

Sidebar

Related Questions

I am trying to store a string into an integer array with the following
I am trying to store two integer value into an char array in C++.
I'm trying to store a number in django that looks like this: 000001 My
I'm trying to read a text file that contains integers and store them into
I have a C# app that is reading data from a stored procedure and
Im trying to store a list,collection of data objects in Hbase. For example ,a
I'm trying to store a password in a file that I'd like to retrieve
I am trying to store more than 1 data item at a single index
I am trying to store a large amount of boolean information that is determined
I am trying to store a null value into the database but everytime I

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.