Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!kuhub.cc.ukans.edu!markv From: markv@kuhub.cc.ukans.edu Newsgroups: comp.sys.amiga.programmer Subject: Re: Unknown GURU numbers Message-ID: <29030.27dca903@kuhub.cc.ukans.edu> Date: 12 Mar 91 16:10:11 GMT References: <1991Mar10.072019.15764@zorch.SF-Bay.ORG> <910310.075519@lerami.lonestar.org> <2093@public.BTR.COM> Organization: University of Kansas Academic Computing Services Lines: 76 In article <2093@public.BTR.COM>, eeh@public.BTR.COM (Eduardo E. Horvath eeh@btr.com) writes: > In article <1991Mar10.072019.15764@zorch.SF-Bay.ORG>, mike@zorch.SF-Bay.ORG (Mike Smithwick) writes: >>[] > >>Is there a more complete source of GURU numbers than alerts.h? I'm always >>getting ones which aren't listed. Just what the heck is 0x00000003 and >>0x0000000B? > > Thereafter several people answer that thest numbers are generated > by the CPU. What is the algorithm used to generate these numbers? Is it > necessary to memorize a long list of these or is there a simple method to > calculate them, like taking the address of the exception vector and dividing > it by 4? Any guru that begins 0000 is a CPU exception (Motorola terminology), and the number is the Motorola exception vector number and can be found in any Motorola 680x0 assembly manual/book. > Inquiring minds want to know. Common ones are: ( 1 and 2 dont exist) 3 -Bus Error 4 -Address Error 5 -Illegal instruction 6 -Divide by 0 7 -CHK instruction 8 -TRAPV instruction 9 -Privlege violation A -Opcode 1010 Emulation (A-line emulation) B -Opcode 1111 Emulation (F-line emulation) C-17 -Reserved 18 -Spurious interrupt 19-1F -Autovector interrupts 1-7 20-2F -TRAP instruction vectors 30-3F -Reserved 40-FF -User interrupt vectors Quite a bit can be learned from these vectors. 3, 4, 5, A, and B are most often the result of a bad pointer or jumping off into space (corrupt code). If you get 3 on a 68000 and not on a 68020+ then something has misaligned data. A line and F line emulators can be just like bad code, or the presence of coprocessor and/or MMU instructions when said chip isn't present. CHK is used by some languages (like some M2 packages) for array bounds checking, and will guru if a proper handler doesn't get installed. Similar problems with TRAPV and Div by 0 errors. Debuggers will use TRAP vectors for breakpoints, but need to handle the exception. Privlege violation is trying to execute Super mode instruction in user mode. Most commonly the old MOVE SR gotcha on 68010+ processors. NONE of the interrupts should ever guru, since the system should handle them. A spurious interrupt or a user vector should indicates a hardware error, except under Zorro III cards that might possibly use them, in which case you have a bad driver or some such. The only rhyme to the vector numbers is that they are the number of the vector in the exception vector table. Each vector is 4 bytes that is the absolute address of the entry point to the routine that must return with an RTE or otherwise Toast the system. Vectors 0 and 1 are special, they are used as the intial PC and SSP on boot. > > -- > ========================================================================= > Eduardo Horvath eeh@btr.com > ..!{decwrl,mips,fernwood}!btr!eeh > "Trust me, I am cognizant of what I am doing." - Hammeroid -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Mark Gooderum Only... \ Good Cheer !!! Academic Computing Services /// \___________________________ University of Kansas /// /| __ _ Bix: mgooderum \\\ /// /__| |\/| | | _ /_\ makes it Bitnet: MARKV@UKANVAX \/\/ / | | | | |__| / \ possible... Internet: markv@kuhub.cc.ukans.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~