home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / compuserve / P-Code / DSMDOC.TXT < prev    next >
Text File  |  2006-10-19  |  7KB  |  186 lines

  1. O^½║½δ#99/4   D I S - A S S E M B L E R
  2. $(C) Andy Cooper 1983,1984,1985
  3. %
  4. $121 Clearview Drive
  5. $Downingtown Pa 19335
  6. $(215)269 0804
  7. $
  8. $CIS     71016,1743
  9. $DELPHI  ANDY4820
  10. $
  11.  The disassembler consists of two code
  12.  files. The main or host file is
  13.  DISASMBLR.CODE and the auxillary or
  14.  library file is DISASMSUP.CODE. At run
  15.  TIME disasmsup.code must be linked with
  16.  disasmblr.code. For the P-System to find
  17.  disasmsup.code an entry in USERLIB.TEXT
  18.  on the root volume must exist.
  19.  This entry should be:
  20. %<diskid>:disasmsup.code
  21.  where <diskid> can be a drive (eg #5)
  22.  or a volume name (eg sysdisk).
  23.  After creating or updating userlib.text
  24.  with the editor the disassembler can be
  25.  eXecuted from the main status line.
  26.  O U T P U T
  27.  -----------
  28.  The output can be directed to the screen
  29.  or to the printer. If the printer option
  30.  is chosen an additional selection is
  31.  offered.
  32.  N(ormal mode produces a full listing
  33.  with headings and page skips.
  34.  C(ompressed mode is similar to normal
  35.  however when dis-assembling 9900 code
  36.  the additional words of multi-word
  37.  instructions are not printed. This
  38.  reduces the listing about 25%.
  39.  In S(kip mode printing is similar to
  40.  normal however headings and page skips
  41.  are not performed. This is useful if
  42.  many small code segments are being
  43.  decoded (eg following program flow) as
  44.  humongous amounts of paper can be saved.
  45.  D A T A   S O U R C E
  46.  ---------------------
  47.  The next menu allows you to select the
  48.  source of the data to be processed.
  49.  R(om will print or dis-assemble data
  50.  from console Rom, console Ram, expansion
  51.  Ram or DSR Rom.
  52.  G(rom will print or decode (dis-gpl?)
  53.  data from the console GROM's or cart-
  54.  ridge GROM's.
  55.  V(dp will print data from VDP Ram. Note
  56.  that no option is offered to treat VDP
  57.  data as code.
  58.  F(ile will take input data from a disk
  59.  file. NOTE: the dis-assembler treats the
  60.  file as a 'memory image' rather than an
  61.  assembler object file. This allows you
  62.  to generate data from various sources
  63.  (eg P-Code grom) and process it with the
  64.  dis-assembler. If the file option is
  65.  chosen the prompt is reissued to find
  66.  out how the data is to be handled. IE
  67.  is it 9900 code (Rom) etc.
  68.  A D D R E S S   S E L E C T I O N
  69.  ---------------------------------
  70.  Address limits to print or decode are
  71.  specified in hex as a start address and
  72.  an end address. 
  73.  If the file option was chosen the
  74.  address represents where the code WOULD
  75.  reside if it were in memory. This
  76.  enables the dis-assembler to generate
  77.  jump and branch addresses correctly. See
  78.  also the description of OFFSET later.
  79.  If the ROM/RAM option was chosen and the
  80.  address range overlaps DSR rom (4000h -
  81.  5FFFh) an additional prompt is issued
  82.  for the DSR CRU address. You may pick
  83.  one of the predefined addresses (Disk,
  84.  RS232, P-Code) or OTHER which enables
  85.  you to specify a non standard address.
  86.  F I L E   S E L E C T I O N
  87.  ---------------------------
  88.  If the file option was chosen the
  89.  dis-assembler prompts for the file to
  90.  use. If the file is not found the
  91.  prompt is reissued. After the file has
  92.  been opened a prompt for offset appears.
  93.  This allows you to enter in decimal the
  94.  offset in bytes (0 relative) that the
  95.  data to be decoded is in the file.
  96.  This is useful if the data to be decoded
  97.  does not start at the beginning of the
  98.  file or you wish to decode a fragment
  99.  of code starting in the middle of the
  100.  file. In combination with the start
  101.  address this enables the dis-assembler
  102.  to generate meaningful jump and branch
  103.  addresses.
  104.  T I P S   O N   U S E
  105.  ---------------------
  106.  When dis-assembling 9900 code there is
  107.  usually embedded data and parameters.
  108.  This will cause the program to produce
  109.  some funny code at times. If the program
  110.  does get 'out of step' it will re-synch
  111.  fairly quickly.
  112.  Try starting at console rom address
  113.  24h. This is the start of the power up
  114.  routine. The workspace address is at
  115.  address 0000h and the code address is
  116.  at 0002h.
  117.  Decoding GPL instructions is a little
  118.  harder than 9900 code as they are byte
  119.  oriented. If the dis-assembler (dis-gpl)
  120.  gets out of step it is difficult to get
  121.  re-synchronized. For this reason you
  122.  will need to pay attention when decoding
  123.  GPL instructions.
  124.  Try starting at address 52h. This is the
  125.  GPL power clear routine. This can be
  126.  calculated from the 9900 instruction at
  127.  address 0030h (li R0,20h) which is the
  128.  first GPL instruction to be executed.
  129.  This points to a GPL branch to address
  130.  0052h.
  131.  The file option is useful for decoding
  132.  data that is not readily accesible to 
  133.  the dis-assembler. For example some
  134.  initialization code for the P-System
  135.  is moved from P-Code GROM to ram address
  136.  2000h and branched to. It is not prac-
  137.  tical to build the capability ti handle
  138.  specific cases like that into the 
  139.  program. Instead a simple routine can be
  140.  written to dump the code from GROM to a
  141.  file and process it that way. 
  142.  EG. if the code to be dis-assembled is
  143.  dumped to a file and is executed at
  144.  address 2000h you would specify a start
  145.  address of 2000h and an OFFSET of 0.
  146.  If you wished to start at address 2024h
  147.  you would specify a start address of
  148.  2024h and an offset of 36 (decimal).
  149.  This will ensure correct addresses are
  150.  generated. Note that the OFFSET is a
  151.  decimal value of BYTES! This is in case
  152.  the file contains GPL code.