jskuskin@eleazar.dartmouth.edu (Jeffrey Kuskin) (10/09/89)
I admit to ignorance in the following area, so please bear with me. I need to write a disassembler for the Mac (the 68000 only, to be specific). Could someone point me in the right direction in terms of how to decode the opcodes. I understand the decoding process (extension words, addressing modes, etc.), but am unsure how to efficiently read an instruction stream and generate the proper mnemonics. Do I just grap the next opcode, decode it bit by bit (or in groups of 3 or 4 bits) and then, once I have the instruction determined, read the necessary extension word(s)? Or is it possible to use some sort of hashing function to get the instruction type? Advice and/or code would be appreciated. Thanks. -- Jeff Kuskin, Dartmouth College E-Mail: jskuskin@eleazar.dartmouth.edu
earleh@eleazar.dartmouth.edu (Earle R. Horton) (10/09/89)
In article <15994@dartvax.Dartmouth.EDU> jskuskin@eleazar.dartmouth.edu (Jeffrey Kuskin) writes: >I admit to ignorance in the following area, so please >bear with me. > >I need to write a disassembler for the Mac (the 68000 >only, to be specific). Could someone point me in the >right direction in terms of how to decode the opcodes. Look at this: pascal void Disassembler(long DstAdjust,short *BytesUsed,Ptr FirstByte, char *Opcode,char *Operand,char *Comment,Ptr LookUpProc); /* Disassembler is a Pascal routine to be called to disassemble a sequence of bytes... This is from the C language header file for the Disassembler module included in the Runtime library which comes with MPW 3.0. If I needed to write a disassembler, then I would certainly use this, rather than reinvent the wheel. This is new with MPW 3.0, but if past behavior is any indication with this sort of thing, then this module should become available as part of other development systems before long. Why do you need to write a disassembler? If you just need to "acquire" one, then MPW comes with three disassemblers if you include MacsBug, there are a number of others available, and there is a free one on sumex. Earle R. Horton
pwp@shamash.cdc.com ( HOUFAC) (10/09/89)
In article <15994@dartvax.Dartmouth.EDU> jskuskin@eleazar.dartmouth.edu (Jeffrey Kuskin) writes: >I need to write a disassembler for the Mac (the 68000 >only, to be specific). Could someone point me in the >right direction in terms of how to decode the opcodes. Aside from the obvious Motorola manuals, I'd recommend "68000 Assembly Language, Techniques for Building Programs" by Donald Krantz and James Stanley (Addison Wesley, 1986). It includes a chapter called "The Nitty-Gritty Details" that covers exactly the kind of stuff you need to write a disassembler. (It's also a pretty good book for learning 68K assembler, IMHO.) <Standard disclaimer regarding connection to the authors, et.al.> --Pete Poorman pwp@shamash.cdc.com
think@ut-emx.UUCP (s j moon) (10/14/89)
There is a 68000 disassembler source in C. anonymous FTP site -- xanth.cs.odu.edu [128.82.8.1] cd usenet and cd comp.sources.misc/volume4/68kdisasm there are 2 programs part1.Z part2.Z part1.Z is v04i125 68kdisasm/Part alex@umbc3.UUCP (Alex S. Crain) 680x0 COFF disassembler (1 of 2) part2.Z is v04i126 68kdisasm/Part alex@umbc3.UUCP (Alex S. Crain) 680x0 COFF disassembler (2 of 2) s j moon