data/stack 中的错误地址读取:0x10040000(以 mips 为单位)。查找最多 1000000 个质数

Bad address in data/stack read: 0x10040000 in mips. Find # of prime numbers up to 1000000

我正在尝试查找最多为从用户那里获取的数字的素数。我为此使用 "Sieve of Eratosthenes" 方法 (http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes)。让我们说采取的数字是n。我存储数字 Array1 2,n。 (例如 2,3,4,5...n)。然后我会继续寻找质数的数量,但首先我想找到错误(异常发生在 PC=0x0040004c, data/stack 中的错误地址读取:0x10040000) 继续。此代码现在可以使用,但如果 n<65532。我想找到 n=1000000 但给出了一个错误,我没有找到我的错在哪里。如果有人能帮助我,我很感激...谢谢。

.data 0x10000000
Input:  .asciiz "Please enter an integer number: "
Array1: 
 .word ?
 .text
 .globl main

main:
 addi $t1,[=11=],2
 li $v0,4
 la $a0, Input
 syscall
 li $v0,5
 syscall
 addi $t3,$v0,1
 la $s0,Array1
FirstGenerationNumbers: 
 sw $t1, 0($s0)
 addi $s0,$s0,4
 addi $t1, $t1, 1
 beq $t1, $t3, FinishGeneration
 j FirstGenerationNumbers

FinishGeneration:

 
 jr $ra

Array1: 
    .word ?

我想技术上这可能是一个数组,但它非常小:-)

我想你可能想为你的数组分配一个多一点的字。