VS (View Source)

Syntax

VS[[window]] [[format]] [[address]] [[/option[[+|-]]]]...

Parameters

window

Specifies the Source window (1 or 2) to open or make active.

format

Specifies the way to display source code as one of the following:

Specifier Format

+ Display source lines from the source file
Display assembly-language instructions
& Display both source lines and assembly-language instructions

address

Address or line number at which to start displaying source code. The address must fall within the executable portion of your program.

[[/option[[+|-]]]]...

Zero or more source display options. The option can be any of the following specifiers:

Specifier Option

a Address
  When turned on (/a[[+]]), displays the address of each instruction. When turned off (/a-), does not display addresses.
b Bytes coded
  When turned on (/b[[+]]), displays the hexadecimal form of the instructions. When turned off (/b-), does not display the encoded bytes.
c Case of disassembly
  When turned on (/c[[+]]), displays instruction mnemonics and registers in uppercase. When turned off (/c-), displays instruction mnemonics and registers in lowercase.
l Line-oriented display
  When turned on (/l[[+]]), displays mixed source and assembly in source-line order. When turned off (/l-), displays mixed source and assembly in instruction-code order.
s Symbols in disassembly
  When turned on (/s[[+]]), symbols in instructions appear in symbolic form. If turned off (/s-), they appear as addresses.
t Track current location (CS:IP)
  When turned on (/t[[+]]), the Source window follows the thread of execution (CS:IP). When turned off (/t-), the Source window does not automatically scroll to follow the current location.

Description

CodeView can display two Source windows at the same time. At least one source window must always be open. You can type the VS 1 or VS 2 command to make Source window 1 or 2 active. If the Source window you request is not open, CodeView opens it and makes it active.

The Source windows can show code in a number of display modes:

Source

CodeView displays the lines from your program's source files.

Assembly

CodeView displays the assembly instructions that make up your program.

Mixed

CodeView displays each line of your program's source file, followed by the assembly instructions for that line. This ordering can be reversed by turning the Line-Oriented Display option off (/l-).

Source and Mixed modes are available only if the executable file contains debugging information.

Note:

Programs that do not contain debugging information are always displayed in Assembly mode.

In the Source and Mixed modes, tracing into a function for which no source lines are available, such as a library function, switches the Source window to Assembly mode. Once program execution returns to an area where source lines are available again, CodeView automatically switches back to Source or Mixed mode.

If you specify a line number or an address with the VS command, CodeView draws the Source window so that the source line corresponding to the given address appears in the middle of the Source window. If the address is in another file, CodeView loads that file into the Source window. If you specify an address for which there is no corresponding source text (in your program's data, for example), CodeView will respond with an error message.

You can scroll the contents of the active Source window down a page by typing the VS command with no arguments. You can also use the Source window scroll bars.

Mouse and Keyboard

To make a Source window active or to open a Source window:

Click anywhere in an open Source window to make it active.

Press ALT+3 or ALT+4 to activate or open Source window 1 or 2.

From the Windows menu, choose Source 1 or Source 2.

To change the source display mode:

Click the <F3=Src1 Fmt> or <F3=Src2 Fmt> buttons in the status bar to cycle through the three modes.

Press F3 to cycle forward.

Press CTRL+F3 to cycle backward.

From the Options menu, choose Source Window to open the Source Window Options dialog box. Under Display Mode, select one of the option buttons.

When the cursor is in the Source window, press CTRL+O to display the Source Window Options dialog box.

Examples

The following example opens Source window 2 in the mixed mode. The display will start at the function toss_token.

>VS 2 & toss_token

The next example changes the display format in Source window 2 to source lines only.

>VS 2 +