Discussion:
what's exception 4 and why won't it just leave me alone!?!
(too old to reply)
eugene kashida
2005-10-11 03:28:34 UTC
Permalink
"Exception 4 [Unaligned address in inst/data fetch] caught by trap
handler." is what I get when I try to:

lw $t0, 0($a1)

where $a1 is supposed to be the address of the format string. This
instruction is literally the first instruction that really does anything
in my code. I have not touched $a1 since receiving control from
test.sprintf.s.

What I did was append my sprintf.s code to test.sprintf.s. What am i
doing wrong?
eugene kashida
2005-10-11 04:48:00 UTC
Permalink
nevermind, it was because i was using lw instead of lb...

thanks josh.
"Exception 4 [Unaligned address in inst/data fetch] caught by trap handler."
lw $t0, 0($a1)
where $a1 is supposed to be the address of the format string. This
instruction is literally the first instruction that really does anything in
my code. I have not touched $a1 since receiving control from test.sprintf.s.
What I did was append my sprintf.s code to test.sprintf.s. What am i doing
wrong?
[TA] Michael Le
2005-10-11 04:50:46 UTC
Permalink
You are using lw, does lw require addresses to be divisible by 4?
Check to see what the value is in $a1.

~Michael
"Exception 4 [Unaligned address in inst/data fetch] caught by trap handler."
lw $t0, 0($a1)
where $a1 is supposed to be the address of the format string. This
instruction is literally the first instruction that really does anything in
my code. I have not touched $a1 since receiving control from test.sprintf.s.
What I did was append my sprintf.s code to test.sprintf.s. What am i doing
wrong?
Loading...