Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unaligned Access - MIPS exception

2,532 views
Skip to first unread message

sman...@gmail.com

unread,
Mar 22, 2009, 7:57:48 PM3/22/09
to
Im trying to test my generated code using mips.twoints, but Im getting
a machine exception referred to as unaligned access. Does anyone know
what this is related to?

dr....@gmail.com

unread,
Mar 22, 2009, 8:34:49 PM3/22/09
to
Don't quote me, but you might be lw/sw'ing some address which is not
divisible by 4.

John C Beatty

unread,
Mar 22, 2009, 8:46:09 PM3/22/09
to
In article
<f54f3b01-8c47-4b82...@v37g2000vbb.googlegroups.com>,
sman...@gmail.com wrote:

Generally speaking, it means you're trying to access a value whose
address is supposed to be some multiple of a byte address, but using an
address that is NOT the required multiple.

For example, Patterson and Hennesy state that the MIPS lw and sw
instructions, which move a 4-byte word, must specify an address that's a
multiple of 4 (page 56). Presumably our MIPS emulator obeys this
restriction.

I believe the same is true of MIPS instruction addresses, though I don't
see a statement to that effect in Patterson and Hennesy, and I'm
reasonably certain that I've once or twice seen mips.twoints generate an
unaligned exception by branching to an address that's not a multiple of
4.

Allen

unread,
Mar 30, 2009, 5:49:31 PM3/30/09
to
How would that be possible since branches take offsets?

Lyle Waldman

unread,
Mar 31, 2009, 9:09:04 AM3/31/09
to
Could be a lw/sw.
0 new messages