Path: utzoo!attcan!uunet!seismo!esosun!ucsdhub!jack!elgar!ford From: ford@elgar.UUCP (Mike "Ford" Ditto) Newsgroups: comp.sys.m68k Subject: opcode emulation (Was: Re: 68020 in a *68010* socket?) Summary: is 68020 emulation on 68010 really possible? Message-ID: <182@elgar.UUCP> Date: 11 Jun 88 07:08:11 GMT References: <17206@gatech.edu> <10123@mcdchg.UUCP> <17479@glacier.STANFORD.EDU> <6276@cup.portal.com> <17482@glacier.STANFORD.EDU> Reply-To: ford@kenobi.UUCP (Mike "Ford" Ditto) Organization: Omnicron Data Systems, Bonita, CA Lines: 39 Speaking of 68020/881 emulation, has anyone ever implemented a complete 68020-instruction emulation on the 68010? The reason I ask is that I encountered a surprising inconsistency in the handling of illegal opcodes on the 68010. I compiled some C code using GNU CC with the 68020/68881 option on, and ran the executable on an AT&T Unix PC (68010). Most of the 68020/881 instructions resulted in the expected result (illegal instruction in the case of new 020 ops, f-line emulator trap for 881 instructions). These resulted in SIGILL (illegal instruction) and SIGEMT (emulator trap) exceptions under Unix. What doesn't seem right is what happened for an instruction that used the new scaled index 68020 addressing mode. The opcode looks almost the same, except where there were required zeroes on the 68010, the 68020 has two bits to specify a scale amount for the index register. When I ran this opcode (with a scale value of 4, incompatible with the 68010) on the 68010, the result was a *bus error*. Now, all I know is that Unix sent the process a SIGBUS (bus error), so I don't know for sure what the 68010 exception number was. But I don't think Unix would have any reason to turn an illegal instruction exception into a SIGBUS. Is it possible that the 010 gives a bus error for some illegal opcodes? I do remember reading in the 68000 spec that ALL unimplemented opcodes are supposed to give an illegal instruction exception or an emulator trap exception. Does anyone know whether the 68010 is consistent in reporting illegal instructions? If not, it would seem difficult to emulate the 020 instruction set (having to check bus errors for illegal addressing modes would be pretty bogus). -=] Ford [=- "Once there were parking lots, (In Real Life: Mike Ditto) now it's a peaceful oasis. ford%kenobi@crash.CTS.COM This was a Pizza Hut, ...!sdcsvax!crash!kenobi!ford now it's all covered with daisies." -- Talking Heads