Hien Goi
2004-07-17 04:05:18 UTC
bash-2.03$ more test1.mips
.globl main
main: addi $1, $0, 2
addi $2, $0, 3
add $4, $0, $1
trap 1
add $4, $0, $2
trap 1
slt $3, $1, $2
slt $4, $2, $1
nor $1, $3, $4
trap 1
add $4, $3, $0
trap 1
add $4, $1, $0
trap 1
trap 10
bash-2.03$ java mips.mak test1 test1
bash-2.03$ java mips.cpu test1
2301-2bash-2.03$
Why is my final output -2? Shouldn't it be 0?
I tried this code on Ampere and Wirth, and my friend tried it on Watt and we
both get the same 2301-2 result.
Thanks,
Hien.
.globl main
main: addi $1, $0, 2
addi $2, $0, 3
add $4, $0, $1
trap 1
add $4, $0, $2
trap 1
slt $3, $1, $2
slt $4, $2, $1
nor $1, $3, $4
trap 1
add $4, $3, $0
trap 1
add $4, $1, $0
trap 1
trap 10
bash-2.03$ java mips.mak test1 test1
bash-2.03$ java mips.cpu test1
2301-2bash-2.03$
Why is my final output -2? Shouldn't it be 0?
I tried this code on Ampere and Wirth, and my friend tried it on Watt and we
both get the same 2301-2 result.
Thanks,
Hien.