Debug: g (go)

Runs the program currently in memory. Used without parameters, g starts running at the current address in the CS:IP registers.


g [=address] [breakpoints]


address : Specifies the address in the program currently in memory where you want to begin running the program.

breakpoints : Specifies 1 to 10 temporary breakpoints that you can set as part of the g subcommand.

?: Displays a list of debug subcommands.


Windows XP does not use this command. It is accepted only for compatibility with MS-DOS files. 

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:



Using the address parameter

Precede the address parameter with an equal sign (=) to distinguish address from the breakpoint addresses (breakpoints).

Specifying breakpoints

The program stops at the first breakpoint it encounters, regardless of where you typed the breakpoint in the breakpoints list. Debug.exe replaces the original instruction at each breakpoint with an interrupt code.

When the program reaches a breakpoint, Debug.exe restores all breakpoint addresses to their original instructions and displays the contents of all registers, the status of all flags, and the decoded form of the last instruction that was executed. Debug.exe displays the same information it displays when you use the r (register) subcommand and specify the breakpoint address.

If you do not stop the program at one of the breakpoints, Debug.exe does not replace the interrupt codes with the original instructions.

You can set breakpoints only at addresses containing the first byte of an 8086 operation code (opcode). If you set more than 10 breakpoints, Debug.exe displays the following message:

bp Error

Using the user stack pointer

The user stack pointer must be valid and must have 6 bytes available for the g subcommand. The g subcommand uses an iret instruction to jump to the program that you want to test. Debug.exe sets the user stack pointer and pushes the user flags, the code segment register, and the instruction pointer onto the user stack. (If the user stack is not valid or is too small, the operating system might fail.) Debug.exe places an interrupt code (that is, 0CCh) at the specified breakpoint address or addresses.

Restarting a program

Do not restart a program after the following message appears:

Program terminated normally

To run the program properly, reload it by using the n (Name) and l (Load) subcommands.

For information about executing a loop, a repeated string instruction, a software interrupt, or a subroutine by using the p (proceed) subcommand, see Related Topics.

For information about executing one instruction by using the t (trace) subcommand, see Related Topics.


To run the program currently in memory up to the breakpoint address 7550 in the CS segment, type:


Debug.exe displays the contents of the registers and the status of the flags and stops the g subcommand.

To set two breakpoints, type:

gcs:7550, cs:8000

If you type the g subcommand again after Debug.exe encounters a breakpoint, execution begins at the instruction after the breakpoint, rather than at the starting address.

Formatting legend



Information that the user must supply


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

Debug subcommands

Debug: p (proceed)

Debug: t (trace)

Debug: n (name)

Debug: r (register)

Command-line reference A-Z

© 2016 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy & Cookies