home *** CD-ROM | disk | FTP | other *** search
- Extended Disassembler
- ---------------------
- version 0.18, 16 June 1995
- by Darren Salt
-
-
- The module Disassembler provides a patch (in theory) for all pre-Risc PC
- versions of the Debugger module. (It should work with the Risc PC too!)
-
- It can disassemble the ARM7 instruction set, and has a few extras thrown in
- (see below). It can also auto-detect which cache type is in use (ie. whether
- you have an ARM3, or ARM6 or later). If there is no cache, then ARM3 is
- assumed since this is a likely upgrade for those with ARM2.
-
- To make the necessary changes to the Debugger module it must be located in
- RAM. The Disassembler module will therefore attempt to RMFaster the Debugger
- module which will require a small amount of memory in the RMA, in addition to
- that required by the Disassembler module itself.
-
- Loading Disassembler should be performed at the command line. It is safe to
- do this from the ShellCLI, ie. whilst the desktop is active.
-
- * If any breakpoints were set, these will be lost if the Debugger module was
- running from ROM.
-
- It is possible to initialise the flags by appending them to the load command.
- For example:
- *RMLoad System:Modules.Disassem -FDwithR13 Y -QuoteSWIs Y
- (If a flag is not specified, it defaults to OFF.)
-
-
- The module supports one command and two SWIs. It also tries to patch
- *ShowRegs so that it uses the APCS-R register names if the APCS flag is set.
-
-
- *DisassemblerFlags
- ---------
- Allows you to set various MemoryI and Debugger_Disassemble features.
- Available switches:
- -FDwithR13 <f> use FD with R13, eg. STMDB R13 -> STMFD R13
- -APCS <f> use APCS-R register set
- -LFMstack <f> use stack notation with LFM & SFM where possible
- -LFS <f> use LFS and SFS in preference to LFM & SFM
- -QuoteSWIs <f> put quotes around SWI names
- -UseDCD <f> use DCD instead of 'Undefined instruction'
- -UseVDU <f> use VDU x instead of SWI OS_WriteI+x
- -ANDEQasDCD <f> use DCD instead of ANDEQ, MOV Rn,Rn (same register)
- etc.
- -UseADRL <f> use ADRL/ADRX instead of ADR then ADD/SUB on same reg
- where <f> is "0" or "N" (off), or "1" or "Y" (on).
- -UseADRW <f> use ADRW instead of ADD/SUB Rn,R12,#m and LDRW, STRW,
- LDRBW, STRBW instead of xxxx Rn,[R12,#m]
-
- Use *DisassemblerFlags on its own to display the current state.
-
- ("Switches" because each token is used as a three-way switch, the three
- positions being "off", "on", and "not present - unchanged".)
-
-
- SWI Debugger_Disassemble
- --------------------
- Replaces the 'standard' version. Use it in exactly the same way.
-
-
- SWI Debugger_63
- -----------
- (Note no proper name!)
- Used to alter the Debugger_Disassemble flags (listed above).
- Input : R0 = BIC mask, R1 = EOR mask
- Process: new_flags = (old_flags AND NOT R0) EOR R1
- Output : R0 = old_flags, R1 = new_flags
-
- Bits in R0 and R1 are:
- 0 = FDwithR13 2 = LFMstack 4 = QuoteSWIs 6 = ADNEQasDCD 8 = UseADRW
- 1 = APCS 3 = LFS 5 = UseDCD 7 = UseADRL
- 9..31 = reserved, leave unchanged
-
-
-
- Disassembly extensions and changes
- ----------------------------------
- MOV R0,R0 Always disassembled as NOP
-
- MOV PC,PC Always disassembled as MOV PC,PC
- Sometimes used instead of a branch instruction:
- LDR R0,data
- MOV PC,PC
- .data DCD &123456 ; this is ignored
- LDR R1,[R0]
-
- SWP Now listed as 'ARM250 and later'
-
- ADRL ADR followed by ADD/SUB with same condition on same register.
- For example,
- 00010000 ADRLS R0,&00010100
- 00010004 ADDLS R0,R0,#&A000
- becomes
- 00010000 ADRLS R0,&00010100
- 00010004 ADRLSL R0,&0001A100
-
- ADRX ADR followed by two ADD/SUBs with same condition on same
- register.
-
- ADRW R12 relative: ADD/SUB Rn,R12,#m
-
- LDR, LDRB, R12 relative: LDRW/LDRBW/STRB/STRBW Rn,[R12,#m]
- STR, STRB
-
- MCR, MRC Constant (following first comma) now displayed correctly
-
- MRS, MSR Added for ARM6 and later
-
- UMUL, SMUL, Added for ARM7 and later
- UMLA, SMLA
-
- LFM, SFM Extended format - for example,
- LFM F1,3,[R13],#&024 ; =36
- may be shown 'as is' or as any of
- LFMIA F1,3,[R13]!
- LFMFD F1,3,[R13]!
- LFSIA R13!,{F1-F3}
- LFSFD R13!,{F1-F3}
-
- FLT Registers shown correct way round - Fx,Ry instead of Ry,Fx
-
- LDC, STC L and T flags shown in order TL to avoid confusion with the
- LT condition
-
- VDU, VDUX Equivalent to SWI OS_WriteI and XOS_WriteI respectively
-