Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!ginosko!brutus.cs.uiuc.edu!apple!dlyons From: dlyons@Apple.COM (David Lyons) Newsgroups: comp.sys.apple Subject: Re: Disassemble a GS instruction. Message-ID: <35960@apple.Apple.COM> Date: 27 Oct 89 04:11:23 GMT References: <8910231327.aa23166@SMOKE.BRL.MIL> Organization: Apple Computer Inc, Cupertino, CA Lines: 36 In article <8910231327.aa23166@SMOKE.BRL.MIL> JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") writes: >I was looking through my firmware reference manual for the routine I >can call from the miscellaneous tool set's FWEntry routine that would >disassemble a instruction. I think I found it - INSTDSP at $F8D0. It looks like that routine was intended to be used for displaying 6502-style disassemblies, not the full 65816 instruction set (if it was intended to be used with 65816 stuff, presumably we would have documented some way to tell it about 8/16-bit A and XY registers). I think you'll be better off writing your *own* routine to disassemble an instruction. (I did that about 3 years ago for Nifty List--started at about 4pm and was done by midnight. I took the most straightforward approach I could think of: make a list of all the opcodes and the way they look when disassembled--I used the monitor as a model. Then make a table of all the 3-character mnemonics. Then make a table of the left-hand punctuation for each addressing mode, and the right-hand punctuation for each addressing mode, and have a table of subroutines to print the operand value for each addressing mode. Finally, make a table of info for each opcode--I think I used one word per opcode. Each word includes the mnemonic number and the addressing mode number. The instruction length is a function of the addressing mode and, for immediate mode, a function of the A or XY register sizes.) If you do write your own, you have complete flexibility if you want to make any changes (like fetching the stuff to be disassembled from an address other than the one it's supposed to run at, for example). -- --Dave Lyons, Apple Computer, Inc. | DAL Systems AppleLink--Apple Edition: DAVE.LYONS | P.O. Box 875 America Online: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.