home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / disassem / DisasmDoc next >
Encoding:
Text File  |  1995-06-25  |  4.2 KB  |  130 lines

  1. Extended Disassembler
  2. ---------------------
  3. version 0.18, 16 June 1995
  4. by Darren Salt
  5.  
  6.  
  7. The module  Disassembler provides a  patch (in  theory) for  all pre-Risc  PC
  8. versions of the Debugger module. (It should work with the Risc PC too!)
  9.  
  10. It can disassemble the ARM7 instruction  set, and has a few extras  thrown in
  11. (see below). It can also auto-detect which cache type is  in use (ie. whether
  12. you have  an ARM3, or  ARM6 or  later). If there  is no  cache, then ARM3  is
  13. assumed since this is a likely upgrade for those with ARM2.
  14.  
  15. To make the  necessary changes to the  Debugger module it must be  located in
  16. RAM. The Disassembler module  will therefore attempt to RMFaster the Debugger
  17. module which will require a small amount of memory in the RMA, in addition to
  18. that required by the Disassembler module itself.
  19.  
  20. Loading Disassembler  should be performed at the command  line. It is safe to
  21. do this from the ShellCLI, ie. whilst the desktop is active.
  22.  
  23. * If any breakpoints were set, these will  be lost if the Debugger module was
  24.   running from ROM.
  25.  
  26. It is possible to initialise the flags by appending them to the load command.
  27. For example:
  28.   *RMLoad System:Modules.Disassem -FDwithR13 Y -QuoteSWIs Y
  29. (If a flag is not specified, it defaults to OFF.)
  30.  
  31.  
  32. The module  supports  one  command and  two  SWIs.  It also  tries  to  patch
  33. *ShowRegs so that it uses the APCS-R register names if the APCS flag is set.
  34.  
  35.  
  36. *DisassemblerFlags
  37.  ---------
  38.  Allows you to set various MemoryI and Debugger_Disassemble features.
  39.  Available switches:
  40.     -FDwithR13 <f>  use FD with R13, eg. STMDB R13 -> STMFD R13
  41.     -APCS <f>    use APCS-R register set
  42.     -LFMstack <f>    use stack notation with LFM & SFM where possible
  43.     -LFS <f>    use LFS and SFS in preference to LFM & SFM
  44.     -QuoteSWIs <f>  put quotes around SWI names
  45.     -UseDCD <f>    use DCD instead of 'Undefined instruction'
  46.     -UseVDU <f>    use VDU x instead of SWI OS_WriteI+x
  47.     -ANDEQasDCD <f>    use DCD instead of ANDEQ, MOV Rn,Rn (same register)
  48.             etc.
  49.     -UseADRL <f>    use ADRL/ADRX instead of ADR then ADD/SUB on same reg
  50.             where <f> is "0" or "N" (off), or "1" or "Y" (on).
  51.     -UseADRW <f>    use ADRW instead of ADD/SUB Rn,R12,#m and LDRW, STRW,
  52.             LDRBW, STRBW instead of xxxx Rn,[R12,#m]
  53.  
  54.  Use *DisassemblerFlags on its own to display the current state.
  55.  
  56.  ("Switches" because  each token  is used  as a  three-way  switch, the three
  57.   positions being "off", "on", and "not present - unchanged".)
  58.  
  59.  
  60. SWI Debugger_Disassemble
  61.     --------------------
  62.  Replaces the 'standard' version. Use it in exactly the same way.
  63.  
  64.  
  65. SWI Debugger_63
  66.     -----------
  67.  (Note no proper name!)
  68.  Used to alter the Debugger_Disassemble flags (listed above).
  69.  Input  : R0 = BIC mask, R1 = EOR mask
  70.  Process: new_flags = (old_flags AND NOT R0) EOR R1
  71.  Output : R0 = old_flags, R1 = new_flags
  72.  
  73.  Bits in R0 and R1 are:
  74.  0 = FDwithR13    2 = LFMstack    4 = QuoteSWIs    6 = ADNEQasDCD    8 = UseADRW
  75.  1 = APCS    3 = LFS        5 = UseDCD    7 = UseADRL
  76.  9..31 = reserved, leave unchanged
  77.  
  78.  
  79.  
  80. Disassembly extensions and changes
  81. ----------------------------------
  82.  MOV R0,R0    Always disassembled as NOP
  83.  
  84.  MOV PC,PC    Always disassembled as MOV PC,PC
  85.         Sometimes used instead of a branch instruction:
  86.             LDR    R0,data
  87.             MOV    PC,PC
  88.         .data    DCD    &123456        ; this is ignored
  89.             LDR    R1,[R0]
  90.  
  91.  SWP        Now listed as 'ARM250 and later'
  92.  
  93.  ADRL        ADR followed by ADD/SUB with same condition on same register.
  94.         For example,
  95.             00010000    ADRLS    R0,&00010100
  96.             00010004    ADDLS    R0,R0,#&A000
  97.         becomes
  98.             00010000    ADRLS    R0,&00010100
  99.             00010004    ADRLSL    R0,&0001A100
  100.  
  101.  ADRX        ADR  followed by  two ADD/SUBs  with same  condition on  same
  102.         register.
  103.  
  104.  ADRW        R12 relative: ADD/SUB Rn,R12,#m
  105.  
  106.  LDR, LDRB,    R12 relative: LDRW/LDRBW/STRB/STRBW Rn,[R12,#m]
  107.  STR, STRB
  108.  
  109.  MCR, MRC    Constant (following first comma) now displayed correctly
  110.  
  111.  MRS, MSR    Added for ARM6 and later
  112.  
  113.  UMUL, SMUL,    Added for ARM7 and later
  114.  UMLA, SMLA
  115.  
  116.  LFM, SFM    Extended format - for example,
  117.             LFM    F1,3,[R13],#&024    ; =36
  118.         may be shown 'as is' or as any of
  119.             LFMIA    F1,3,[R13]!
  120.             LFMFD    F1,3,[R13]!
  121.             LFSIA    R13!,{F1-F3}
  122.             LFSFD    R13!,{F1-F3}
  123.  
  124.  FLT        Registers shown correct way round - Fx,Ry instead of Ry,Fx
  125.  
  126.  LDC, STC    L and T flags shown in  order TL to avoid  confusion with the
  127.         LT condition
  128.  
  129.  VDU, VDUX    Equivalent to SWI OS_WriteI and XOS_WriteI respectively
  130.