From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: X-Archive-Original-Message-ID: <9801091059.ZM16892@dns.rgn.it> Date: Fri, 09 Jan 1998 09:51:47 +0000 From: David Alan Gilbert Subject: Re: Please Explain Traps Just Scott wrote: > > Could someplease explain what unaligned traps are and what causes them. I > get them on my system and so do other users, but they do not seem to cause > problems. Say you want to read an integer which is 4 bytes long from memory; the machine can do this by itself quite happily if the memory address is divisible by 4. If its not divisible by 4 then it has to load two separate integers and munge them together to get the effect of loading some of the bytes from one and some of them from the other one. The hardware won't do this, but what it will do is generate a trap which causes the operating system to go off and do this itself. Generally you probably shouldn't be loading integers which aren't aligned; but there are some cases where it is a REAL pain to avoid it - mainly networking type stuff, but perghaps some graphics stuff as well. On some architectures (x86?) it just works without anyone having to do anything. (Note I don't actually know if the problem is integers on 4 byte boundaries on Alpha but thats the type of problem). Dave -- ---------------------------------------------------------------------- - Dr. David Alan Gilbert - WARNING! This is a beta release .signature- - Work: dg @ cogency.co.uk - 0161-428-9444 - - Home: gro.gilbert @ treblig.org - - ---------------------------------------------------------------------- -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com