Debug: L
Page updated January 21, 2005
Loads a file or the contents of specific disk sectors into memory. Used without parameters, the l subcommand loads the file you specified on the debug command line into memory, beginning at address CS:100. Debug.exe also sets the BX and CX registers to the number of bytes loaded. If you did not specify a file on the debug command line, the file loaded is the one you most recently specified by using the n (name) subcommand.
Syntax
l [Address] [Drive] [FirstSector] [Number]
Parameters
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.
- To load the contents of the number of bytes specified in
the BX:CX registers from a disk file, use the following
syntax:
l [Address]
- To bypass the file system and directly load specific
sectors, use the following syntax:
l [Address] [Drive] [FirstSector] [Number]
-
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
-
Using the Address parameter
If you use the l subcommand with the Address parameter, Debug.exe begins loading the file or the contents of the specified sectors at the memory location Address.
- Using all parameters
If you use the l subcommand with all of the parameters, Debug.exe loads the contents of specific disk sectors instead of loading a file.
- Loading the contents of specific sectors
Each sector in the range you specify is read from Drive. Debug.exe begins loading with FirstSector and continues until the contents of the number of sectors specified in Number are loaded.
- Loading an .exe file
Debug.exe ignores the Address parameter for .exe files. If you specify an .exe file, Debug.exe relocates the file to the loading address specified in the header of the .exe file. The header itself is stripped off the .exe file before the file is loaded into memory, so the size of an .exe file on disk differs from its size in memory. If you want to examine a complete .exe file, rename the file with a different extension.
- Opening a .hex file
Debug.exe assumes that files with the .hex extension are hexadecimal-format files. You can type the l subcommand with no parameters to load a hexadecimal file beginning at the address specified in the hexadecimal file. If the l subcommand you type includes the Address parameter, Debug.exe adds the specified address to the address found in the hexadecimal file to determine the starting address.
- For information about specifying a file by using the n (name) subcommand, see Related Topics.
- For information about writing a file that you are debugging to a disk by using the w (write) subcommand, see Related Topics.
Examples
debug
Type:
nfile.com
To load File.com, type:
l
Debug.exe loads the file and displays the debug prompt.
To load the contents of 109 (6Dh) sectors from drive C, beginning with logical sector 15 (0Fh), into memory beginning at address 04BA:0100, type:
l04ba:100 2 0f 6d
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