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

  • Home
  • SEARCH
  • 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 6719273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:04:24+00:00 2026-05-26T09:04:24+00:00

The programs runs with expected output but with the errors below Code .data .text

  • 0

The programs runs with expected output but with the errors below

Code

.data

.text
.globl main
main: 
  addi $t0, $t0, 0    # i = 0
  addi $t2, $0, 10    # n = 10
  j WhileCond         # goto WhileCond

  WhileLoop:
    li $v0, 1         # print_int
    move $a0, $t0     # $a0 = i (print i)
    addi $t0, $t0, 1
    syscall

  WhileCond:
    blt $t0, $t2, WhileLoop # if i < 10 goto WhileLoop

  j $ra

User Text Segment

[00400000] 21080000  addi $8, $8, 0           ; 10: addi $t0, $t0, 0 # i = 0 
[00400004] 200a000a  addi $10, $0, 10         ; 11: addi $t2, $0, 10 # n = 10 
[00400008] 08100007  j 0x0040001c [WhileCond] ; 12: j WhileCond # goto WhileCond 
[0040000c] 34020001  ori $2, $0, 1            ; 15: li $v0, 1 # print_int 
[00400010] 00082021  addu $4, $0, $8          ; 16: move $a0, $t0 # $a0 = i (print i) 
[00400014] 21080001  addi $8, $8, 1           ; 17: addi $t0, $t0, 1 
[00400018] 0000000c  syscall                  ; 18: syscall 
[0040001c] 010a082a  slt $1, $8, $10          ; 21: blt $t0, $t2, WhileLoop # if i 
[00400020] 1420fffb  bne $1, $0, -20 [WhileLoop-0x00400020] 
[00400024] 03e00008  jr $31                   ; 23: j $ra 

Error

Exception occurred at PC=0x00000000
  Bad address in text read: 0x00000000
Instruction references undefined symbol at 0x800001dc
  [0x800001dc] 0x143a0000  bne $1, $26, 0 [ok_pc-0x800001d8]
  • 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-26T09:04:25+00:00Added an answer on May 26, 2026 at 9:04 am
    addi $t0, $t0, 0    # i = 0
    

    Won’t set $t0 to 0 but rather leave it unchanged. (move $t0, $zero) or (addi $t0, $0, 0) would both work.

    Also are you sure that $t0 and $t2 are preserved in the syscall?

    Lastly the error you posted doesn’t appear to occur in your code. Do you have a stack trace/dump of registers or anything else that might help in tracking it down?

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

Sidebar

Related Questions

below i have a code that runs in most of my simple programs ..
The following C++ program compiles and runs as expected: #include <stdio.h> int main(int argc,
I have a Windows Service written in Delphi which runs a number of programs.
I have a program that runs in a few threads. The main thread shares
It seems at least weird to me... The program runs normally.But after I call
We code in C# using VS2008 SP1. We have a server that runs Team
I'm attempting to translate the following C# code into IronPython but I don't know
I have a Java program that runs a number of other programs. Once the
I am writing a program that runs some unit tests on code that that
I need to smooth some simulated data, but occasionally run into problems when the

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.