DEBUG The DEBUG program can be used to load, alter, or display any file. The program executes object files, the files that are executable programs in machine language format. Using this program, you can fix problems in your program directly, and then execute it immediately to determine if the problems have been resolved. The following is a short list of the DEBUG commands: Command Description ----------------------------------------------------------------------------- A Assembles Macro Assembler Language statements directly into memory: -A 0100 C Compares the contents of two blocks of memory: -C 0100 L20 0200 D Displays (Dumps) the contents of a portion of memory: -D CS:0100 010A (If no segment is specified, the segment contained in the DS register is assumed.) E 1. Replaces the contents of one or more bytes, starting at the specified address, with the values contained in the list: -E address list -E DS:0100 F3"xyz"8D 2. Displays and allows modification of bytes in a sequential manner: -E address -E CS:0100 might cause the following display: 04AB:0100 EB._ To change the contents of 04AB:0100 from hex EB to hex 41, enter 41: 04AB:0100 EB.41_ F Fills the memory locations in the range with the values in the list: -F range list -F 04AB:0100 L05 F3"xyz"8D G Executes the program that is being debugged H Hexadecimal Add and Subtract (Displays the sum and difference of the two hexadecimal values): -H 0F 08 would cause the following display: 17 07 I Inputs and displays (in hex) 1 byte from the specified port: -I 2F8 would display the single byte read from the port designated as 2F8 L Loads a file (from a diskette) into memory: -L address drive starting(sector) length(in sectors) -L DS:0100 01 0F 10 would load into memory the 16 (10) sectors of data from the diskette in the Drive B (01) starting with relative sector 15 (0F). DEBUG -N PgmAsmt1.Asm -L would load the file named "PgmAsmt1.Asm" from the diskette in the default drive and place it in memory beginning at CS:0100. M Moves the contents of the memory locations specified by range to the locations beginning at the specified address: -M range address -M CS:0100 0110 0500 would move the 17 bytes of data (from CSC:0100 thru CS:0110) to memory beginning at DS:0500. N Establishes a file name O Outputs a value to a port: -O 2F8 4F would send the byte value 4F to Port 2F8. Q Ends the DEBUG program R Displays the contents of registers: -R (would display all registers) -R F (would display all Flags registers) -R AX (would display the AX register) S Searches the range for the character(s) in the list: -S range list -S CS:0100 0110 40 would search the range from CS:0100 thru 0110 for hex 40 T Executes one or more instructions starting with the instruction at CS:IP or at = address if address is specified U Unassembles instructions (translates the contents of memory into assembler-like statements) and displays their addresses and hexadeci- mal values, together with assembler-like statements: -U address or -u range -U 0100 (If you enter only an offset, the U command assumes the segment contained in the CS register) -U 0100 0110 W Writes the data being debugged to the diskette in the default drive P Causes the execution (Process) of a subroutine call, a loop, an interrupt, or a repeat string instruction. P [=Address] [Value]