MSI Lab
MSI Lab
MSI Lab
address :–
Range: –
List: –
A string of Hexadecimal bytes separated by a space, or ASCII data enclosed
within single or double quote marks.for example:
e 100 31 C0 B4 09 BA 50 02 CD 21 B8 4C 00 CD 21
e 250 'This is an ASCII data string.$'
number - Remember that all numbers and values used in any DEBUG commands
are understood as being Hexadecimal only! That includes the number of sectors in
the LOAD or WRITE commands and even the number of instructions you want
DEBUG to step through in the TRACE or PROCEED commands. It's all HEX all
the time in here!
Quit: Q
Immediately quits (exits) the Debug program! No questions ever asked... should be the first
command you remember along with the "?" command.
Hex: H value1 value2
A very simple (add and subtract only) Hex calculator. Never forget that all numbers
inside of DEBUG are always Hexadecimal. Enter two Hex values (no more than four
digits each) and DEBUG shows firstthe SUM, then the DIFFERENCE of those
values. Examples:
-h aaa 531 -h fff 3 -h dbf ace
0FDB 0579 1002 0FFC 188D 02F1
Dump: D [range]
D [address] [length]
Displays the contents of a block of memory. The Memory locations near the beginning of
Segment C000 (even under Windows 2000/XP) should display information about the kind of
video card installed on your PC. This first example shows we have a Matrox card in this system.
Examples:
-d c000:0010
C000:0010 24 12 FF FF 00 00 00 00-60 00 00 00 00 20 49 42 $.......`.... IB
C000:0020 4D 20 43 4F 4D 50 41 54-49 42 4C 45 20 4D 41 54 M COMPATIBLE MAT
C000:0030 52 4F 58 2F 4D 47 41 2D-47 31 30 30 20 56 47 41 ROX/MGA-G100 VGA
C000:0040 2F 56 42 45 20 42 49 4F-53 20 28 56 31 2E 32 20 /VBE BIOS (V1.2
C000:0050 29 00 87 DB 87 DB 87 DB-87 DB 87 DB 87 DB 87 DB )...............
C000:0060 50 43 49 52 2B 10 01 10-00 00 18 00 00 00 00 03 PCIR+...........
C000:0070 40 00 12 10 00 80 00 00-38 37 34 2D 32 00 FF FF @.......874-2...
C000:0080 E8 26 56 8B D8 E8 C6 56-74 22 8C C8 3D 00 C0 74 .&V....Vt"..=..t
-
Search: S range list
Searches within a range of addresses for a pattern of one or more byte values given in
a list. The list can be comprised of numbers or character strings enclosed by
matching single or double quote marks.Examples:
-s fe00:0 ffff "BIOS"
FE00:0021
FE00:006F
-d fe00:0
FE00:0000 41 77 61 72 64 20 53 6F-66 74 77 61 72 65 49 42 Award SoftwareIB
FE00:0010 4D 20 43 4F 4D 50 41 54-49 42 4C 45 20 34 38 36 M COMPATIBLE 486
FE00:0020 20 42 49 4F 53 20 43 4F-50 59 52 49 47 48 54 20 BIOS COPYRIGHT
FE00:0030 41 77 61 72 64 20 53 6F-66 74 77 61 72 65 20 49 Award Software I
FE00:0040 6E 63 2E 6F 66 74 77 61-72 65 20 49 6E 63 2E 20 nc.oftware Inc.
FE00:0050 41 77 03 0C 04 01 01 6F-66 74 77 E9 12 14 20 43 Aw.....oftw... C
FE00:0060 1B 41 77 61 72 64 20 4D-6F 64 75 6C 61 72 20 42 .Award Modular B
FE00:0070 49 4F 53 20 76 34 2E 35-31 50 47 00 DB 32 EC 33 IOS v4.51PG..2.3
Compare: C range address
Compares two blocks of memory. If there are no differences, then DEBUG simply
displays another prompt (-). Here's an example of what happens when
there are differences:
-c 140 148 340
127D:0143 30 6D 127D:0343
127D:0146 10 63 127D:0346
127D:0148 49 30 127D:0348
The bytes at locations 140 through 148 are being compared to those at 340 (through
348, implied); the bytes are displayed side by side for those which are different (with
their exact locations, including the segment, on either side of them).
Fill: F range list
This command can also be used to clear large areas of Memory as well
as filling smaller areas with a continuously repeating phrase or single byte. Examples:
-f 100 12f 'BUFFER'
-d 100 12f
xxxx:0100 42 55 46 46 45 52 42 55-46 46 45 52 42 55 46 46 BUFFERBUFFERBUFF
xxxx:0110 45 52 42 55 46 46 45 52-42 55 46 46 45 52 42 55 ERBUFFERBUFFERBU
xxxx:0120 46 46 45 52 42 55 46 46-45 52 42 55 46 46 45 52 FFERBUFFERBUFFER
Enter: E address [list]
Used to enter data or instructions (as machine code) directly into Memory locations.
Example: First we'll change a single byte at location CS:FFCB from whatever it was
before to D2
-e ffcb d2
The next two examples show that either single(') or double(") quote marks are
acceptable for entering ASCII data. By allowing both forms, you can include the other
type of quote mark within your entry string:
-e 200 'An "ASCII-Z string" is always followed by '
-e 22a "a zero-byte ('00h')." 00
Go: G [=address] [addresses]
Go is used to run a program and set breakpoints in the program's code. As we saw in
an Example for the ENTER command, the '=address' option is used to tell DEBUG a
starting location. If you use 'g' all by itself, execution will begin at whatever location
is pointed to by the CS:IP registers. Optional breakpoints ( meaning the program will
HALT before executing the code at any of these locations) of up to any ten
addresses may be set by simply listing them on the command line.
Requirements: Breakpoints can only be set at an address containing the first byte of a
valid 8088/8086 Opcode. So don't be surprised if picking some arbitrary address
never halts the program; especially if you're trying to DEBUG a program containing
opcodes DEBUG can't understand (that's anything 'requiring' a CPU above an
8088/8086)!
CAUTION: DEBUG replaces the original instructions of any listed breakpoint
addresses with CCh (an INT 3). The instructions at these locations are restored to
their originals ONLY if one of the breakpoints is encountered... If DEBUG does not
HALT on any breakpoint, then all your breakpoints are still enabled! So, don't ever
save the code as is, unless you're sure that DEBUG has hit one of your breakpoints!
( Saving to a backup copy before using breakpoints is often a better way. )
Assemble: A [address]
Creates machine executable code in memory beginning at CS:0100 (or the specified
address) from the 8086/8088 (and 8087) Assembly Language instructions which are
entered. Although no Macro instructions nor labels are recognized, you can use
the pseudo-instructions 'DB' and 'DW' (so you can use the DB opcode to enter ASCII
data like this: DB 'This is a string',0D,0A ).
The 'A' command remembers the last location where any data was assembled, so
successive 'A' commands (when no address is specified) will always begin at the next
address in the chain of assembled instructions. This aspect of the command is similar
to the Dump command which remembers the location of its last dump (if no new
address is specified).