`
`DEBUG: N
`
`Finally, to execute the program CLEAN.COM,type
`-G <Enter>
`
`Theresult is the same as if the CLEAN.COM program had been run from the MS-DOS
`commandlevel with the entry
`CoCLEAN MYFILE.DAT <Enter>
`
`except that the program is executing under the control of DEBUG and within DEBUG’s
`memory buffer.
`
`Section IV: Programming Utilities
`
`1041
`
`OLYMPUS EX. 1010 - 1051/1582
`
`OLYMPUS EX. 1010 - 1051/1582
`
`
`
`DEBUG: O
`
`DEBUG: O
`
`Output to Port
`
`Purpose
`
`Writes 1 byte to an input/output (I/O)port.
`
`Syntax
`
`O portbyte
`where:
`
`is an I/O port address from 0 through FFFFH.
`is a value from 0 through OFFHto be written to the I/O port.
`
`port
`byte
`Description
`The Output to Port (O) commandwrites 1 byte of data to the specified I/O port address.
`The data value mustbe in the range 00H through OFFH.
`
`Warning: The O commandshould be used with caution becauseit directly accesses the
`computer hardware and no error checking is performed. Attempts to write to some port
`addresses, such as those for ports connected to peripheral device controllers, timers, or the
`system’s interrupt controller, may cause the system to crash or damage data stored on disk.
`Example
`
`To write the value C8H to I/O port 10AH, type
`-0O 10A C8 <Enter>
`
`
`
`1042
`
`The MS-DOS Encyclopedia
`
`
`
`OLYMPUS EX. 1010 - 1052/1582
`
`OLYMPUS EX. 1010 - 1052/1582
`
`
`
`DEBUG:P
`
`DEBUG: P
`
`Proceed Through Loopor Subroutine
`
`Purpose
`
`Executesa loop, repeated string instruction, software interrupt, or subroutine call
`to completion.
`
`Syntax
`
`P (=address] [number]
`
`where:
`
`isthe location of thefirst instruction to be executed.
`address
`number—isthe numberofinstructions to execute.
`
`
`
`Description
`The Proceed Through Loop or Subroutine (P) commandtransfers control from DEBUG
`to the target program. The program executes withoutinterruption until the loop, repeated
`string instruction, software interrupt, or subroutine call at address is completed or until
`the specified number of machine instructions have been executed. Control then returns
`to DEBUG,andthe contents ofthe target program’s registers and the status ofthe flags are
`displayed.
`
`If the address parameter does not include an explicit segment, DEBUG usesthe target pro-
`gram’s CSregister, if address is omitted entirely, execution begins at the address specified
`bythe target’s CS:IP registers. The address parameter must be preceded by an equal sign
`(=) to distinguishit from number.
`
`If the instruction at address is not a loop, repeated string instruction, software interrupt,
`or subroutinecall, the P command functionsjustlike the Trace Program Execution (T)
`command. The optional number parameter specifies the numberof instructions to be
`executed before control returns to DEBUG.If number is omitted, DEBUG executes only
`one instruction. After each instruction is executed, DEBUG displays the contents of the
`target program’s registers, the status of the flags, and the next instruction to be executed.
`
`_ Warning: The P commandcannotbe used to trace through ROM.
`Example
`Assumethat the target program’s location CS:143FH contains a CALL instruction. To
`execute the subroutine thatis the destination of CALL and then return control to
`DEBUG,type
`-P =143F <Enter>
`
`Section IV: Programming Utilities
`
`1043
`
`OLYMPUS EX.1010 - 1053/1582
`
`OLYMPUS EX. 1010 - 1053/1582
`
`
`
`DEBUG: Q
`
`DEBUG: Q
`Quit
`
`Purpose
`
`Ends a DEBUGsession.
`
`Syntax
`
`Q
`Description
`
`The Quit (Q) command terminates the DEBUG program andreturns control to MS-DOS or
`the commandshell that invoked DEBUG.Any changes to a program or otherfile that were
`not saved on disk with the Write File or Sectors (W) command arelost.
`
`Example
`
`To exit DEBUG,type
`
`-Q <Enter>
`
`
`
`1044
`
`The MS-DOS Encyclopedia
`
`
`
`OLYMPUS EX. 1010 - 1054/1582
`
`OLYMPUS EX. 1010 - 1054/1582
`
`
`
`
`
`DEBUG: R
`
`DEBUG: R.
`Display or Modify Registers
`
`Purpose
`
`Displays the contents of oneorall registers and the status of the CPU flags and allows
`them to be modified.
`
`Syntax
`
`R [register]
`
`where:
`
`register
`
`Description
`
`is the two-character nameofan Intel 8086/8088 register from the following
`list:
`
`AX BX CX DX SP BP SI DI
`DS ES SS CS IP PC
`
`or the character F, which specifies the CPU flags.
`
`The Display or Modify Registers (R) commanddisplays the target program’s register con-
`tents and the status of the CPU flags and allows them to be modified.
`
`If Ris entered without a register parameter, the contents ofall registers and the status of
`the CPU flags are displayed, followed by a disassembly of the machineinstruction cur-
`rently pointed to by the target program’s CS.:IP registers.
`
`If register is included in the R commandline, the contents of the specified register are dis-
`played; then DEBUG prompts with a colon character(:) for a new value. The value is en-
`tered by typing oneto four hexadecimaldigits and then pressing the Enter key. Pressing
`the Enter key without entering any values leaves the register contents unchanged.
`
`Note: Theregister name PCis not fully supported in some versions of DEBUG,so the
`register name IP should be usedinstead.
`
`Specifying the character F instead of a register name causes DEBUGto displaythe status of
`the program’s CPU flags as two-character codes from the followinglist:
`
`Flag Name
`
`Value If Set (1)
`
`Value If Clear (0)
`
`Overflow
`Direction
`Interrupt
`
`OV (Overflow)
`DN (Down)
`EI (Enabled)
`
`NV (No Overflow)
`UP (Up)
`DI (Disabled)
`
`(more)
`
`Section IV: Programming Utilities
`
`1045
`
`OLYMPUS EX. 1010 - 1055/1582
`
`OLYMPUS EX. 1010 - 1055/1582
`
`
`
`DEBUG: R
`
`Flag Name
`
`Value If Set (1)
`
`ValueIf Clear (0)
`
`Sign
`Zero
`Aux Carry
`Parity
`Carry
`
`-
`
`NG (Minus)
`ZR (Zero)
`AC (Aux Carry)
`PE (Even)
`CY (Carry)
`
`PL (Plus)
`NZ (Not Zero)
`NA (No Aux Carry)
`PO (Odd)
`NC (No Carry)
`
`After displaying the flag values, DEBUG displays a hyphen(-) prompt on the sameline.
`Any orall flags can then be altered by typing one or more codes (in any order and op-
`tionally separated by spaces) from the list above and pressing the Enter key. Pressing the
`Enter key without entering any codes leaves thestatus of the flags unchanged.
`Examples
`
`To display the contents of the target program's CPU registers and the status of the CPU
`flags, followed by the disassembled mnemonic for the next instruction to be executed
`(pointed to by CS:IP), type
`-R <Enter>
`
`This producesa display in the following format:
`AX=0000 BX=0000
`CX=00A1
`DX=0000
`SP=FFFE BP=0000 SI=0000 DI=0000
`DS=19A5
`ES=19A5
`SS=19A5 CS=19A5
`IP=0100
`NV UP EI PL NZ NA PO NC
`19A5:0100 BF8000
`'
`MOV
`DI,0080
`
`To display the value of the target program’s BX register, type
`-R BX <Enter>
`
`If BX contains 0200H,for example, DEBUGdisplays that value and then issues a prompt in
`the form ofa colon:
`
`BX 0200
`
`The contents of BX can then be altered by typing a new value and pressing the Enter key
`or left unchanged by pressing the Enter key alone.
`To set the direction and carry flags,first type
`-RF <Enter>
`:
`
`DEBUGdisplays the flag values, followed by a hyphen ©) prompt:
`NV UP EI PL NZ NA PO NC
`-
`
`The direction and carry flags can then beset by entering
`~DN CY <Enter>
`
`
`
`1046
`
`The MS-DOS Encyclopedia
`
`
`
`OLYMPUS EX. 1010 - 1056/1582
`
`OLYMPUS EX. 1010 - 1056/1582
`
`
`
`
`
`
`
`DEBUG: R
`
`Messages
`bfError
`Bad flag: An invalid code for a CPU flag was entered.
`
`br Error
`. Bad register: An invalid register name was entered.
`
`df Error
`Double flag: Two values for the same CPU flag were entered in the same command.
`
`Section IV: Programming Utilities
`
`1047
`
`OLYMPUS EX. 1010 - 1057/1582
`
`OLYMPUS EX. 1010 - 1057/1582
`
`
`
`DEBUG:S
`
`DEBUG: S
`
`Search Memory
`
`Purpose
`
`Searches memory for a pattern of 1 or more bytes.
`
`Syntax
`
`S range list
`
`where:
`
`range
`
`list
`Description
`
`specifies the starting and ending addressesor the starting address and length
`of the area to be searched.
`is 1 or more consecutive byte values and/or a string to be searchedfor.
`
`The Search Memory (S) commandsearchesa designated range of memoryfor a specified
`list of consecutive byte values and/or a text string. The starting address of eachset of
`matching bytesis displayed. The contents of the searched area are not altered.
`
`The range parameter specifies the starting and ending addressesor the starting address
`and length in bytes of the area to be searched.If a segmentis not included in range,
`DEBUGusesDS.If a segment is specified for the starting address, DEBUG usesthe same
`segmentfor the ending address.If a starting address and length in bytes is specified, the
`starting address plus the length minus 1 cannot exceed FFFFH.
`
`To searchfor the string Copyright in the area of memory from DS:0000H through
`DS:1FFFH, type
`
`-S 0 1FFF 'Copyright'
`
`<Enter>
`
`or
`
`-S 0 L2000 "Copyright"
`
`<Enter>
`
`If matches are found, DEBUGdisplaysthe starting address of each:
`20A8:0910
`20A8 :094F
`20A8:097C
`
`
`
`The list parameter specifiesone or more consecutive hexadecimal byte values and/or a
`string to be searchedfor, separated by spaces, commas,or tab characters. Strings must be
`enclosed within single or double quotation marks, and case is significant withinastring.
`Examples
`
`1048=The MS-DOSEncyclopedia
`
`OLYMPUS EX. 1010 - 1058/1582
`
`OLYMPUS EX. 1010 - 1058/1582
`
`
`
`
`
`DEBUG: $
`
`To searchfor the byte sequence 3BH 06H in the area of memory from CS:0100H through
`CS:12A0H,type
`-S CS:100 12A0 3B 06 <Enter>
`
`or
`
`-S CS:100 L11A1
`
`3B 06 <Enter>
`
`Section IV: Programming Utilities
`
`1049
`
`OLYMPUS EX. 1010 - 1059/1582
`
`OLYMPUS EX. 1010 - 1059/1582
`
`
`
`DEBUG: T
`
`DEBUG: T
`
`Trace Program Execution
`
`Purpose
`
`Executes one or moreinstructions, displaying the CPU status after each instruction.
`
`Syntax
`
`T [=address| |number]
`
`where:
`
`Description
`
`The Trace Program Execution (T) command executes one or more instructions, starting at
`the specified address, and after each instruction displays the contents of the CPU registers,
`the status of the flags, and the instruction pointed to by CS:IP.
`
`Warning: The T commandshould not be used to execute any instructions that change
`the contentsof the Intel 8259 interrupt mask (ports 20H and 21H on the IBM PC and com-
`patibles) or to trace calls made to MS-DOS through Interrupt 21H. The Go (G) command
`should be used instead.
`
`The address parameterpointsto the first instruction to be executed. If address does not
`include a segment, DEBUGusesthe target program’s CSregister; if address is omitted en-
`tirely, execution beginsat the address specified by the target program’s CS-:IPregisters.If
`address is included, it must be preceded by an equal sign @)to distinguish it from
`number.
`
`The number parameter specifies the hexadecimal numberof instructions to be executed
`before the DEBUG promptis redisplayed (default = D, Pressing Ctrl-C or Ctrl-Break inter-
`rupts execution of a sequence of T instructions. Consecutive instructions can then be exe-
`cuted individually by entering T commands with no parameters. Pressing Ctrl-S suspends
`execution and pressing any key then resumesthetrace.
`
`Note: The T command can be usedto trace through ROM.
`Example
`To execute one instruction at location CS:1A00H and then return control to DEBUG,dis-
`playing the contents of the CPU registers and thestatusof the flags, type
`-T =1A00. <Enter>
`
`1050
`
`The MS-DOS Encyclopedia
`
`
`
`address_isthe location ofthefirst instruction to be executed.
`number
`isthe numberof machineinstructions to be executed.
`
`OLYMPUS EX. 1010 - 1060/1582
`
`OLYMPUS EX. 1010 - 1060/1582
`
`
`
`DEBUG: U
`
`DEBUG: U
`Disassemble (Unassemble) Program
`
`Purpose
`
`Disassembles machine instructions into assembly-language mnemonics.
`
`‘Syntax
`
`U [range]
`
`where:
`
`range
`
`specifies the starting and ending addressesor the starting address and length
`of the machine codeto be disassembled.
`
`.
`Description
`The Disassemble (Unassemble) Program (U) commandtranslates machine instructions
`into assembly-language mnemonics.
`
`The range parameterspecifies the starting and ending addressesorstarting address and
`length in bytes of the machine instructions to be disassembled. If range does not specify a
`segment, DEBUGusesCS. Note thatif the starting address does notfall on an 8086 instruc-
`tion boundary,the disassembly will be incorrect.
`
`If range does not include a length or ending address, 32 (20H) bytes of memoryare dis-
`assembled beginning at the specified starting address. If range is omitted, 32 bytes of
`memory are disassembled, starting at the address followingthelast instruction dis-
`assembled by the previous U command.If a U commandhasnot been used before
`and range is omitted, disassembly begins at the address specified by the target
`program’s CS:IP registers.
`
`Note: The actual numberof bytes displayed mayvaryslightly from the amount specified
`in range or from the default of 32 bytes because the length of instructions may vary. Also,
`the U commanddoesnot understand instructions specific to the 80186, 80286, and 80386
`microprocessors. It displays such instructions as DBs.
`
`Successive 32-byte fragments of code can be disassembled by entering additional U com-
`mands without parameters.
`Example
`To disassemble 8 bytes of machine instructions starting at CS:0100H,type
`-U 100 107 <Enter>
`|
`
`or
`
`~U 100 L8 <Enter>
`
`Section IV: Programming Utilities
`
`1051
`
`OLYMPUS EX. 1010 - 1061/1582
`
`
`
`OLYMPUS EX. 1010 - 1061/1582
`
`
`
`DEBUG: W
`
`DEBUG: W
`
`Write File or Sectors
`
`Purpose
`
`Writes a file or individual sectorsto disk.
`
`. Syntax
`W [address]
`or
`
`W address drive start number
`
`where:
`
`address
`drive
`
`start
`number
`Description
`
`isthe first memorylocation of the data to be written.
`is the numberof the destination disk drive (0 = drive A, 1 = drive B, 2 = drive
`C, and so on).
`is the numberofthe first logical sector to write (0Q-FFFFH).
`isthe number of consecutive sectors to be written (O—FFFFH).
`
`The Write File or Sectors (W) commandtransfers a file or individual sectors from memory
`to the disk.
`
`When the W commandis entered without parameters or with only an address, the number
`of bytes specified by the contents of registers BX:CX is written from memoryinto thefile
`namedin the most recently used NameFile or Command-Tail Parameters (N) commandor
`thefirst file specified in the DEBUG commandlineif the N commandhasnot been used.
`Files with a .EXE or HEX extension cannot be written with the DEBUG W command.
`
`Note: If a Trace Program Execution (T), Go (G), or Proceed Through Loop or Subroutine
`(P) commandhas beenusedor the contents of the BX or CX registers have been changed,
`the contents of BX:CX must be restored before the W commandis used.
`
`When address is not included in the commandline, the target program’s CS:0100His
`assumed.
`
`The W commandcanalso be used to bypass the MS-DOSfile system and directly access.
`logical sectors on the disk. The memory address (address), disk drive number(drive),
`starting logical sector number(start), and numberofsectors to be written (number) must
`all be provided in the commandline in hexadecimal format. The W command should not
`be used to write sectors on network drives.
`
`Warning: Extreme caution must be used with the W command. Thedisk’s file structure
`can easily be damagedif the wrong parameters are entered.
`
`1052
`
`The MS-DOS Encyclopedia
`
`
`
`OLYMPUS EX. 1010 - 1062/1582
`
`OLYMPUS EX. 1010 - 1062/1582
`
`
`
`DEBUG: W
`
`Example
`Assumethat the interactive Assemble Machine Instructions (A) command was usedto
`create a program in DEBUG’s memorybuffer that is 32 (20H) bytes long, beginning at
`offset 0100H. This program can be written to the file QUICK.COMby using the DEBUG
`NameFile or Command-Tail Parameters (N), Display or Modify Registers (R), and Write
`File or Sectors (W) commandssequentially. First, use the N commandtospecify the name
`ofthefile to be written:
`
`-N QUICK.COM <Enter>
`
`Next, use the R commandto set registers BX and CX to the length to be written. Register
`BX contains the upper, or mostsignificant half, of the length, whereas register CX contains
`the lower, orleast significant half. Type
`-K CX <Enter>
`
`DEBUGdisplays the contents of register CX and prompts with a colon (:). Enter the
`length after the prompt:
`120
`<Enter>
`
`To use the R command againto set register BX to zero, type
`-R BX <Enter>
`
`followed by
`:0 <Enter>
`
`Finally, to create the disk file QUICK.COMand write the program intoit, type
`-W <Enter>
`,
`
`DEBUGresponds:
`
`Writing 0020 bytes
`
`Messages
`
`EXE and HEXfiles cannot be written
`Files with a .EXE or HEX extension cannot be written to disk with the W command.
`
`.
`Writing nnnn bytes
`After a successful write operation, DEBUG displays in hexadecimal format the numberof
`bytes written to disk.
`
`
`
`Section IV: ProgrammingUtilities
`
`1053
`
`OLYMPUS EX. 1010 - 1063/1582
`
`OLYMPUS EX. 1010 - 1063/1582
`
`
`
`
`
`
`
`SYMDEB[options] (symfilelsymfile.. I filename|parameter...) ;
`
`where:
`
`symfile
`
`filename
`parameter
`options
`
`is the nameof a symbolfile created with the MAPSYM utility
`(extension = .SYM).
`is the nameof the binary or executable programfile to be debugged.
`is a command-line parameter required by the program being debugged.
`is one or more of the following switches. Switches can be either upper-
`case or lowercase and can be preceded by a dash (-) instead of a forward
`slash (/).
`
`/I
`/K
`/N
`
`/S
`
`/“commands”
`
`(IBM)specifies that the computer is IBM compatible.
`enablesthe interactive breakpoint key (Scroll Lock).
`enables the use of nonmaskable interrupt break sys-
`tems on IBM-compatible computers (requires special
`hardware).
`enables the Screen Swap (\) command on IBM-com-
`patible computers (the /I switch is also required).
`specifies one or more SYMDEB commands, separated.
`by semicolonsand enclosed in quotation marks.
`
`Description |
`The SYMDEB commandsand capabilities are a supersetof those in DEBUG. SYMDEBis
`also able to load and interpret special symbolfiles that correlate line numbers, symbols,
`and memory addresses. With the aid of such files, SYMDEB enablesthe userto specify
`
`:
`
`|
`
`i i
`
`SYMDEB ©
`
`SYMDEB
`
`Symbolic Debugger
`
`_ Purpose
`The Symbolic Debugger (SYMDEB)allowsa file to be loaded, examined, altered, and writ-
`ten back to disk.If the file contains a program, the program can be disassembled, modi-
`fied, traced one instruction at a time, or executedat full speed with breakpoints. SYMDEB
`can also be used to read, modify, and write absolute disk sectors.
`
`The SYMDEButility is supplied with the Microsoft Macro Assembler (MASM)versions 4.0
`and earlier. This documentation describes SYMDEBversion 4.0.
`
`Syntax
`SYMDEB
`
`or
`
`1054=The MS-DOS Encyclopedia
`
`OLYMPUS EX. 1010 - 1064/1582
`
`OLYMPUS EX. 1010 - 1064/1582
`
`
`
`addresses with labels, variable names, and expressions, rather than only with absolute
`‘hexadecimal addresses. SYMDEB’s commandrepertoire also includes I/O redirection
`commands, floating-point numberentry and display commands,and source-code display
`capabilities that are not present in DEBUG.
`
`The commandline can also contain the names of one or more symfiles, symbolfiles that
`contain symbol and line-number information for the object modules that constitute the
`program being debugged. A symbolfile is created with the MAPSYM utility from a map
`file produced by the Microsoft Object Linker (LINK). A symbolfile always has the exten-
`sion .SYM. See PROGRAMMING UTILITIES: MapsyM;LINK.
`
`The four command-line switches/I, /K, /N, and /S provide SYMDEBwith information
`about the computer on whichtheutility is running. The /I switch is used when the com-
`puter is IBM compatible; this causes SYMDEBto take full advantage of special hardware
`features such as the 8259 Programmable Interrupt Controller or the memory-mapped
`' video display. The /K switch enables the interactive breakpoint key (Scroll Lock), which
`can then be pressedat any time to interrupt a program that is being traced underthe con-
`trol of SYMDEB.
`
`Note: The /K switch is not necessary on an IBM PC/AT, because the Sys Req keyis always
`active as an interactive break key.
`
`The /N switch enables the use of the nonmaskable interrupt as a breakpoint signal on
`IBM-compatible computers; this interrupt is triggered by hardware-assisted debugging
`packages suchas Periscope and Atron Corporation’s Software Probe. The /S switch en-
`ables the Screen Swap (\) command, whichallowsthe output from the program being
`traced to be maintained and displayedon demandona virtual screen separate from the
`SYMDEB commands and messages.
`
`Note: The/I, /N, and /S switches are unnecessary on personal computers built by IBM
`Corporation; SYMDEB automatically enables the capabilities provided by those switches
`when SYMDEBfinds the IBM copyright notice in the machine’s ROM.
`
`After SYMDEBand anyfiles named in the commandline are loaded, SYMDEBdisplaysits
`special prompt character, a hyphen(-), and awaits a command. SYMDEB commandscon-
`sist of one or twoletters, usually followed by one or more parameters. SYMDEBtreats
`
`The SYMDEB commandlinetypically includes the filename parameter, which is the
`name of an executable program (with the extension .COM or .EXE) to be loadedinto
`SYMDEB’s memory buffer. Files with the extension .EXEare loaded in a manner compat-
`ible with the MS-DOSloader. Files with the extension .HEX are convertedto binary images
`and loadedat the internally specified address. All other files are assumedto be direct
`memory images and are read directly into memorystarting at offset 100H. If SYMDEBis
`enteredbyitself, no file information is read into memory. An appropriate program seg-
`ment prefix (PSP) is synthesized at the head of SYMDEB’s buffer for use by thetarget pro-
`gram, the PSP includes a commandtail at offset 80H and default file control blocks (FCBs)
`at offsets 5CH and 6CH,constructed from the optional parameters following filename.If
`necessary, contentsof the file are relocated so that thefile is ready to execute.
`
`SYMDEB
`
`Section IV: Programming Utilities
`
`1055
`
`OLYMPUS EX. 1010 - 1065/1582
`
`OLYMPUS EX. 1010 - 1065/1582
`
`
`
`SYMDEB
`
`uppercase and lowercase characters equivalently except when they are contained in
`strings enclosed within single or double quotation marks. SYMDEB doesnot execute
`commandsuntil the Enter key is pressed.
`
`The SYMDEB commandsdiscussedin this section are
`
`Command
`Action
`
`
`A
`BC
`BD
`BE
`BL
`BP
`Cc
`D
`DA
`DB
`DD
`DL
`DS
`DT
`DW
`E
`EA
`EB
`ED
`EL
`ES
`ET
`EW
`F
`G
`H
`I
`K
`L
`M
`N
`O
`P
`Q
`R
`S
`
`Assemble machineinstructions.
`Clear breakpoints.
`Disable breakpoints.
`Enable breakpoints.
`List breakpoints.
`Set breakpoints.
`Compare memory areas.
`Display memory.
`Display ASCII.
`Display bytes.
`Display doublewords.
`Display long reals.
`Display shortreals.
`Display 10-byte reals.
`Display words.
`Enter data.
`Enter ASCII string.
`Enter bytes.
`Enter doublewords.
`Enter longreals.
`Enter shortreals.
`Enter 10-bytereals.
`Enter words.
`Fill memory.
`Go execute program.
`Perform hexadecimalarithmetic.
`Input from port.
`Perform stack trace.
`Loadfile or sectors.
`Move (copy) data.
`Namefile or command-tail parameters.
`Outputto port.
`Proceed through loop or subroutine.
`Quit debugger.
`Display or modify registers.
`Search memory.
`
`.
`
`
`
`1056
`
`The MS-DOS Encyclopedia
`
`(more)
`
`
`
`-
`
`OLYMPUS EX. 1010 - 1066/1582
`
`OLYMPUS EX. 1010 - 1066/1582
`
`
`
`SYMDEB
`
`
`Command=Action
`
`S+
`S-
`
`Mg<ang
`oO~~i~~ttVAN
`
`ww
`!
`*
`
`_
`
`Enable source display mode.
`Disable source display mode.
`Enable source and machine code display mode.
`Trace program execution.
`Disassemble (unassemble) program.
`View source code.
`Write file or sectors.
`Examine symbol map.
`Open symbol map.
`Set symbolvalue.
`Redirect SYMDEBinput.
`Redirect SYMDEBoutput.
`Redirect SYMDEBinput and output.
`Redirect target program input.
`Redirect target program output.
`Redirect target program input and output.
`Swapscreen.
`Display sourceline.
`Help or evaluate expression.
`Escapeto shell.
`Enter comment.
`
`One or more SYMDEB commands, separated by semicolons and enclosed in double
`quotation marks, can be includedin the original SYMDEB commandline in the form
`/"commands" (for example, /"r;d;q"). These commands, which must precedethe filename
`of the program being debugged,are carried out immediately when SYMDEBis loaded.
`(This is a convenient way to invoke SYMDEBand execute a series of batch commands.)
`The parameters for a SYMDEB command include symbols; line numbers; addresses;
`ranges; and 8-bit, 16-bit, 32-bit, or floating-point values, expressions, andlists. Multiple
`parameters can be separated by spaces, tabs, or commas.
`
`
`
`A symbol is a namethat represents a register, an absolute value, a segment address, ora
`segmentoffset. A symbol consists of one or more characters but always begins withalet-
`ter, an underscore (_), a question mark(?), an at sign (@), or a dollar sign ($). The names
`of the various 8086/8088/80286 registers and CPUflagsare built into SYMDEB and can be
`used at any time. Other symbols can be used only when one or more symbolfiles have
`been loaded in conjunction with the program to be debugged.
`
`Note: SYMDEBregards symbols whosespellings differ only in case as the same symbol.
`A unique symbol namethat does not conflict with programming instructions, register
`names, or hexadecimal numbers should always be used.
`
`In MASM programs, symbols must be declared PUBLIC in the source code in order to be
`accessible during debugging (except for segment and group names, which are PUBLIC by
`default). In programs compiled with the current versions of Microsoft C, FORTRAN,
`
`Section IV: Programming Utilities
`
`1057
`
`OLYMPUS EX. 1010 - 1067/1582
`
`OLYMPUS EX. 1010 - 1067/1582
`
`
`
`SYMDEB
`
`and Pascal, all symbols are passed through for debuggingif the proper compilation switch
`is used; however, familiarity with the compiler’s particular naming conventions is neces-
`sary (for example, the Microsoft C Compiler adds an underscore character to the beginning
`of every symbol).
`
`A line numberis a combination of decimal numbers, filenames, and symbols that specifies
`a unique line of text in a program sourcefile. Line numbers alwaysstart with a dot charac-
`ter (.) and take oneof the following forms:
`
`.Lfilename:] linenumber
`.tdisplacement
`displacement
`symbol(+ displacement]
`symbol|—displacement|
`
`The second andthird variations specify a line relative to the current line number; the
`fourth andfifth specify a line numberrelative to a designated symbol. Line numbers can
`be used only with programs developed with compilers that generate line-numberinforma-
`tion. Programs developed with MASM or an incompatible compiler cannot generate line
`numbers.
`
`An addressidentifies a unique location in memory. An address can be a simpleoffset or a
`complete address consisting of two 16-bit values in the form segment:offset. Each compo-
`nent can be a valid symbol (including CS, DS,ES,or SS, in the case of segments), a 16-bit
`hexadecimal numberin the range 0 through FFFFH,or a symbolplus or minus a displace-
`ment. When the segmentportion of an address is absent, the segment specified in the
`previous instance of the same commandis used; if no segment was previously specified,
`SYMDEBusesDS unless an A, G, L, P, T, U, or W commandis used, in which case SYMDEB
`uses CS.
`
`Arange specifies an area of memory or a numberof data items and can be expressed as
`either two addresses ora starting address and a length. A length is represented by theletter
`L followed by a hexadecimalvalue in the range 0 through FFFFH. The meaningof the
`length varies with the SYMDEB command used: Thelength can signify a numberof bytes,
`words, doublewords, real numbers, machine instructions, or source-code lines. Ifa com-
`mand requires a range and the ending address is not supplied, SYMDEB usually assumes
`128 bytes.
`
`A value represents an integral numberand is a combination of one or more digits. The
`default base for values is hexadecimal, except in the case of floating-point numbers, but
`other bases can be used by appendinga radix character (Y for binary, O or Q for octal, T
`for decimal, H for hexadecimal) in either uppercase or lowercase. For example, the follow-
`ing values are equivalent:
`
`0040
`0040H
`0064t
`
`-
`
`01000
`91000
`1000000Y
`
`
`
`
`
`1058=The MS-DOS Encyclopedia
`
`OLYMPUS EX. 1010 - 1068/1582
`
`OLYMPUS EX. 1010 - 1068/1582
`
`
`
`
`
`- SYMDEBeeeEES
`
`
`
`Doubleword (32-bit) values are entered as two hexadecimalintegers separated by a colon
`‘character(:), Real numbersare always entered in decimal radix, with or without a decimal
`point or exponent. Leading zeros can be omitted.
`
`An expression is acombination of symbols, numeric constants, and operators that evalu-
`ates to an 8-, 16-, or 32-bit value. An expression can be usedin place of a simple value in
`' arly command. Unary address operators use DSas the default segment for addresses. Ex-
`pressions are evaluated in order of operator precedence; operators with equal precedence
`are evaluated from left to right. Parentheses can be used to override the normal operator
`' precedence.
`
`The available unary operators, listed in order of precedence from highestto lowest, are
`
`Operator Meaning
`
`Unaryplus
`+
`Unary minus
`~
`One's (bitwise) complement
`NOT
`Segment address of operand
`SEG
`Offset of operand
`OFF
`Low-order byte from specified address
`BY
`Low-order word from specified address
`wo
`Doubleword from specified address
`DW
`Pointer from specified address (same as DW)
`POI
`Byte input from specified port
`PORT
`WPORT Word input from specified port
`
`Theavailable binary operators,listed in order of precedence from highest to lowest, are
`
`Operator Meaning
`
`*
`/
`MOD
`:
`+
`-
`AND
`XOR
`OR
`
`Multiplication
`Integer division
`Modulus
`Segment override
`Addition
`Subtraction
`Bitwise Boolean AND
`Bitwise Boolean Exclusive OR
`Bitwise Boolean Inclusive OR
`
`A list is composed of one or more values, expressions, or strings, separated by spaces or
`commas. A string is one or more ASCII characters, enclosed within single or double quota-
`tion marks. Caseis significant within a string. If the same type of quote characterthatis
`usedto delimit the string occurs inside the string, the character must be doubled inside the
`string in orderto be interpreted correctly (for example,"A ""quoted" word").
`
`Section IV: ProgrammingUtilities
`
`1059
`
`OLYMPUS EX. 1010 - 1069/1582
`
`OLYMPUS EX. 1010 - 1069/1582
`
`
`
`SYMDEB
`
`‘
`
`In a few cases, SYMDEBdisplays a specific and informative error message in response to
`an invalid command.In general, though, SYMDEB respondsin a generic fashion, pointing
`to the approximate location of the error with a caret character (“), followed by the word
`Error. For example:
`-D CS:100,CS:80 <Enter>
`“ Error
`
`~
`
`SYMDEBmaintainsa set of virtual CPU registers and flags for a program being debugged.
`These registers can be examined and modified with SYMDEB commands. Whena pro-
`gramis first loaded for debugging, the virtual registers are initialized with the following
`values:
`
`Register
`
`-COM Program
`
`-EXE Program
`
`Valid drive code
`Valid drive code
`AX
`Upperhalf of program size
`Upperhalf of program size
`BX
`
`CX Lowerhalf of program size—Lowerhalf of program size
`DX
`Zero
`Zero
`SI
`Zero
`Zero |
`DI
`Zero
`Zero
`BP
`Zero
`Zero
`SP
`FFFEHortop of available
`Size of stack segment
`memory minus 2
`100H
`
`
`
`IP
`
`CS
`DS
`ES
`$s
`
`PSP
`PSP
`PSP
`PSP
`
`Offset of entry point within target
`program’s code segment
`Base of target program’s code segment
`PSP
`PSP
`Base of target program’s stack segment
`
`Note: SYMDEBchecksthefirst three parameters in the command line. If the second and
`third parameters are filenames, SYMDEB checksany drive specifications with thosefile-
`namesto verify that they designate valid drives. Register AX contains one of the following
`codes:
`
`Code
`
`0000H
`
`OOFFH
`FFOO0H
`FFFFH
`
`Meaning
`
`The drives specified with the second and third filenamesare both valid, or
`only one filename was specified in the commandline.
`Thedrive specified with the secondfilenameis invalid.
`The drive specified with the third filenameis invalid.
`The drives specified with the second andthird filenamesare both invalid.
`
`1060
`
`The MS-DOS Encyclopedia
`
`OLYMPUS EX. 1010 - 1070/1582
`
`OLYMPUS EX. 1010 - 1070/1582
`
`
`
`
`
`:
`
`SYMDEB
`
`Before SYMDEBtransfers control to the target program,it saves the actual CPU registers
`and then loads them with the currentvaluesofthe virtualregisters: conversely, when con-
`trol reverts to SYMDEBfrom thetarget program,the returned register contents are stored
`back into the virtual register set for inspection and alteration by the SYMDEBuser.
`Examples
`
`To prepare the program CLEAN.ASMfor debugging with SYMDEB,declareall vital labels,
`procedures,andvariable names in the source program PUBLIC.To assemble the program,
`type
`
`C>MASM CLEAN;
`
`<Enter>
`
`This produces the relocatable object module CLEAN.OBJ. Then,to link the object module,
`type
`
`C>LINK /MAP CLEAN;
`
`<Enter>
`
`This results in the executable program file CLEAN.EXEand the map file CLEAN.MAP.
`
`Note: The /MAPswitch must be used evenif a mapfile is specified in the commandline.
`Finally, to create the symbol information file required by SYMDEB,type
`
`C>MAPSYM CLEAN <Enter>
`. At this point, begin symbolic debugging by typing
`C>SYMDEB CLEAN.SYM CLEAN.EXE <Enter>
`
`Any run-time command-line parameters required by the CLEAN program maybe placed
`in the SYMDEB comma