home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 8 / amigaformatcd08.iso / in_the_mag / emulation / ql / qdos4amiga3.lha / D68K_README_txt < prev    next >
Text File  |  1995-09-20  |  4KB  |  120 lines

  1. ****************************************************************
  2. *                                                              *
  3. *               D68K DISASSEMBLY TOOLKIT V1.27                 *
  4. *                 COPYRIGHT FRANK SWIFT 1995                   *
  5. *                    ALL RIGHTS RESERVED.                      *
  6. *                                                              *
  7. *       D68K is a BASIC toolkit for disassembling files        *
  8. *       or memory (RAM).                                       *
  9. *                                                              *
  10. ****************************************************************
  11.  
  12.  
  13. MDIS [#<chan>,]<pc>,[<org><length>]
  14.  
  15. This procedure disassembles <length> bytes of code at address
  16. <pc>. The disassembly is printed to #<chan> or to #1 if no
  17. channel is specified and is optionally relocated to the address
  18. <org>.
  19.  
  20. FDIS [#<chan>,]<filename$>,[<pc>,[<org>[<length>]]
  21.  
  22. This procedure disassembles <length> bytes from the specified
  23. <filename$> at offset <pc>. The disassembly is printed to
  24. #<chan> or to #1 if no channel is specified and is optionally
  25. relocated to the address <org>.
  26.  
  27. D68K <pc>,[<org><buffer>]
  28.  
  29. This function disassembles one m/c instruction at address <pc>.
  30. The disassembly is printed as a C string (0 terminated) to an
  31. ASCII buffer at address <buffer> and is optionally relocated to
  32. the address <org>. The function returns the number of bytes
  33. disassembled. You must allocate an ASCII buffer of at least 256
  34. bytes before using this function.
  35.  
  36.  
  37. ***************************************************************
  38. *                                                             *
  39. *                   ADVANCED USER INFORMATION                 *
  40. *                                                             *
  41. ***************************************************************
  42.  
  43.  
  44. EXTERNAL LINKS TO THE DISASSEMBLER
  45.  
  46. D68K makes use of an entry in the THING list that allows access
  47. to D68K routines that disassemble a single-line of code.
  48.  
  49. Currently D68Ks' THING is 64 bytes long and contains the
  50. following entries:
  51.  
  52. Offset   Value    meaning
  53.  
  54. $26      '1.06'   version number
  55. $2A      4        name length
  56. $2C      'd68k'   name
  57. $30      'THG%'   thing variables follow
  58. $34      2        freeform shared code
  59. $38      ?        address of a 256 byte buffer
  60. $3C      ?        address of single-line disassembly routine
  61.  
  62. ----------------------------------------------------------------
  63.  
  64. FINDING D68Ks' THING ENTRY
  65.  
  66. The following machine code could be employed to find D68ks'
  67. THING entry. It returns with the address of the thing in A4.
  68.  
  69.  Entry: none
  70.  
  71.  Exit:  A0 = corrupted (address of system variables)
  72.         A4 = address of D68ks' thing entry or zero
  73.         D0 = corrupted
  74.         D1 = corrupted (current job)
  75.         D2 = corrupted (QDOS version)
  76.  
  77. FIND_THG:
  78.          moveq    #MT.INF,d0        ; find system variables
  79.          trap     #1
  80.  
  81.          lea      $B8(a0),a4        ; start of THING list
  82.  
  83. NEXT_THG:
  84.          move.l   (a4),d0
  85.          move.l   d0,a4
  86.          beq.s    EXIT              ; exit if not found
  87.  
  88.          cmp.w    #4,$2A(a4)        ; compare name length
  89.          bne.s    NEXT_THG
  90.  
  91.          cmp.l    #'d68k',$2C(a4)   ; compare name
  92.          bne.s    NEXT_THG
  93.  
  94. EXIT:
  95.          rts
  96.  
  97. ----------------------------------------------------------------
  98.  
  99. SINGLE-LINE DISASSEMBLY ROUTINE
  100.  
  101.  Entry: A0 = <pc>
  102.         A1 = <org>
  103.         A2 = 256 byte ASCII buffer
  104.  
  105.  Exit:  A0 = updated pc
  106.         A1 = updated org
  107.         A2 = updated buffer
  108.         d0 = number of bytes disassembled
  109.  
  110. The routine pointed to by offset $3C in D68ks' THING entry
  111. disassembles one m/c instruction at address <pc>. The
  112. disassembly is stored as a C string (0 terminated) in an ASCII
  113. buffer and is optionally relocated to the address <org>. The
  114. routine returns the number of bytes disassembled in d0.
  115.  
  116. You should allocate your own buffer as the one pointed to by
  117. offset $38 may not be usable.
  118.  
  119. ****************************************************************
  120.