Computer and Software Support


Debug: C (Compare)

Page updated January 21, 2005

 

Compares two portions of memory.
 
 
Syntax
crange address
Parameters
Range
Required. Specifies the starting and ending addresses, or the starting address and length, of the first area of memory you want to compare.
Address
Required. Specifies the starting address of the second area of memory you want to compare.
?
Displays a list of debug subcommands.
Remarks
  • Windows XP and the Windows Server 2003 family of products do not use this command. It is included only to preserve compatibility with existing MS-DOS files, but it has no effect at the command line because the functionality is automatic.
  • Specifying valid Range entries

    Use Range with a debug subcommand to specify a range of memory. You can choose one of the following formats for Range: a starting address and an ending address, or a starting address and the length (denoted by l) of the range. For example, both of the following syntaxes specify a 16-byte range beginning at CS:100:

    cs:100 10f

    cs:100 l 10

  • Specifying valid Address entries

    Address is a two-part designation, containing either an alphabetic segment register or a four-digit segment address with an offset value. You can omit the segment register or segment address. CS is the default segment for the following debug subcommands: a, g, l, t, u, and w. DS is the default segment for all other subcommands. All numeric values are in hexadecimal format. You must include a colon between the segment name and the offset value. The following are valid addresses:

    CS:0100

    04BA:0100

  • If the Range and Address memory areas are identical, the c subcommand displays nothing and returns to the debug prompt. If there are differences, c displays them in the following format:

    address1 byte1 byte2 address2

Examples
To compare the block of memory from 100h through 10Fh with the block of memory from 300h through 30Fh, type:

c100,10f 300

or

c100l10 300

Both of these commands produce the following output (assuming DS = 197F):

197F:0100 4D E4 197F:0300

197F:0101 67 99 197F:0301

197F:0102 A3 27 197F:0302

197F:0103 35 F3 197F:0303

197F:0104 97 BD 197F:0304

197F:0105 04 35 197F:0305

197F:0107 76 71 197F:0307

197F:0108 E6 11 197F:0308

197F:0109 19 2C 197F:0309

197F:010A 80 0A 197F:030A

197F:010B 36 7F 197F:030B

197F:010C BE 22 197F:030C

197F:010D 83 93 197F:030D

197F:010E 49 77 197F:030E

197F:010F 4F 8A 197F:030F

The addresses 197F:0106 and 197F:0306 are missing from the list. This means that the values in those addresses are identical.

Formatting legend

Format Meaning
Italic Information that the user must supply
Bold Elements that the user must type exactly as shown
Ellipsis (...) Parameter that can be repeated several times in a command line
Between brackets ([]) Optional items
Between braces ({}); choices separated by pipe (|). Example: {even|odd} Set of choices from which the user must choose only one
Courier font Code or program output

Some of these terms may be the same or similar to DOS commands. For information on DOS Commands, click here