home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / d86v322.zip / D06.DOC < prev    next >
Text File  |  1989-12-15  |  20KB  |  434 lines

  1. CHAPTER 6   MEMORY DISPLAY OPTIONS
  2.  
  3.  
  4. Memory Display Windows
  5.  
  6. The debugger allows you to set up windows into your program
  7. memory space. Using these windows, you can view memory in a
  8. variety of formats.  The windows will remain in effect until you
  9. cancel them; updating themselves automatically if the memory
  10. changes.
  11.  
  12. There are six single-line memory windows always present, in the
  13. lower right portion of the screen.  In addition, you can have the
  14. upper-right window display a 14-line page of memory values.
  15.  
  16.  
  17. Single-Line Memory Windows
  18.  
  19. A single-line memory window line consists of a specification,
  20. typed in by you, followed by a display, supplied by the debugger.
  21.  
  22. To type in a specification on any one of window lines 1 through
  23. 6, simply type the associated digit, 1 through 6, when the
  24. debugger is in its main command mode.  The cursor will jump to
  25. the beginning of the memory-window line you are specifying.  You
  26. then type in a display format specification, followed by the
  27. address of memory you want displayed.
  28.  
  29. The simplest form of the display format specification is a single
  30. letter, signifying one of the display types available.  The
  31. choices are:
  32.  
  33.     B  for hexadecimal bytes
  34.     W  for hexadecimal words
  35.     N  for decimal bytes
  36.     D  for decimal words
  37.     Q  for octal bytes
  38.     O  for octal words
  39.     T  for text; each byte reduced to one ASCII display
  40.           character
  41.     A  for ASCII text, each byte occupying 2 display
  42.           characters (the exact display is spelled out later
  43.           in this chapter)
  44.     C  for ASCII characters, occupying 2 bytes if needed,
  45.           otherwise one
  46.  
  47. A format specification of one of the above letters will cause the
  48. debugger to display the array of bytes starting at the address
  49. you specify, in the format indicated by the letter, as long as
  50. there is room on the line. All letters in a format specification
  51. (or in any other context in the debugger) can be typed in either
  52. upper or lower case.
  53.                                                               6-2
  54.  
  55. The format specification should be terminated by a comma.  After
  56. the comma (and an optional space), you type the address of memory
  57. you want displayed. This consists of two values, the segment
  58. followed by the offset.  The values should be separated by a
  59. comma. You can omit the segment value if you wish: in that case,
  60. the current value of DS is used. The debugger reminds you that
  61. you have specified this option by following what you type with 2
  62. commas instead of one.
  63.  
  64. The value you type can take one of the following forms:
  65.  
  66.    a. a numeric constant, whose format is just as in the assembly
  67.       language (leading zero means default hex, otherwise default
  68.       decimal)
  69.  
  70.    b. a register name (IP is now accepted as a register name)
  71.  
  72.    c. a user symbol from the assembly language program being
  73.       debugged.
  74.  
  75. After you type the address specification, you hit the ENTER key,
  76. and the debugger fills out the rest of the line with the memory
  77. display.
  78.  
  79. For example, if you want to display hex bytes starting at 01000
  80. hex on display line 2, you type 2b,01000<ENTER>. The cursor jumps
  81. to the line immediately when you type the 2, and it displays the
  82. b,01000 on the line as you type it.  The b says you want hex
  83. bytes, and the 01000 has a leading zero to signify a hexadecimal
  84. address, not decimal.  When you press the ENTER key, the debugger
  85. displays two commas, followed by the hex bytes.  If the memory is
  86. zeroed, you will see 00 00 00 00 00 etc. to the end of the
  87. display line.
  88.  
  89.  
  90. Erasing Memory Display Lines
  91.  
  92. Any memory display window that you specify will remain in effect,
  93. always updated to show the latest memory contents, until you
  94. explicitly erase it. To erase a window, you type the number of
  95. the window, followed by a blank.  The line will also be erased if
  96. you start typing a format specification, and you hit the ENTER
  97. key before you get to your address specification.
  98.  
  99. In the coming sections, many of the examples assume (and they say
  100. so) that your display is blank before you type in the example.
  101. You can always get a blank display by typing in each number
  102. followed by a blank: "1 2 3 4 5 6 ".
  103.  
  104. If you accidentally type a digit and DON'T want to erase the line
  105. your cursor has jumped to, press the ESC key to return to the
  106. main command mode.
  107.                                                               6-3
  108.  
  109. Continuation Lines
  110.  
  111. You may continue a memory display window onto the next line, by
  112. placing a double quote mark " at the beginning of the next line.
  113. You may do this in one of two ways: you may type the number of
  114. the next line, followed by the double quote mark; or you may
  115. simply type the double quote mark at the command level.  The
  116. first method allows you to specify which window line you want
  117. continued, if there is more than one.  The second method is more
  118. convenient to use.  It places the quote mark on the last blank
  119. line that immediately follows a non-blank line.
  120.  
  121. You may continue placing " marks on as many lines as you have,
  122. creating a multi-line display.
  123.  
  124. The debugger follows the " mark with the address of memory being
  125. displayed, followed by the memory, according to the start of the
  126. type specification of the line being continued.  The memory
  127. display is aligned with the display of above line.
  128.  
  129. If you are creating a multi-line display, and your specification
  130. is a long one, you may wish to start the display at the beginning
  131. of the next line, rather than after the specification on the
  132. first line.  This will often give you more room.  You do this by
  133. terminating the format specification with a slash / instead of a
  134. comma.  For example, to display many hex bytes at the array
  135. BYTE_ARRAY, type 1b/byte_array<ENTER> followed by five double
  136. quote marks, when the memory display is empty.
  137.  
  138.  
  139. Mixed Format Specification
  140.  
  141. Instead of having all your bytes or words on a line displayed in
  142. the same format, you can mix your formats.  You do this by
  143. providing more than one letter in your format specification.  The
  144. debugger will display one memory unit for each letter-type you
  145. specify.  The line will be filled out with the last type given.
  146. For example, if you type 3nwb,01000<ENTER>, you will get a
  147. display on memory line 3 of the decimal byte at 01000, the hex
  148. word at 01001, and an array of hex bytes starting at 01003.
  149.  
  150.  
  151. Numbers in a Format Specification
  152.  
  153. You may precede any letter in a format specification with a
  154. number up to 255. The effect is the same as if you had repeated
  155. the letter the given number of times.  For example, if you type 1
  156. to go to memory line 1, followed by 4w10tb,02000<ENTER>, you will
  157. get 4 hex words at 02000, 10 text characters at 02008, and an
  158. array of hex bytes from 02012 filling out the rest of the line.
  159.                                                               6-4
  160.  
  161. You may also end your format specification with a number up to
  162. 255.  This will cause the entire specification to be repeated the
  163. given number of times. If there is room on the line for the full
  164. number given, the display will stop there-- there will be no
  165. repeating of the last type byte.  If there is not room on the
  166. line for the full number of global iterations, the debugger will
  167. stop at the end of the last iteration that would fit.  For
  168. example, the specification b8 causes 8 hex bytes to be displayed,
  169. and the remainder of the display line to be blank.  The
  170. specification b3w9 will cause the debugger to try to output 9
  171. records, each consisting of a hex byte followed by 3 hex words.
  172. After putting out 2 such records, the debugger will see that
  173. there is not room for a third full record, so it will stop.  This
  174. stopping at the record boundary allows you to continue the
  175. display, with correct alignment, on subsequent lines.
  176.  
  177.  
  178. Spacing Between Memory Display Units
  179.  
  180. In general, the debugger provides a space between each unit (byte
  181. or word) it displays.  There is an exception, however: the
  182. debugger will not space between adjacent text characters (A,C, or
  183. T specifications).
  184.  
  185. There are special specifiers G, J, and M, described in the
  186. section below, that allow you to override the debugger's spacing
  187. policies.
  188.  
  189.  
  190. Special-Action Format Specifiers
  191.  
  192. In addition to the 9 letters already mentioned that specify data
  193. types, there are 10 other letters, and 2 other characters, that
  194. cause the debugger to perform special actions.  Following is a
  195. complete description of all 21 non-digit characters that can
  196. occur within a format specification:
  197.  
  198. =  causes a display, using the format of the letter following =,
  199.    of the current memory pointer value, instead of the contents
  200.    of the memory location.  If a letter does not follow the =,
  201.    then W is used; i.e., the pointer is displayed as a 4-digit
  202.    hex word.  There are two uses for this feature that come to
  203.    mind:
  204.  
  205.    * If your address specification is symbolic, you can display
  206.      the equivalent numeric address with =w, telling you exactly
  207.      where the symbol is in memory.  Note that this display
  208.      implicitly occurs at the beginning of continuation lines. If
  209.      the format specification begins with =, then the implicit
  210.      display is suppressed, because the same address is given
  211.      explicitly by the L.
  212.  
  213.    * You can display the values of registers in a format other
  214.      than hex.  For example, in the 8086 debugger you can display
  215.      AX as a decimal number by specifying =d1,ax on one of the
  216.      memory display lines.
  217.                                                               6-5
  218.  
  219. @  causes the debugger to read the next byte it was going to
  220.    display, and instead of displaying the byte, use it as a
  221.    count, to repeat the next letter in the specification.  The
  222.    debugger uses only the bottom 7 bits of the memory byte for
  223.    the count.  For example, if the memory contains a length byte
  224.    followed by that number of text characters, the text could be
  225.    displayed by specifying @t (or @a or @c, depending on what you
  226.    want the display to look like).  If the memory contains 05 41
  227.    42 43 44 45, the @t would cause ABCDE to be displayed.
  228.  
  229. A  causes a display of a single ASCII byte, always using 2
  230.    display bytes. The following table shows what is displayed for
  231.    unusual bytes:
  232.  
  233.      range of N        display of N                Example
  234.  
  235.      00--1F            ^ followed by N+040         02 is ^B
  236.      22                ""
  237.      23                "#
  238.      24                "$
  239.      5E                "^
  240.      7F                ^r  (r stands for rubout)
  241.      80--9F            $ followed by N-080+040     081 is $A
  242.      A0--FE            # followed by N-080         0B1 is #1
  243.      FF                $r
  244.  
  245.    All other bytes cause a display of a space following by the
  246.    appropriate ASCII byte.  The A specification is used when you
  247.    need guaranteed display length for proper alignment of
  248.    continuation lines; and you do not want the potential loss of
  249.    information provided by the single-byte T specification.
  250.  
  251. B  causes a display of a single byte as a 2-digit hexadecimal
  252.    number.  Numbers less than hex 10 have a leading 0, so that
  253.    the display is always 2 digits.
  254.  
  255. C  causes a display of a single ASCII character, just as the A
  256.    specification, except that normal characters (not in the
  257.    table) display as just one byte, without the preceding space.
  258.  
  259. D  causes the display of a 16-bit word as an unsigned positive
  260.    decimal number. There will be no leading zeros in the display;
  261.    so the length of the display depends on the size of the
  262.    number.
  263.  
  264. F  causes the display of a floating point number, in one of the
  265.    three formats recognized by the 8087.  You must have a
  266.    floating point chip (8087 or 287) installed in your computer
  267.    for this to work.  You specify which of the three formats you
  268.    are reading by one of three letters immediately following the
  269.    letter F:
  270.  
  271.    FD  specifies a 4-byte Doubleword (single precision) number
  272.    FQ  specifies an 8-byte Quadword (double precision) number
  273.    FT  specifies a Ten-byte number-- 8087 extended precision.
  274.                                                               6-6
  275.  
  276. G  causes a gap between the adjacent display formats, of one
  277.    space more than there would have been without the G.  For
  278.    adjacent string bytes, this means a space where there would
  279.    have been none.  For other data types, this means two spaces
  280.    where there would have been one.
  281.  
  282. J  (join) causes two adjacent data types, that would have had a
  283.    space between them, to have no space.
  284.  
  285. L  (line) causes the display of an entire text line, using the
  286.    C-format for each character of the line.  The debugger does
  287.    not display the terminating carriage return; nor does it
  288.    display the following linefeed if there is one.  (If you want
  289.    it to, specify LUC or LUUCC instead of L.)  If a carriage
  290.    return is not found and the display line fills, then the
  291.    L-specifier is cut off in mid-string.  Any continuation line
  292.    will start up at the beginning of the format specification, at
  293.    the mid-string place in memory.
  294.  
  295. M  (mark) causes a vertical-bars symbol to be displayed.  The
  296.    symbol will replace a separating space that would have been
  297.    output in the position.  If you want the space, you can
  298.    provide G on either side (or both sides) of the M.
  299.  
  300. N  (number) causes the display of an 8-bit byte as an unsigned
  301.    positive decimal number.  There will be no leading zeroes in
  302.    the display; so the length of the display depends on the size
  303.    of the number.
  304.  
  305. O  causes a display of a 16-bit word as a 6-digit octal number.
  306.    Numbers less than octal 100000 have one or more leading
  307.    zeroes, so that the display is always 6 digits.
  308.  
  309. Q  causes a display of a single byte as a 3-digit octal number.
  310.    Numbers less than octal 100 have one or more leading zeroes,
  311.    so that the display is always 3 digits.
  312.  
  313. S  causes the display of an entire null-terminated string, using
  314.    the C-format for each character of the string.  The
  315.    terminating null (hex 00) does not generate a display (if you
  316.    want it to, specify SUC instead of S).  If a null is not found
  317.    and the display line fills, then the S-specifier is cut off in
  318.    mid-string.  Any continuation line would start up at the
  319.    beginning of the format specification, at the mid-string place
  320.    in memory.
  321.  
  322. T  causes the display of a single ASCII text byte, with a
  323.    guaranteed display space of one character.  The character
  324.    displayed is the same as the second character of the A-format.
  325.    This means that you will not be able to tell the difference
  326.    between normal, displaying ASCII characters, and their control
  327.    and non-ASCII counterparts.  You gain a compact
  328.    representation, but you also gain ambiguity.
  329.  
  330. U  (unskip) causes the memory display pointer to decrement by one
  331.    byte.   No display is generated by this command.  This command
  332.    is useful in several contexts:
  333.                                                               6-7
  334.  
  335.    * displaying memory in more than one format.  For example, the
  336.      specification 8b8u2g8a gives a hex-and-ASCII side-by-side
  337.      display, similar to that provided by many memory dump
  338.      programs.
  339.  
  340.    * displaying memory out of its sequence order.  To test your
  341.      understanding of the special-action letters in a format
  342.      specification, you should convince yourself that the
  343.      specification xb2ujbx99/ gives the same display on the
  344.      following " continuation line as the specification w/ does.
  345.  
  346.    * displaying the count byte consumed by the @ character.  For
  347.      example, instead of @t, you could specify nu@t, which would
  348.      display the string count as well as the string.  If memory
  349.      were 05 41 42 43 44 45, this would be 5 ABCDE.
  350.  
  351. W  causes a display of a 16-bit word as a 4-digit hex number.
  352.    Numbers less than hex 1000 have one or more leading zeroes, so
  353.    that the display is always 4 digits.
  354.  
  355. X  causes the debugger to skip over the memory byte currently
  356.    pointed to, without displaying it.  The memory pointer is thus
  357.    incremented.
  358.  
  359. Z  is given immediately following another format letter.  It
  360.    causes the display to fill out the line with displays of the
  361.    given preceding format; but instead of starting with the given
  362.    address, the debugger starts with a lower address, and
  363.    displays memory up to but not including the given address.
  364.  
  365.    The most common usage of Z is to display the memory just
  366.    output by a moving output pointer.  For example, in the 8086
  367.    debugger, you could specify bz,es,di to display the hex bytes
  368.    most recently output by the STOSB instruction.
  369.  
  370.    Note that Z makes sense only in a limited number of contexts.
  371.    You will almost certainly want to use Z only as the second
  372.    letter of a two-letter specification, as in the example above.
  373.    I further recommend that you use a format letter that
  374.    generates a fixed length display; i.e., B,W,Q,O,T, or C.  If
  375.    you use a variable length display (N,D, or A), the debugger
  376.    will be as pessimistic as possible about the number of display
  377.    characters needed, so that the display will likely terminate
  378.    before the end of the line.
  379.  
  380.    A continuation of a Z-line will produce the same output as the
  381.    original line.  If you want to continue beyond the address
  382.    given, repeat the specification without the Z.
  383.                                                               6-8
  384.  
  385.    I now discuss what happens if you use Z in other contexts.
  386.    Unless your taste runs to the bizarre, you should skip this
  387.    paragraph.  Since Z fills out a line, there should be no
  388.    specifiers after Z: they would be ignored.  Also note that Z
  389.    has an effect only on the single letter that precedes it.  If
  390.    you precede Z with more than one letter, you will get a
  391.    confusing effect: the display would start out forward from the
  392.    address, then it would retreat when it got to Z's preceding
  393.    letter.  The Z-array would run up to the address reached
  394.    before, which is forward from the address you specified.
  395.  
  396.  
  397. The Data Memory Window
  398.  
  399. You may cause the switchable window in the upper right quadrant
  400. of the screen to display 14 lines of memory, continuing from the
  401. last of the lines you specified within the 6-line memory area. To
  402. do this, you:
  403.  
  404. 1. Type a format-and-address specification on one of the numbered
  405.    memory lines, as previously described in this chapter.  For
  406.    example, to display Bytes at location DS:0100, type 6b,ds,0100
  407.    followed by the ENTER key.
  408.  
  409. 2. If you have already selected the memory window, you'll
  410.    automatically have a continuation of the memory line you just
  411.    specified, into the upper right quadrant of the screen.  If
  412.    not, you may select the window by pressing either the ctrl-N
  413.    or ctrl-P keys.
  414.  
  415. Once you have set up a 14-line window, you may page through
  416. memory with the ctrl-N (Next memory page) and ctrl-P (Previous
  417. memory page) keys, described in Chapter 4.
  418.  
  419. If, after having pressed ctrl-N or ctrl-P several times, you wish
  420. to return to the first window continuing from the address you
  421. specified, you may do so by typing the digit (1 to 6) of the last
  422. specification line, followed immediately by the ESC key to
  423. preserve the specification settings.  The memory window will be
  424. reset to its continuation value.  For example, if your
  425. specification was on line 6, you type 6 followed immediately by
  426. the ESC key.
  427.  
  428. If you want your 14-line memory window to start at a certain
  429. address instead of continuing from a 1-line display, you can
  430. separate the format and the address with a slash instead of a
  431. comma.  For example, if you want Words at location ES:0, type 6
  432. followed by w/es,0 followed by the ENTER key.
  433.  
  434.