home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol095 / rez7 / 31.doc < prev   
Encoding:
Text File  |  1984-04-29  |  25.0 KB  |  779 lines

  1.         REZ
  2.  
  3.     A disassembler for 8080 programs
  4.     by Ward Christensen as modified for Z-80
  5.     with TDL mnemonics by William Earnest
  6.  
  7.     CP/M U.G. 1/80
  8.  
  9. Suggestions?  Call me eve's at (312) 849-6279
  10.     W. Earnest is at (215) 398-1634
  11.         ----------------
  12. REZ commands are inconsistent at best. - REZ is a 
  13. kludge based on years of disassembler experience and hacking, 
  14. and was never "planned" - just coded sitting at a tube, and
  15. modified over 2 years before being contributed to the CP/M UG.
  16.  
  17. For example, to kill a symbol: k.label   but to kill a 
  18. control value: caddr,k and to kill a comment: ;addr,
  19. but REZ does the job like no other I have seen.
  20.         ----------------
  21. N-O-T-E: Pardon the editorial, but I feel hardware without
  22. good software is useless to 99% of us.  Most good software
  23. has to be paid for.  I strongly support the legitimate purchase
  24. of licensed software.  I do not regularly use any programs
  25. which I have not purchased.  (Yes, I do occasionally "try"
  26. one, but then buy it if I plan on using it).  I have been
  27. asked by software businesses to NOT distribute REZ -
  28. because of it's ability to produce good .asm source quickly.
  29. But, there are so many disassemblers out, why not a good, 
  30. conversational one?   Please use it in the spirit in which it 
  31. was contributed: to enlarge your understanding of the micro-
  32. computer world around you, and to allow you to customize 
  33. programs which you legitimately own, for your own use.
  34.  
  35.     "Semper non rippus offus"
  36. ----
  37. NOTE: any command taking a hex address (Dnnnn, etc)
  38. may take a value in the form .label but arithmetic
  39. may not be performed.  (i.e. d.start is ok, but d.start+8 not)
  40.         ----------------
  41.     Overall structure of REZ:  It is a .COM file,
  42. which runs at 100H.  It goes thru 1B00 or so, then the stack.
  43. At 1C00 is a 512 entry table for control commands.  Each is
  44. 3 bytes long, and controls the format of the re-sourced list,
  45. i.e. is it .BYTE, .WORD, .BLKB instructions, etc.
  46.     At 2200 is the start of the symbol table.  It has no
  47. defined length as such.  If it is not used, it occupies only
  48. 2 bytes.
  49.     If you want to re-source something which is in memory,
  50. such as a PROM, a program previously loaded in high memory,
  51. "CP/M itself", or whatever, you can just do so.
  52.     However, typically you want to disassemble a program
  53. which runs at 100H, which is were REZ runs.   Bob
  54. Van Valzah would have solved that by making resource
  55. relocatable and moving itself up under BDOS.  I wasn't that
  56. industrious.
  57.     Instead, REZ uses the concept of an "invisible"
  58. OFFSET.  After all, what do you care where it is as long
  59. as it LOOKS like it's at 100h?
  60.     So, you set an offset.  O2F00 sets it to 2F00 Hex.
  61. Reading a .COM file (RFOO.COM) causes it to come into 3000 on.
  62. If you say D100 or L100 it dumps or lists what LOOKS like your
  63. program.  Internally, REZ is adding the offset to the
  64. D and L addresses.
  65.     What should you set the offset to?  Well, that depends
  66. upon how many symbols you will use.  O2400 will load the
  67. program at 2400, thus allowing only 2200-23FF for symbols,
  68. i.e. 512 bytes or about 50-60 labels.  If you didn't leave
  69. enough space, then used B to build a default symbol table,
  70. the table could run into and clobber your .com file!  (easy
  71. recovery, however: just change the offset to being higher,
  72. and read in the .COM file again)  Each entry takes 3 bytes
  73. + the symbol length, and if you like 7 byte labels like I
  74. do, that means 10 bytes/label.  An offset of 3300 should
  75. be adequate.
  76.     If you want to put comments into the disassembled
  77. program, you will have to designate an area to Use for the
  78. comments.  The U command (e.g. U4000) specifies what area
  79. is to be used.
  80.     Before issuing the O (offset) command, do:
  81.     L5 7
  82. which will show the JMP to BDOS, which is the highest memory
  83. you may use.  (Note if you have, for example, an empty 4K
  84. memory board in high memory, you can Use THAT for comments).
  85.     Let's take an example:  You have an 8K file, FOO.COM
  86. which you want to disassemble.  It will have about 300 labels.
  87. 300 x 10 is 3000, or call it 4K (what's a K unless your
  88. tight).  The symbol table starts at 2200.  4K more is 3200.
  89. Let's load the .COM at 3200, so since it normally starts
  90. at 100H, the offset is 3100.  O3100 is the command.
  91. We then RFOO.COM to read it in.  It says 5200 2100 which
  92. means it came into actual memory to 5200, but 2100 if we
  93. are talking with respect to loading at 100.
  94.     Thus, we could set our comments table up after
  95. the .COM program - say at 5400:  U5400
  96.     The ? command shows the memory utilization for
  97. control, symbol, and comments entries.  (no, I never put
  98. in anything to keep track of the .COM - you'll just have
  99. to do that yourself).
  100.     If you ever want to dump real memory, you'll have
  101. to reset the offset to 0: O0  but then set it back.
  102. If you are not sure what it is, typing O will tell the
  103. current offset.
  104.  
  105.     Hoo, boy!  Hope this kludge of documentation
  106. is enough to get you going - hmmm, better give you
  107. some of the gotcha's I've discovered...
  108.  
  109.         ---- WATCH FOR ----
  110.  
  111. *    Symbols overflowing into the .COM.
  112.     (Use ? command to see how full symbol table is)
  113.  
  114. *    Control entries overflowing into .SYM (altho I
  115.     can't believe anyone will have a program with
  116.     more than 512 control entries!!!)
  117.  
  118. *    Comments overflowing into BDOS (ug!!)
  119.  
  120. *    Using an offset which is not in free memory
  121.     and overlaying BDOS or whatever.
  122.  
  123. *    The B(uild) command gobbling up too much when building
  124.     a .BYTE:  "B" will take a .BYTE 'GOBBELDY GOOK' followed
  125.     by LXI H,FOO and take the LXI as a '!' (21H) so
  126.     you'll have to manually stick a new "I" control
  127.     entry in at the address of the LXI.  You might
  128.     also delete the incorrect "I" entry which REZ
  129.     stuck in (typically at the second byte of the LXI)
  130.  
  131. *    Trying to dump real memory without setting the
  132.     offset back to 0.  (then forgetting to set it back
  133.     to its proper value)
  134.  
  135. *    Forgetting how big the .COM file you are disassembling
  136.     was.
  137.  
  138. *    Using REZ to rip off software (yes, I know, you
  139.     heard that before, but only 3 in 100 needed to be 
  140.     told, and 2 in 100 needs to be told again, and 1 in
  141.     100 doesn't give a rat's fuzzy behind anyway!!)
  142.  
  143. *    Forgetting to take checkpoints when disassembling
  144.     large files.  You may even want to rotate the names
  145.     under which things are saved:
  146.  
  147.     STEMP1.SYM
  148.     STEMP1.CTL
  149.     STEMP1.DOC
  150.  
  151. *    Missing a label:  Suppose you have a control entry
  152.     for a .WORD, resulting in:
  153.     
  154.     DFLT:        ;172C
  155.         .WORD    100H
  156.  
  157.     but somewhere in the program, the following exists:
  158.  
  159.         LDA     172DH
  160.  
  161.     Even if you did a B and have a label L172D, it won't
  162.     show up since it's in the middle of a .WORD.  Instead,
  163.     do this:
  164.  
  165.     K.l172d        kill the old label
  166.     e172d,.dflt+1    put in the new label as a displacement
  167.             off the beginning.
  168.  
  169. *    improperly disassembling .WORD's (see previous item).
  170.     You might be tempted to make DFLT a .BYTE so that
  171.  
  172.     DFLT:        ;172C
  173.         .BYTE    0
  174.     L172D:        ;172D
  175.         .BYTE    1
  176.  
  177.     Note that while this disassembles and reassembles
  178.     properly, it is not "as correct" as the technique
  179.     used in the previous item.
  180.  
  181. *    Having the "B" command overlay your "E" control entry.
  182.     What?  Well, "B"uild is pretty dumb.  If he finds 8
  183.     .BYTE type characters in a row, he fires off a .BYTE from
  184.     then on until he runs out of those characters.  Suppose
  185.     your program was 200 long (ended at 3FF), and you
  186.     had zeroed (aha!  Nice .BYTE candidates) memory there
  187.     (there meaning at your offset address + whatever).
  188.  
  189.     Then you QB100,400 and viola!!  REZ overlaid
  190.     your "E" control with a "B".  
  191.         ----------------
  192.  
  193.     REZ is relatively complete.  (well, actually,
  194.     the phrase "rampant featureitis" has been "mentioned").
  195.     ...But there's always another day, and another K...
  196.  
  197.         SO... Here's my "wish list"
  198.  
  199.     ..it might save you telling me YOU think such-and-such
  200.     would be nice...
  201.  
  202. *    Targets of LHLD, SHLD should automatically be flagged
  203.     as type .WORD in the control table.  Ditto LDA and STA
  204.     as .BYTE or as second half of .WORD.  Ditto targets of LXI
  205.     as .BYTE (?).
  206.  
  207. *        E5C,.FCB
  208.     followed by
  209.         E6C,.FCB+
  210.     should automatically calculate the appropriate
  211.     displacement, and put it in the symbol table.
  212.  
  213. *    The comments facility should be enhanced to allow
  214.     total SUBSTITUTION of entire line(s) of the code,
  215.     i.e. at address such-and-such, replace the next 3
  216.     bytes with the following arbitrary line.  This
  217.     would help those "how do I explain what was being
  218.     done" cases such as:    LXI    H,BUFFER AND 0FF00H
  219.  
  220. *    Add the ability to, in one instruction, rename
  221.     a default (LXXXX) label to a meaningful name.
  222.  
  223.         ----------------
  224. REZ types an "*" prompt when it is loaded.  You may
  225. then enter any of the following commands.  Each command
  226. is a single letter followed by operands.  Commas are shown
  227. as the delimiter, but a space will also work.
  228.  
  229.         ----------------
  230.         ----------------
  231. ;    Put comments into the program.
  232.     (must execute 'u' command first, to assign area
  233.     for comments to be placed)
  234.  
  235.     ;addr,comment    enter a comment
  236.     ;addr        lists existing comment
  237.     ;        lists entire comments table
  238.     ;addr,        deletes existing comment
  239.  
  240.     note that '\' is treated as a new line, i.e.
  241.     \test\ will be formatted:
  242.  
  243.     ;
  244.     ;TEST
  245.     ;
  246.         ----------------
  247. Attempt to find .BYTE's while listing the program.
  248. -    This command works just like 'L', but attempts
  249.     to find .BYTE's of 8 chars or longer.
  250.  
  251.     (see 'L' command for operand formats)
  252.         ----------------
  253. Build default sym tbl (LXXXX) labels for each
  254. -    2 byte operand encountered.  Note 'B' is
  255.     identical to 'L' except labels are built.
  256.  
  257.     (see 'L' command for operand formats)
  258.         ----------------
  259. Control table usage:
  260. -    c        dump ctl tbl
  261.     cnnnn        dump from starting
  262.     cnnnn,x        define format from nnnn
  263.             to next entry.  values of x:
  264.  
  265.             B = .BYTE (attempts .ASCII if
  266.                 printable, 0DH, 0AH)
  267.             W = .WORD (attempts label)
  268.             S = .BLKB to next ctl entry
  269.             I = instructions
  270.             K = kill this ctl entry
  271.             E = end of disassembly
  272.  
  273.     NOTE every control entry causes a "control break"
  274.     (NO, REZ was NOT written in RPG) which means
  275.     a new line will be started.  Thus if you have a
  276.     string in memory which disassembles as:
  277.  
  278.     .BYTE    'Invalid operand',0DH
  279.     .BYTE    0AH
  280.  
  281.     You might want to change it putting the 0DH,0AH
  282.     together on the second line - just enter a "B"
  283.     control entry for the address of the 0DH.
  284.  
  285.     The same technique could be used to make
  286.  
  287.     .ASCII    'TYPESAVEDIR ERA REN '
  288.  
  289.     appear as
  290.  
  291.     .ASCII    'TYPE'
  292.     .ASCII    'SAVE'
  293.     .ASCII    'DIR '
  294.     .ASCII    'ERA '
  295.     .ASCII    'REN '
  296.  
  297.         ----------------
  298. dump:
  299. -    dxxxx        Dumps 80H from xxxx on
  300.     daaaa,bbbb    Dumps from aaaa thru bbbb
  301.     d,bbbb        Continues, thru bbbb
  302.     d        Continues, 100H more
  303.  
  304.     NOTE 100H is the default dump length.  If you have
  305.     a larger display, you can change the default via:
  306.  
  307.     d=nn        nn is the HEX new default.
  308.  
  309.     For example, a 16 line tube could display 80H:
  310.  
  311.     d=80        or..
  312.     d=80,200    Defaults to 80, dumps 200-27f
  313.  
  314.         ----------------
  315. enter symbol:
  316. -    ennnn,.symbol     symbol may be of any length,
  317.             and contain any char A-Z or 0-9,
  318.             or "+" or "-".  This allows:
  319.             E5D,.FCB+1.  Note the "+" is not
  320.             checked, i.e. E5D,.FCB+2 would be
  321.             wrong (assuming FCB is at 5C) but
  322.             would be allowed to be entered.
  323.  
  324.     Note if you enter two symbols for the same address,
  325.     whichever one is first alphabetically will show up
  326.     on the disassembled listing.  If you have a label
  327.     which has the wrong address, you need not explicitly
  328.     kill the old one before entering the new.  A label
  329.     which is spelled exactly the same as an existing one
  330.     will replace the existing one even if the addresses
  331.     are different.
  332.         ----------------
  333. Find occurrence of address or label.  Note this function
  334. -    runs until interrupted (press any key).
  335.     fnnnn,ssss    find address nnnn in memory.  Start
  336.             the search at ssss.  Runs forever.
  337.             Press any key to stop.
  338.     f        continue previous find command
  339.       fnnnn        find nnnn starting at address you last
  340.             stopped at in the f command
  341.         ----------------
  342. kill symbol from table
  343. -    k.symbol
  344.         ----------------
  345. list (disassemble).  This command is used to list the
  346. -    file, or to list it to disk after enabling
  347.     the .ASM file save via 'SFILENAME.ASM' command
  348.  
  349.     l        lists 23 lines from prev pc
  350.     lssss,eeee    lists from ssss to eeee
  351.     l,eeee        lists from current pc to eeee
  352.     lssss        lists 23 lines at ssss
  353.  
  354.     Note that if you have a control 'e' entry, then the
  355.     list will stop when that address is found.  This allows
  356.     you to 'lstart,ffff'. 
  357.  
  358.     The 23 line default may be changed via:
  359.  
  360.     L=nn        where nn is a HEX line count, e.g.
  361.     L=0f        set to 15 lines/screen
  362.  
  363.     You can change the default and list, e.g.
  364.  
  365.     L=9,100        Dflt to 9 lines, list at 100.
  366.  
  367.     NOTE when using L to list the .ASM program to disk,
  368.     you should either list the entire program at once
  369.     using: Lssss,eeee or, you can list small pieces
  370.     at a time.  As long as you list again without
  371.     specifying a starting address, (L or L,nnnn) then
  372.     the output file will continue uninterrupted.
  373.  
  374.     You may do dump commands, and others, without
  375.     affecting what is being written to disk.
  376.         ----------------
  377. offset for disassembly
  378. -    o        print current offset
  379.     onnnn        establish new offset
  380.  
  381.     (note the offset is always added to any 
  382.     address specified in an a, b, d, or l command.
  383.     to dump real memory, the offset must be reset to
  384.     0 (O0) before the dump.)
  385.         ----------------
  386. prolog generation - this routine generates an
  387. -    .LOC instruction, and equates for any label
  388.     outside of a given low-hi address pair.
  389.     (the start and end addresses of your program).
  390.     e.g. if disassembling from 100 to 3ff, it will
  391.     generate 'fcb = 5ch' if FCB is in the symbol
  392.     table.  In typical use, you would 'sfilename.asm'
  393.     then use the P command to write the prolog, then
  394.     the L command to write the program itself.
  395.  
  396.     Pstart addr,end addr
  397.     
  398. quiet command: any command which is preceeded by a q
  399. -    will be done 'quietly'.  For example, to save
  400.     a .asm program, you could just do:
  401.  
  402.     ql100,3ff    or    ql100,ffff if you have
  403.     set the 'e' control in the control table.
  404.  
  405.     Another use is to build a default symbol table
  406.     by taking a pass thru the program: QB100,xxxx
  407.         ----------------
  408. read .com, .ctl, .sym, or .doc file
  409. -    rfilename.com    reads in at offset+100h
  410.     rfilename.ctl    loads the ctl table
  411.     rfilename.sym    loads the sym file
  412.     rfilename.doc    loads the comments table (note
  413.             'u' command must have been issued)
  414.         ----------------
  415. save .asm, .ctl, .sym, or .doc file
  416. -    sfilename.asm    use 'l' command to write, z to end
  417.     sfilename.CTL    saves the CTL table
  418.     stablename.sym    saves the sym file
  419.     sfilename.doc    saves the comments table
  420.         ----------------
  421. use area of memory for comments table
  422. -    unnnn        such as ud000 if you had an
  423.             open board at 0d000h
  424.         ----------------
  425. purge sym tbl and CTL tbl
  426.     x
  427.     -
  428.         ----------------
  429. close .asm file (note that a preferred way to close the
  430.     .asm file is to have specified a control entry
  431.     for the end address (e.g. c1ff,e))
  432.     z
  433.     -
  434. --------------------------------------------
  435. --------------------------------------------
  436. Here is a sample of the REZ usage.
  437.  
  438. Given:    a COM file (lets say test.com) which runs at 100
  439.     (as any good COM file should), and goes thru 2FF.
  440.  
  441. lines preceeded with ---> are typed by you.
  442.  
  443. ---> REZ
  444. ---> o2600    set the offset to 2600, which means the
  445.         program will read into 2600 + 100 = 2700.
  446.  
  447. ---> rtest.com    reads the com file into memory. system says:
  448.         2900 0300 which is the actual hi load addr,
  449.         (2900) and the original hi load addr (300)
  450.  
  451.         REMEMBER this address (300) because you might
  452.         want to put a "E" (end of assembly) control
  453.         entry there.
  454.  
  455. <<<<note>>>> that all 'L' (disassembly list) and 'D' (dump)
  456.     commands work with the offset added.  Thus, you
  457.     should learn to forget that the disassembler is
  458.     in memory, and think of it as if your program were
  459.     actually at 100.  D100 will dump your program.
  460.     
  461.     also note:  if the program being "REZd" will
  462.     have a fairly large symbol table, then you will
  463.     have to set the offset higher: o3300 or some such.
  464.     (the ? command will show symbol table usage: if your
  465.     symbol table is nearing the .com file, then just
  466.     set a new offset (higher) and re-load the .com)
  467.  
  468.     if you want to dump r-e-a-l memory, you would have
  469.     to reset the offset to 0: o0  (but don't forget to
  470.     reset it to 1f00 before continuing with your program.)
  471.  
  472. If you are disassembling something which is in memory at
  473. it's correct address (such as looking at ccp) then don't
  474. set the offset.  It defaults to 0 when dis is first loaded.
  475.  
  476. --->    l100    list your program - lists "about" 10 lines.
  477.  
  478. --->    d100    do a dump of your program.
  479.  
  480. NOTE that typically here are the steps to disassembling
  481.     a program which has just been read into memory:
  482.  
  483. Use the dump command to find the .ASCII areas.
  484.  
  485. Note that the 'a' command may be used to automatically
  486. find the .BYTE's, but you must then check them to insure
  487. that they don't extend too far.  All printable characters,
  488. 0dh, 0ah are considered candidates for .ASCII .
  489.  
  490. At least 8 characters in a row must be found to make sure
  491. that long sequences of mov instructions won't be taken
  492. as .BYTE's.
  493.  
  494. Use the cnnnn,k command to kill erronious entries put
  495. in the control table by the a command, but then immediately
  496. put in the right address, such as via cnnnn,i
  497.  
  498. if you wanted to scan the program for .ASCIIs yourself,
  499. use the 'c' (control) command to set the beginning and
  500.     end of ascii areas.  For example, a program
  501.     which starts out:
  502. 0100        jmp    start
  503. 0103        .ASCII    'copyright .....'
  504. 0117    start    .....
  505.  
  506. would show up in the dump as:
  507.  
  508. 0100  c3170144 4f50xxxx  xxxxxxxx xxxxxxxx  *...copyr ight....*
  509. 0110  xxxxxxxx xxxxxxxx  xxxxxxxx xxxxxxxx  *xxxxxxxx ........*
  510.  
  511.  
  512. thus you would want to instruct the disassembler to switch
  513. to .ASCII mode at 103, and back to instruction mode at 117, thus:
  514.     c103,b
  515.     c117,i
  516.  
  517. Continue doing this, bracketing every .ascii which is in
  518. the middle of instructions, by a b control instruction
  519. and an i control instruction.  Note that multiple db's in
  520. a row need not have separate cnnnn,b instructions, but that
  521. these do cause a 'line break', i.e. if you have a table
  522. of ascii commands, for example:
  523.  
  524. 02e5    .ASCII    'load'
  525. 02e9    .ASCII    'save'
  526.  
  527. the disassembler would disassemble these as:
  528. 02e4    .ASCII    'loadsave'
  529.  
  530. you could put in an additional control entry: c2e9,b, which
  531. would cause the disassembler to generate:
  532.  
  533. 02e4    .ASCII    'load'
  534. 02e8    .ASCII    'save'
  535.  
  536. which is much more readable and realistic.
  537.  
  538. Note that before generating each byte of a db, a symbol
  539. table lookup is done to determine if there is a label
  540. at that location, and if so, a new line is started.
  541.  
  542. Thus if 'loadlit' and 'savelit' were in the symbol table,
  543. as the labels on the 'load' and 'save' above, no separate
  544. 'b' control instruction would be required as the label
  545. would cause the break.
  546.  
  547. <<<<NOTE>>>> that at this time the automatic label checking
  548. is n-o-t done for .BLKB instructions.  Make sure that each
  549. ds instrucion references only up to the next label.  This
  550. means that multiple .BLKB's in a row must each be explicitly
  551. entered into the control table.  Presence of a label is
  552. not sufficient.
  553.             ----
  554. steps, continued:
  555.  
  556. After building the control entries with cnnnn,b and cnnnn,i
  557. put in a control entry cnnnn,e which defines the address of
  558. the end of your program.  The l command will then automatically
  559. stop there, and in addition, if you are in 'save xxx.asm'
  560. mode, the output .asm file will be closed.  If you do
  561. mot define a control 'e' entry, then you will have to use
  562. the break facility to stop the l command (don't use control-c
  563. as that will re-boot cp/m).  If you were writing an .asm
  564. file, you would have to user the z command to close the
  565. file.
  566.  
  567. Next, you would list your program to determine how it looks.
  568. when you recognize a routine by it's function, insert a label.
  569.  
  570. For example, if you saw that location 7ef was a character
  571. out routine (type) then enter a label into the symbol table:
  572.     E7EF,.TYPE
  573.  
  574. NOTE that all symbols start with a '.', so as to be dis-
  575. tinguished from hex data.
  576.  
  577. NOTE that if you want the disassembler to make default labels
  578. for you, use b (for build labels) instead of l (for list
  579. program).  The b commands causes lnnnn default labels to
  580. be inserted in the symbol table for every 2 byte operand
  581. encountered (LXI, SHLD, JMP, etc).  It will undoubtedly
  582. make some you don't want, such as L0000.  You will have to:
  583.  
  584.     K.L0000        kill label L0000 from the table.
  585.  
  586. When you encounter data reference instructions, try
  587. to determine what type of area the instruction points to.
  588. Typically,, LXI instructions may point to a work area
  589. which should be defined as a .BLKB, or to an ASCII string,
  590. in which case we will have already made it a 'b' control
  591. instruction.  Operands of LHLD and SHLD instructions
  592. should be made .WORD instructions.  For example if you
  593. encounter LHLD 0534H, then issue a control instruction:
  594.  
  595.     C534,W
  596.  
  597. NOTE that whatever mode you are last in will remain in
  598. effect.  Therefore if 534,w is the last entry in the
  599. control table, all data from there on will be taken to be
  600. .WORD's.
  601.  
  602. Suppose that you determine that address 7cf is a 128 byte
  603. buffer for disk I/O.  You want it to disassemble to:
  604.  
  605. DKBUF        ;07CF
  606.     .BLKB    80H
  607.  
  608. You do this as follows:
  609.  
  610.     C7CF,S        to start the .BLKB
  611.     C84F,B        to define it's end, and
  612.     E7CF,.DKBUF    to put the symbol in the table.
  613.  
  614. Continue, iteratively using the 'l' command and the 'c'
  615. and 'e' commands until you have the listing in a nice
  616. format.  You will then probably want to save the control
  617. symbol, and comments tables.  Or, you could have been 
  618. saving them at checkpoint times (so if you make a 
  619. major mistake you could go back to a previous one).
  620.  
  621. To save a control file:
  622.     sfilename.CTL    (any filename, may include a: or b:)
  623.  
  624. To save a symbol file:
  625.     sfilename.sym
  626.  
  627. To save a comments file:  
  628.     sfilename.doc    (not ".com" of course)
  629.  
  630. NOTE that the filetypes must be used as shown, but
  631. that any legal filename (or disk:filename such as b:xxxx.CTL)
  632. may be used.
  633.  
  634. You could now control-c to return to CP/M, and come back
  635. later to resume your disassembly:
  636.  
  637.     REZ
  638.     o2200
  639.     rtemp.com
  640.     rtemp.sym
  641.     rtemp.ctl
  642.     uxxxx        (such as u4000)
  643.     rtemp.doc
  644.  
  645. This will take you back exactly where you left off.
  646.  
  647. If you want to save a .asm file out to disk, do the following:
  648.  
  649. Make sure that there is a control entry defining the end
  650. of the program (such as c200,e) or else you will have to 
  651. specify the ending address and manually type a z command to 
  652. close the file. 
  653.  
  654.     sfilename.asm
  655.  
  656. A message will indicate that the file is opened.  Any
  657. subsequent a, b, or l command will have whatever is listed
  658. written to disk.  Encountering a 'e' control, or typing a z
  659. command will then close the .asm file.  The listing may
  660. be interrupted, and continued.  Since the l command types
  661. only 23 lines, use laddr,ffff to list thru the end of the
  662. assembly.
  663.  
  664. If this is the 'final' save of the .asm file, you will
  665. probably want to put an 'org' at the beginning of the
  666. output file, as well as generate equ instructions for
  667. any references outside of the program.  For example, a
  668. typical cp/m program will have references to:
  669.     bdos    at 5
  670.     fcb    at 5ch
  671.     tbuff    at 80h
  672.  
  673. the 'p' (for prologue) command generates the org, then
  674. scans the symbol table and generates equates:
  675.     BDOS    =    05H
  676.     FCB    =    05CH    (etc.)
  677.  
  678.  
  679. If you have a "e" control entry in your file, you can
  680. list as follows:  laddr,ffff - the listing will continue
  681. until the "e" control entry is found
  682.  
  683.  
  684. additional commands:
  685.  
  686. if you entered a label in the symbol table but now want
  687. to get rid of it:
  688.     k.symbol
  689.  
  690. note to rename a symbol, such as when you had a system-
  691. assigned lnnnn label but now want to make it meaningful:
  692.  
  693.     k.l0334
  694.     e334,.type
  695.  
  696. you could even:
  697.     e.l0334,.type
  698.     k.l0334
  699.  
  700. but that takes more typing.
  701.  
  702.  
  703.  
  704. here are some more commands:
  705.  
  706. ?        prints statistics on symbol and control table
  707.         usage, etc.
  708.  
  709. c        prints the entire control table
  710.  
  711. cnnnn        prints the control table starting
  712.         at address nnnn
  713.  
  714. ds        dumps the symbol table.  Interrupt it
  715.         by typing any key.
  716.  
  717. ds.symbol    starts dumping at the specified symbol,
  718.         or the nearest symbol.  thus "ds.f" starts
  719.         the dump at the first label starting
  720.         with the letter 'f'.
  721.  
  722. t        Toggles format mode such that labels are
  723.         placed on the same line with the next
  724.         instruction, or are on their own line.
  725.  
  726. ....have fun, and let me know of any problems or
  727.     suggested improvements
  728.     ------------------------
  729.  
  730.         REZ
  731.     "Quick" command summary
  732.  
  733. Any address may be replaced by .symbol i.e. D.START
  734.  
  735. ;addr,comment        Enter a comment
  736. ;addr            Lists existing comment
  737. ;            Lists entire comments table
  738. ;addr,            Deletes existing comment
  739. A(see "L" for operands)    Attempt to find .BYTE's
  740. B(see "L" for operands)    Build default sym tbl (Lxxxx)
  741. C            Dump ctl tbl
  742. Cnnnn            Dump ctl starting at nnnn
  743. Cnnnn,x            Define format from nnnn (B,E,I,S,W)
  744. Dxxxx            Dumps 80H from xxxx on
  745. Daaaa,bbbb        Dumps from aaaa thru bbbb
  746. D,bbbb            Dump thru bbbb
  747. D            Dump 100H more
  748. D=nn            nn= Hex dump size default.
  749. Ds            Dumps the symbol table.
  750. Ds.symbol        Sym dump starting at .symbol
  751. Ennnn,.symbol        Enter symbol into table
  752. Fnnnn,ssss        Find address nnnn starting at ssss
  753. F            Continue previous find command
  754. Fnnnn            Find nnnn
  755. K.symbol        Kill symbol from symbol table
  756. L            Lists 23 lines from prev pc
  757. Lssss,eeee        Lists from ssss to eeee
  758. L,eeee            Lists from current pc to eeee
  759. Lssss            Lists 23 lines at ssss
  760. L=nn            nn is hex list default # of lines
  761. O            Print current offset
  762. Onnnn            Establish new offset
  763. Pstart addr,end addr    Generate program prolog
  764. Q            Before any command suppresses
  765.             console output: QB100,200
  766. Rfilename.COM        Reads in at offset+100h
  767. Rfilename.CTL        Loads the ctl table
  768. Rfilename.SYM        Loads the sym file
  769. Rfilename.DOC        Loads the comments table (note
  770. Sfilename.ASM        Save .ASM file.  Write w/L, Z to end
  771. Sfilename.CTL        Saves the CTL table
  772. Sfilename.SYM        Saves the sym file
  773. Sfilename.DOS        Saves the comments table
  774. T            Toggles trimmed format mode
  775. Unnnn            Use nnnn for comments table
  776. X            Purge all symbols and control
  777. Z            Write eof to .ASM file (
  778. ?            Prints statistics (sym, ctl, comments)
  779.