home *** CD-ROM | disk | FTP | other *** search
/ ftp.update.uu.se / ftp.update.uu.se.2014.03.zip / ftp.update.uu.se / pub / rainbow / msdos / misc2 / asmgen.lzh / ASMGEN.DOC < prev   
Text File  |  1983-09-30  |  26KB  |  634 lines

  1.  
  2. *****************************************************************
  3. *                                                               *
  4. * ASMGEN.COM - by J. Gersbach   and  J. Damke    (Ver. 2.01)    *
  5. *                                                               *
  6. * A program to generate cross-referenced assembly language code *
  7. * from any executable file.                                     *
  8. *                                                               *
  9. *****************************************************************
  10.  
  11.  
  12.  
  13. *  PREFACE  *
  14.  
  15.  
  16. This program will generate 8086/87/88 assembly code text
  17. that is compatible with the IBM Personal Computer Macro
  18. Assembler from any executable diskette file up to 65,535
  19. bytes.  The output can be routed to the console or a disk-
  20. ette file.  A reference list may be generated separately or
  21. embedded at the appropiate instruction counter address in
  22. the assembly code.
  23.  
  24. Some manual touch up will be required before reassembly, but
  25. nearly all the typing is done for you by ASMGEN and anything
  26. questionable is marked with "??".
  27.  
  28. A file of sequential instructions may be resident on the
  29. same diskette to indicat to ASMGEN which addresses contain
  30. code, byted, words, or strings.  This file may also include
  31. instructions to assume segment register values or toggle the
  32. output of assembley code text, generation of the reference
  33. table, 8087 mnemonics, of the inclusion of embedded reference
  34. information in the assembly file.
  35.  
  36. DEBUG may be used to browse through the executable file to
  37. determine the starting locations of code and data to develop
  38. the sequential instruction file.  It is important to accu-
  39. rately specify these locations for an accurate reference
  40. tabel and minimum touching up of the ASM output text.
  41.  
  42. The number of references within the file determines the amount
  43. of memory required since a reference tabel is built in
  44. memory during the first pass.  Disassembly is done from disk
  45. and only one file sector is in memory at any given time.
  46. Therefore memory size does not limit the size of the file
  47. to be disassembled.  48K bytes of memory will be enough for
  48. most programs but a few will need 64K or 128K.  One diskette
  49. drive is sufficient but two is more convenient.
  50.  
  51.  
  52. *  STARTING ASMGEN  *
  53.  
  54. There are two ways to work with ASMGEN:  either by using the
  55. command menu or by calling ASMGEN with parameters.
  56. Following are the descriptions of both options.
  57.  
  58. *  USING THE ASMGEN MENU  *
  59.  
  60. The program is invoked by typing:  ASMGEN
  61.  
  62. You are then prompted for a file specification.  Respond with
  63. the name of the executable file from which you wish to
  64. generate the assembly code.  The executable file will normally
  65. have an extension of .EXE or .COM.  ASMGEN will check this
  66. file spec for validity and then respond with a prompt that
  67. includes a summary of the command letters indicating that
  68. you may give it a command.  The executable file contents
  69. are not checked for valid code and ASMGEN will try to dis-
  70. assemble text or compressed BASIC files and produce unintell-
  71. igible assembly code.
  72.  
  73. The commands are:
  74.  
  75. X filespec      This file spec replaces any previous executable
  76.                 file spec.  The usual file extension is .COM
  77.                 or .EXE
  78.  
  79.                 EXAMPLE:  X DATE.COM
  80.  
  81.  
  82. A <filespec>    The executable file is disassembled and the 
  83.                 assembly code is routed to the specified file.  
  84.                 The usual file extension is .ASM. If the filespec 
  85.                 is omitted, the output will default to the 
  86.                 console.
  87.  
  88.                 EXAMPLE:  A DATE.ASM
  89.  
  90. R <filespec>    The reference table is sent to the file 
  91.                 specified. The usual file extension is .TBL.  If 
  92.                 the filespec is omitted, the output will default 
  93.                 to the console.
  94.  
  95.                 EXAMPLE:  R DATE.TBL
  96.  
  97. Q               The program is terminated and control returned to
  98.                 DOS.
  99.  
  100.  
  101. Each time a command has been executed, ASMGEN waits with a one 
  102. line prompt for the next command.
  103.  
  104. X <filespec>, A <CON>, R <CON> or Q ?
  105.  
  106. The default filespec for each command is shown in brackets.  
  107. Enter the next command of your choice as described above.
  108.  
  109.  
  110. *  USING ASMGEN WITH PARAMETER CALLS  *
  111.  
  112. Up to three file specifications may be included when ASMGEN is 
  113. first called from DOS.  The executable file's name is given 
  114. first, followed by specifications for the assembly and reference 
  115. table files.
  116.  
  117. EXAMPLE:  ASMGEN DATE.COM, DATE.ASM, DATE.TBL
  118.  
  119. If a semicolon follows the last filespec, ASMGEN will exit to DOS 
  120. when the command has been executed.  If no semicolon is entered, 
  121. ASMGEN will display the menu options described above and wait for 
  122. further input after executing the command.
  123.  
  124. EXAMPLE:  ASMGEN DATE.COM, DATE.ASM;
  125.  
  126. If the filespec for the .ASM file and/or .TBL file is omitted,
  127. ASMGEN will generate first the .ASM file, then a .TBL file using
  128. the filename of the first filespec.
  129.  
  130. EXAMPLE:  ASMGEN DATE.COM,,; creates DATE.ASM and DATE.TBL and 
  131.                              exits to DOS.
  132.  
  133. If only the reference table is desired, the dummy name NUL should 
  134. be entered in place of an .ASM filespec
  135.  
  136. EXAMPLE:  ASMGEN DATE.COM, NUL, DATE.TBL
  137.  
  138. If only one filespec is given when the program is called, the 
  139. reference table is built in memory and then the menu options are 
  140. displayed for further commands.
  141.  
  142. EXAMPLE:  ASMGEN DATE.COM
  143.  
  144.  
  145. *  PROGRAM EXECUTION  *
  146.  
  147. The disassembly is done in two passes through the scource file.  
  148. On pass #1, the reference table is built in memory and the actual 
  149. output is generated during pass #2.  Once the reference table is 
  150. established, it remains in memory until an X or Q command is 
  151. issued, and subsequent A and R command executions skip pass #1.  
  152. This saves a lot of time when the executable file is large.
  153.  
  154. Three contiguous data areas are built dynamically in memory 
  155. during pass #1. First is the compressed sequential instruction 
  156. list.  Second is a list of pointers for .EXE files that point to 
  157. the locations of all relocatable variables in the program, also 
  158. arranged in numerical order.  These are established before 
  159. reading any code.  Third, the reference table is then built in a 
  160. higher area of memory as pass #1 progresses.
  161.  
  162. If all available memory in the program segment is filled before 
  163. the first two data areas are completed, ASMGEN will abort to the 
  164. command prompt. After the reference table is started, a shortage 
  165. of memory will produce the message "Reference Table Incomplete 
  166. Due to Insufficient Memory" and continue.
  167.  
  168. Ctrl-Break may be used at any time to interrupt a command in 
  169. progress.
  170.  
  171.  
  172. *  READING THE ASSEMBLY CODE FILE (.ASM)  *
  173.  
  174. This file begins with a title taken from the executable file's 
  175. name and date followed by the current date (in brackets).
  176.  
  177. If not inhibited by the  M  switch in a SEQ file (explained 
  178. later), the macro library will appear next in the file.
  179.  
  180. Next will be a .RADIX 16 pseudo-op which tells the macro 
  181. assembler that all numbers are in hexadecimal form.
  182.  
  183. Then comes a header that indicates a starting value for the code 
  184. segment, stack segment, instruction pointer and the stack 
  185. pointer.  The stack pointer is usually set to FFFF for .COM files 
  186. but may be somewhat less depending on available memory.  These 
  187. values are passed by the linker for .EXE files.
  188.  
  189. The first ASSUME statement might come next.  There is one 
  190. generated for each segment that begins with code.  All segment 
  191. registers are designated according to the current set of ASSUMEs.  
  192. They will sometimes be incorrect, so all ASSUME statements should 
  193. be checked prior to re-assembly.
  194.  
  195. The disassembled output follows, terminated by an END statement 
  196. and the execution address.  An ORG psuedo-op is included if 
  197. required.
  198.  
  199. The text is compatible with the IBM Macro Assembler and the 
  200. format is the same except for RETurns.  To avoid the need for 
  201. PROCedure titles, special mnemonics are provided for all RET 
  202. instructions.  These are defined in the macro library at the 
  203. beginning of the file.  Only macros that are needed for the 
  204. current file are produced.  The optional embedded commands that 
  205. make up the reference table enhance the readability of the file.  
  206. For very large files, this is sometimes undesirable and a 
  207. separate reference table is best.
  208.  
  209. When invalid instructions are encountered in code areas, they are 
  210. reproduced as byte values followed by "??".  If a near jump is 
  211. defined previously in the code, and it is within range of a short 
  212. jump, a NOP instruction is inserted after the jump.  The 
  213. executable file created with this .ASM file and the Macro 
  214. Assembler and Linker will then be the same length as the original 
  215. file. This makes it less important to differentiate between 
  216. labels and numeric constants since the label values and their 
  217. offsets within the file will be the same.  The fundamental 
  218. problem of disassembly is in knowing if the original assembly 
  219. code defined a number as a label which changes as a function of 
  220. it's position or as a number that always remains the same.  If 
  221. you make changes in the assembly code however, you must properly 
  222. specify all values. You might as well remove all NOPs at the same 
  223. time.
  224.  
  225. Labels are five characters long and begin with "L".  Segment 
  226. labels begin with "S".  The remaining characters are the current 
  227. instruction counter in hex form, thus making each label unique 
  228. and showing it's location in the original file.  The instruction 
  229. counter is continuous throughout the assembly code without 
  230. resetting at segment boundaries.  The segment labels are then in 
  231. byte as opposed to paragraph form.  In those cases where a label 
  232. value is modified by an ASSUME statement, the original value is 
  233. included as a comment in the referencing instruction so that it 
  234. may be easily changed back if it was not intended as a location.
  235.  
  236. The word "Relocatable" is printed at the end of any line that 
  237. contains an ablolute paragraph value.  These are values that DOS 
  238. modifies after loading but before executing a program.  They are 
  239. used for loading segment registers that are sensitive to the 
  240. program location in menory.  Relocatable values are not modified 
  241. by ASSUMEs.  ASMGEN converts these numbers from paragraph to byte 
  242. values by multiplying them by sixteen so that they will fit 
  243. within the 16-bit instruction counter field.  When the paragraph 
  244. value is negative or exceeds 0FFFH, it is left unchanged and a 
  245. warning (??) is issued on that line.  When a program larger than 
  246. 64K bytes is being disassembled, it should be divided into 
  247. smaller files.
  248.  
  249. All words are produced as labels, except when the "L" switch has 
  250. been enacted in the .SEQ file (explained later).  The label name 
  251. indicates it's numeric value and, if it does not occur on an 
  252. instruction boundary, the name indicates it's position relative 
  253. to the current instruction pointer is given by an EQU statement.  
  254. Therefore the Macro Assember will assume that it is a location, 
  255. but it is easily changed to a constant since the value is given 
  256. in the label name.  The word OFFSET precedes a label whenever it 
  257. is questionable whether it is a label or an immediate value.  You 
  258. must decide which of the labels should be constants and which of 
  259. the constants should be labels, and change them accordingly.  
  260. When changing labels to numbers, be sure to append an "H" if the 
  261. number ends with a "D" or a "B" since the Macro Assembler will 
  262. otherwise assume that it is decimal or binary.
  263.  
  264. Bytes are always treated as constants.  An optional switch may be 
  265. included in the .SEQ file (explained later) which enables numbers 
  266. instead of labels if all references to the value are data segment 
  267. and immediate operation types.
  268.  
  269. An effective procedure to follow in attempting to understand the 
  270. assembly code file is to look first for the message text area, 
  271. the input commands, and the simpler subroutines.  Then add label 
  272. names to addresses in the .SEQ file (explained later) that 
  273. remind you of their purpose.  Add comments to the labels.  If 
  274. these names are well chosen, the larger routines eventually will 
  275. become clear.  The embedded references are produced as labels so 
  276. they will retain their meanings as they are changed.
  277.  
  278. It is also helpful to spend some time studying the structure of 
  279. data areas. Vector tables, which are frequently used to control 
  280. the program's flow, reveal the program's structure very quickly.  
  281. If some routines do not have labels at the beginning, it is 
  282. usually because the code or tables that reference them (or the 
  283. segment register assumptions) are not properly defined in the 
  284.  .SEQ file.
  285.  
  286.  
  287. *  READING THE REFERENCE TABLE (.TBL)  *
  288.  
  289. A referencee is defined as a number that is referenced somewhere 
  290. in the program.  It may be a program loaction or a numeric 
  291. constant.
  292.  
  293. A referencor is is defined as the address in the program from 
  294. which a reference is made to the referencee.
  295.  
  296. Each entry is composed of a referencEE  followed by a list of 
  297. referencors.  If more than one line is needed, additional lines 
  298. are indented to the first referencor position.  The referencEE is 
  299. followed by an "S" if it includes references to the beginning of 
  300. segment.  The referencor is followed by two letters, the first of 
  301. which represents the segment register that is implied or prefixed 
  302. in the referencing instruction.  The second letter indicates the 
  303. type of operation on the referencEE.  When the reference entries 
  304. are embedded in the assembly code, all values are preceded with 
  305. the letter "L".
  306.  
  307. -----------------------------------------------------------------
  308. 1st letter      |  2nd letter
  309. SEG REGISTER    |  TYPE OF OPERATION
  310. -----------------------------------------------------------------
  311. C  code         |  J  jump         M  modify - INC, ADD, etc.
  312. S  stack        |  C  call         I  immediate - value or offset
  313. D  data         |  R  read         T  test or compare
  314. E  extra        |  W  write        ?  unknown or ESC instruction
  315.                 |  P  port
  316. ----------------|------------------------------------------------
  317.  
  318.  
  319.  
  320. *  WRITING/READING THE SEQUENTIAL INSTRUCTION FILE (.SEQ)  *
  321.  
  322. The sequential instruction file is a list of special instructions 
  323. to ASMGEN which the user creates.  The file takes the form of a 
  324. list of hexadecimal addresses and single-letter instructions or 
  325. generation switches.  If used, the .SEQ file must be on the same 
  326. diskette as the source file and have the same name as the source 
  327. file with an extension of .SEQ.  Each instruction in the file 
  328. must be in one of the following formats:
  329.  
  330. addr    command
  331. or
  332. addr    command         ;comment
  333. or
  334. addr    command         label   comment
  335. or
  336. addr    command         label   comment ;comment
  337.  
  338. "addr" represents the instruction pointer value.  All addr values 
  339. must be in numerical sequence in the file.
  340.  
  341. "command" may be either a toggle switch or a generation 
  342. instruction.
  343.  
  344. "label" is optional and replaces the label generated for this 
  345. address with this non-blank string.
  346.  
  347. "comment" is optional and must be preceded by "label" unless the 
  348. dummy label "." is used.  Everything following "label" is treated 
  349. as an address comment and will be printed in the ASM file behind 
  350. the generated instruction.  The address comment may be up to 255 
  351. characters in length and should not contain a semi-colon.
  352.  
  353. ";comment" is optional.  Anything following a semi-colon in the 
  354.  .SEQ file instructions is considered as a comment in the .SEQ 
  355. file only and is not added to the generated .ASM file.
  356.  
  357. "label" and "comment" are not allowed when a generation switch is 
  358. coded, but a ";comment" may be used to help clarify the .SEQ 
  359. file.
  360.  
  361. The .SEQ file is read into memory before the first pass starts.  
  362. The addresses and commands will be compressed, but "label" and 
  363. "comment" will be held in memory one to one.  An effect of this 
  364. is that memory space required for dis-assembly increases with 
  365. each "label" and "comment" added to the .SEQ file.
  366.  
  367.  
  368. *  DESCRIPTION OF GENERATION SWITCHES  *
  369.  
  370. THE VARIOUS TOGGLE SWITCHES ARE SET TO ON BY DEFAULT.  Switches 
  371. may be toggled on and off at any point in the .SEQ 
  372. file/disassembly.
  373.  
  374. All options switches except /M and /H can be either toggled or 
  375. directly set by the user.  A suffix of "+" turns the switch ON, 
  376. and a suffix of "-" turns the switch OFF.  Switches encountered 
  377. in the file that have neither of these suffixes are toggled to 
  378. the opposite of their state at the time; ON switches are turned 
  379. OFF and OFF switches are turned ON.
  380.  
  381. /B - generate byte references
  382.  
  383. When ON, byte and word references are included in the reference 
  384. table.  When OFF, only word references are generated.
  385.  
  386. /E - embedded references in ASM file
  387.  
  388. When ON, reference table entries are inserted in the text just 
  389. before the referencee's definition statement.  When OFF, these 
  390. entries are not included with the disassembled text.  The entire 
  391. reference table can be printed with the "R" command.
  392.  
  393. /F - 8087 mnemonics
  394.  
  395. When ON, ESC instructions are produced.  When OFF, ESC 
  396. instructions are assumed to be 8087 instructions and 8087 
  397. mnemonics are produced.
  398.  
  399. /H - append hex "H"
  400.  
  401. When this switch appears at any point in the .SEQ file, an "H" is 
  402. appended to all hex numbers.  This does not, of course, apply to 
  403. the labels which are hex values preceded by the letter "L".  The 
  404.  .RADIX 16 pseudo-op is omitted which allows the assembler's radix 
  405. to default to decimal.  This switch defaults to NO H APPEND.  
  406. Note that it will be set only once.  It retains it's value until 
  407. the next .SEQ file is read.
  408.  
  409. /L - generate label or number
  410.  
  411. When ON, all word references are treated as labels.  When OFF, a 
  412. word reference is treated as a constant if all referencors are 
  413. data immediate types.
  414.  
  415. /M - suppress macro library
  416.  
  417. When this switch appears at any point in the .SEQ file, no macro 
  418. library is included in the text output.  The DEFAULT IS THAT THE 
  419. MACRO LIBRARY WILL BE INCLUDED.  Note that this switch will be 
  420. set only once.  It retains it's value until the next .SEQ file is 
  421. read.
  422.  
  423. /O - control ASM output
  424.  
  425. When ON, ASMGEN will output the generated text.  When OFF, output 
  426. will be suppressed.
  427.  
  428. /R - control TBL output
  429.  
  430. When ON, ASMGEN will output the generated reference data.  When 
  431. OFF, the reference table is not printed.
  432.  
  433. /T - control trace output
  434.  
  435. When ON, up to 16 bytes of object code are included as comments 
  436. in each line of the assembly code file.  When OFF, object code is 
  437. not included.
  438.  
  439.  
  440. *  DESCRIPTION OF .SEQ FILE COMMANDS  *
  441.  
  442. A - assume
  443.  
  444. The following lines contain ASSUMptions for segment register 
  445. values.  They become effective at the address specified by this 
  446. instruction and may be modified anywhere in the disassembly. The 
  447. required format for assumptions is:
  448.  
  449. & 0400  DS
  450.  
  451. The ampersand indicates a continuation of the A instruction.
  452.  
  453. In this example, a data segment beginning at a instruction 
  454. pointer value of 400 will be assumed until another  A  
  455. instruction changes it.  CS, ES, and SS are also supported.  The 
  456. segment assumptions are used for effective address calculations 
  457. only.  The code segment assumption does not affect the 
  458. instruction pointer value.
  459.  
  460. B - bytes
  461.  
  462. The bytes encountered in the source file are assumed to have 
  463. meaning as single byte values.
  464.  
  465. C - code
  466.  
  467. The bytes encountered in the source file are assumed to be valid 
  468. 8088 machine language instructions.
  469.  
  470. D - generate data operand
  471.  
  472. The operand of the instructions is changed to immediate data.  
  473. Subsequent bytes are interpreted as "C" (code follows).
  474.  
  475. I - initial value for IP
  476.  
  477. The hexadecimal value on this line overrides the instruction 
  478. pointer value at the beginning of the file - not to be confused 
  479. with the address at which execution begins.  The default values 
  480. are 0000 for EXE files and 0100H for COM and other files.  The 
  481. execution address following the END statement is omitted if this 
  482. option is invoked.
  483.  
  484. S - strings
  485.  
  486. The bytes encountered in the source file are assumed to form 
  487. text.  Quoted text is produced for valid ASCII characters and 
  488. byte values for others.
  489.  
  490. # - defined length strings
  491.  
  492. The first byte encountered in the source file contains the length 
  493. of the character string which begins with the next encountered 
  494. character.  This length value may be overridden by a subsequent 
  495. SEQ file instruction.
  496.  
  497. $ - defined length strings
  498.  
  499. The first byte encountered in the source file contains the length 
  500. of the character string which begins with the next encountered 
  501. character plus the length byte itself.  This length value may be 
  502. overridden by a subsequent SEQ file instruction.
  503.  
  504. W - words
  505.  
  506. Pairs of bytes encountered in the source file are assumed to have 
  507. meaning as word values.
  508.  
  509. X - repeating data structure
  510.  
  511. A cyclic data structure is assumed to begin at the specified 
  512. instruction pointer value.  The structure definition may follow 
  513. and is prefixed by an ampersand (&) to indicate the continuation 
  514. of this instruction.  If the definition does not follow, then the 
  515. most recent definition is used.  If no structure is yet defined, 
  516. then an error message is displayed.
  517.  
  518. The following elements may be used to define the structure:
  519.  
  520. & NNNN S  -  The next NNNN bytes are defined as string characters
  521. & NNNN B  -  The next NNNN bytes are defined as byte values
  522. & NNNN W  -  The next NNNN bytes are defined as word values
  523. & XXNN $  -  The next sequence of bytes is defined as NN fields.  
  524.              Each field consists of a length byte and a string of 
  525.              characters. The length of each field is contained in 
  526.              the first encountered byte. The high nibble (XX), if 
  527.              non-zero, is a bit mask of the length field within 
  528.              the byte. The length field is right-justified within 
  529.              the byte after the byte value is sent to the output
  530.              file.
  531.  
  532.  
  533.  
  534. *  EXAMPLES OF .SEQ COMMANDS  *
  535.  
  536. This example .SEQ file shows all the possible instructions in the 
  537. appropriate format.
  538.  
  539. ;All switches are on at the beginning.
  540. 0       /T      ;no object code as comments in output
  541. 0       /M      ;no macro library in output
  542. 0       /H      ;append "H" to all numbers
  543. 00H     /A      ;assume the following segment values
  544. ;Note that the ampersand (&) indicates the extended ASSUME
  545. & 380   DS      ;the data segment starts at 380 hex
  546. & 380   ES      ;the extra segment starts at 380 hex
  547. 0200     I      ;initialize the instruction pointer to 200
  548. 0200    /F      ;introduce 8087 mnemonics (not ESC)
  549. 0200    /E      ;no embedded references
  550. 0200     C      ;code begins at 200
  551. 0203H    W      ;words are at 203
  552. 0207     C      ;more code starting here
  553. 220      X      ;complex data structure begins here
  554. & 3      W      ;words
  555. & 1      B      ;byte
  556. & 0E02   $      ;2 strings starting with the 2nd byte follow
  557.                 ;bits 3,2,1 of the first byte contain the length
  558.                 ;of the string including the length byte.
  559.                 ;the high nibble (0E) is the mask.
  560.                 ;see also # in summary below
  561. & 1      B      ;byte
  562.                 ;the structure repeats until 351
  563. 351      B      ;bytes
  564. 358      C      ;more code
  565. 380      S      ;strings - list of messages
  566. 421      W      ;words
  567. 4FD     /B      ;no further byte references
  568. 502     /R      ;garbage here - turn off reference generation
  569. 502     /O      ;and output
  570. 600H    /O+     ;valid code - turn output back on
  571. 600     /R
  572. 600      C
  573. 1A60    /O-     ;output file about to fill diskette - turn output
  574.                 ;off but keep scanning for references. another
  575.                 ;run will be needed to get the remaining code.
  576. 1B00    /D      ;treat operand as immediate data
  577. 1DFD    /B+     ;continue with byte references
  578. 1F45     W      user_prt        ;user provided labels will
  579. 2256     S      $MSG            ;translate to upper case
  580.  
  581.  
  582. Comments may be included if preceded by a semicolon.
  583.  
  584. Alphabetic characters may be either upper or lower case.
  585.  
  586. An "H" may follow the hex address.
  587.  
  588.  
  589.  
  590. *  SAMPLE SESSION  *
  591.  
  592. The external command CHKDSK.COM will serve as an example for this 
  593. sample session because it is short.  The .SEQ file is also short 
  594. and easy to generate. Only these few instructions are needed.
  595.  
  596.  
  597. 0100  /T  ;include object code as comments in .ASM file
  598. 0100  /E  ;simpler output without references
  599. 04F7H  S  ;messages
  600. 04F7H /H  ;append "H" to numeric values
  601.  
  602. Using DEBUG, browse through CHKDSK.COM to see how this was 
  603. arrived at. Usually, but not always, the best procedure is to 
  604. assume code.  If the code appears unintelligible, display it in 
  605. hex/ASCII.  If it is not text, assume bytes.  Label positions in 
  606. the first disassembly may indicate that some locations should be 
  607. words.  Next, generate the .ASM file by typing
  608.  
  609. ASMGEN CHKDSK.COM <enter>
  610. A                 <enter>
  611.  
  612. The assembly code can be viewed on the screen.  Then type
  613.  
  614. A CHKDSK.ASM      <enter>
  615.  
  616. to save the assembly source code to a file.  Then,
  617.  
  618. R CHKDSK.TBL      <enter>
  619.  
  620. to save the cross-reference table to disk.
  621.  
  622. The Macro Assembler, Link.exe and Exe2bin could now be used to 
  623. assemble CHKDSK.ASM, link it to .EXE and convert it to a .COM 
  624. file.  No modification should be necessary in this case.
  625.  
  626. If working with code that is to be modified, the symbol types 
  627. must be correctly specified as locations or as constants.  If 
  628. they are constants, place them outside of any segment.  The label 
  629. names may then be changed to make the code more readable.
  630.  
  631.  
  632. EndOfFile
  633.  
  634.