			Chapter 1 of the SST Manual


To get the whole manual, please send your mailing address and $25 to

			Scroll Systems, Inc.
			11108 NE 106th Place
			Kirkland, WA 98033


     If you work with or want to learn assembly language, SST is for you. 
Similarly if you need to debug programs written in assembly language and in
higher-level languages, SST can be invaluable.  SST is a screen-oriented,
upward-compatible replacement for the ubiquitous DEBUG.COM distributed with
MS-DOS.  Use SST like DEBUG and enjoy access to a relaxed syntax, numerous
extensions, ready help information (just type Function Key 1), and
instantaneous full screen displays.  In particular, the trace and display
functions are much more powerful than DEBUG's.  SST is to DEBUG much as a
word processor like WORDPERFECT is to EDLIN.  In addition to assembly
language and source-level support for programming under MS-DOS, SST includes
special support for Microsoft Windows (see Chap. 13) and the Intel 386, 486,
and Pentium microprocessors (see Chap. 12).


SST, The Integrated Debugger

     SST is an integrated debugger that combines RAM, disk, screen-font, and
code display facilities with syntax is used for all modes, making them easier
to use than a set of unrelated programs.  SST also incorporates an assembly
language interpreter that allows you to write and debug COM files much as you
create BASIC files using a BASIC interpreter.  The COM files so generated can
run stand alone or under SST's supervision and run at full machine speed,
unlike other interpreter code.  Type a or A to run the Auto demo of the
Function Key 7 to see how the interpreter and other features work and consult
Chap. 8 for further information about the interpreter.

     SST runs in both resident and nonresident modes.  If you can afford the
extra RAM, you can run a resident copy to give you instant access to the
built-in calculators, system extensions, ready debugging, and trapping of
errors such as divide overflow.  Enter SST at any time by typing Ctrl-Enter
or pressing an NMI button.  Nonresident use is valuable for debugging
programs and running the interpreter.

     This manual is primarily a reference to SST and does not have much
tutorial material.  We recommend you take a guided tour through many of SST
features by running the Auto demo offered when you type Function Key 7 in the
SST COMMAND MODE.  You might also find one or more of the many books now
available on x86 assembly language helpful.  In particular, the book "The
Personal Computer from the Inside Out" by Sargent and Shoemaker (Addison
Wesley) contains several chapters on assembly language.  The "Sample Program"
section of Chap. 2 helps to explain how to load and trace a program using
labels.

     This first chapter introduces many of SST's features and explains how to
use this manual.  Subsequent chapters explain the features in greater detail.


Full Screen Display Mode

     The display command displays a delimited area of memory if both the
start and end addresses are given.  However if neither or only one address is
specified, an instantaneous full screenful of memory is displayed.  This
screen can have the usual hex/ASCII format or a pure ASCII format.  The
cursor arrows, PgUp, PgDn, space bar, and backspace move the cursor around. 
It is possible to scroll rapidly (four seconds per 64K in ASCII mode) through
all of memory scanning for text.  A variety of hot keys allow you to use the
information at the cursor as pointers to move around memory and to define
blocks on which to operate.  For a demonstration, run SST, type Function Key
7 followed by d or D.  Type Function Key 1 for context-sensitive help on the
display mode.  More complete discussion is given in Chap. 7.

Trace Mode

     The trace command allows streamlined screen-oriented execution of
programs in single step or under control of breakpoints.  Single-stroke hot
keys are used to advance execution.  The current instruction (at cs:ip) is
highlighted by a reverse video bar.  Whenever execution goes outside the
instructions displayed, the screen is instantaneously redrawn with the
appropriate new instructions.  A conditional jump or loop that will be
successful is identified by an arrow pointing in the direction of the jump
and the target offset is displayed in boldface if it's on the screen.  A
small display window can display a selected portion of memory (arrow keys,
PgUp, and PgDn can scroll this window, and Ctrl-U and Ctrl-D change its
size), or it can track the memory locations referenced during the trace.  A
program stack window displays RAM starting at the top of the stack (given by
the register pair ss:sp) and identifies the stack words by one of three
readout offsets.
     Function Key 5 zooms the stack and display windows into DISPLAY MODE,
where you can overtype their RAM.  Similarly the Edit hot key lets you
overtype the register values.  Function Key 6 moves the cursor from one
window to another, allowing you to scroll the display, stack, program output,
and trace windows.  When in the trace window, the cursor is used for setting
breakpoints, starting assemblies, and moving the instruction pointer.  When
the cursor is in the program-output window, Ctrl-U moves the window height
Up, while Ctrl-D moves it down.  When the cursor is in any other window,
Ctrl-U and Ctrl-D move the memory-examine window height Up and Down,
respectively.
     In continuous trace mode, the tracking-memory mode produces an
impressive dynamic screen display that often reveals how a program works. 
The multiple-step Undo option is particularly valuable.  This allows you in
effect to execute backwards, discovering why registers or memory locations
got their values, or how you got to the current instruction.  With it you can
single-step into a subroutine, change your mind retracing backwards, execute
the subroutine at full speed, and continue single stepping afterwards.  For
an example of how to trace your own programs, see the "Sample Program"
section of Chap. 2.  Chapters 7 and 14 describe the TRACE MODE further.

Trace Mode Demonstration

     For a demonstration, run SST, type Function Key 7 followed by t or T. 
This starts continuously tracing a built-in piece of code.  You can pause
execution by typing the space bar.  Subsequent space bars single step
execution; i.e., advance execution one instruction at a time.  Other single
stroke commands include those to single-step, break at the current
instruction, break at the current instruction after executing it a specified
number of times, fast execution (e.g., call or loop) at full machine speed,
slow execution which allows single-stepping int calls (normally executed in
Fast mode), and no execution useful for skipping unwanted instructions.  A
program can be traced continously as in the T demo with full screen updates,
or run three times faster in a Quiet mode that only updates the register
values.  These continuous trace modes are interrupted by typing a character
or by a reference to a memory location protected by the p command.  The
continuous mode is also interrupted by an illegal op code or by an op code
belonging to a higher-level microprocessor (e.g., an 80286 instruction
executed on an 80186 or 8088).  Type Function Key 1 to see a help screen
defining the TRACE MODE hot keys.


Back Tracing

     SST also lets you backtrace program execution up to twenty steps by
default.  This can be very handy when you find the program somewhere and
can't figure out how it got there.  Just type u or U for Undo and watch your
program execute backwards in time.  As for Super-Trace, this has to be seen
to be believed!  To change the number of backtrace steps use the /Un switch
when starting SST (see Command Line Parameters in Chap. 3).  Note that
currently the backtrace (undo) feature restores only the 80286 subset of the
80386 machine state and it cannot undo values output to an I/O device.


x86/x87 Support

     The assemble and unassemble commands recognize all x86-family mnemonics
up through the Pentium.  The search command can search for assembly language
instructions as well as hex bytes and string literals.  See Chap. 12 for
discussion of additional 80386 support.

     SST fully supports the x87 numeric coprocessor with stack displays in
TRACE MODE.  Registers and memory can be changed by simple assignment
statements using ordinary scientific notation, and all status information is
displayed.  An x87 floating point calculator is also built in as described in
Chap. 5.


Labels

     SST supports the full link MAP for the DOS LINK.EXE linker.  By reading
in the map (specify /MAP option on the LINK.EXE list file entry), you can
refer to program line numbers and external labels (declared EXTRN in .ASM
files and external names in general declared in compiler source files).  See
the load label option in Chap. 7.  You can also read in variable names for
one segment.  Variable names are not treated as generally as desired, partly
due to the need for telling SST what segment should be assumed for variable
references.  Something like the MASM.EXE ASSUME directive is needed. 
Improvements along these line are planned.  SST also reads in Microsoft
CodeView .exe externals generated with the /co link switch.


Calculators

     A Polish suffix hex calculator is included.  String literals and decimal
values (indicated by a decimal point) are supported in the HEX CALCULATOR,
SEARCH, and ASSEMBLER MODEs.  Register variables can be used in calculator
expressions, and register and flags can be assigned values by direct
assignment.

     Command editing supports the Function Key 3 DOS Edit function (repeat to
end of last command), although DOS is bypassed for all operations other than
disk.  This allows most DOS functions to be traced and leads to much faster
response (up to 100 times faster than DEBUG).  In addition, the left and
right arrow keys, Home, End, Del, and several Ctrl keys can be used for
editing (see Chap. 4).


Synergy

     The program serves both to teach people new to assembly language how the
machine works, and to aid the advanced programmer in finding program bugs. 
It typically requires 1/20th the time to find a bug with SST as compared to
DEBUG or SYMDEB, and sometimes a few minutes with SST can literally save you
days of debugging with DEBUG.  The program runs in about 100K RAM and is
written in optimized 8086 assembly language (some 80286/80386 code is used in
special sections off limits to smaller microprocessors).  It has many
features not found in debuggers requiring two or more times as much memory. 
SST's relatively small size per feature is due partly to tight coding, and
partly to a careful integration of facilities that allows the various
components to take advantage of one another (synergy!).


Menu Line

     Initially SST operates in COMMAND MODE.  Depending on the command
chosen, SST may switch into one of several other modes, namely ASSEMBLE MODE,
ASSEMBLE INSERT/EDIT MODE, UNASSEMBLE MODE, TRACE MODE, XAMINE MODE, DISPLAY
MODE, OVERTYPE MODE, CALCULATOR MODE, DISK DISPLAY/OVERTYPE MODEs, FONT
DISPLAY/OVERTYPE MODEs.  The Enter key returns to COMMAND MODE (two Enters
return in ASSEMBLE MODE).

     The current mode is displayed on the menu line at the top of the screen. 
For example, in COMMAND MODE, the menu line reads

COMMAND MODE:  F1 0-9 Asm Cmp Dsp Exam Fill...

The menu line is also used to report some errors and special conditions.

Register Window

     A register window is usually displayed at the top of the screen just
below the menu line.  In COMMAND MODE, the command r0 toggles this window on
and off, and in TRACE MODE, the hot key 0 turns it on and off.  Other windows
appear for various commands, and pop-up help screens always appear
immediately below the register window.  This special window has the form:

ax=n bx=n   ds=n es=n cs=n ss=n   bp=n       ds:[n]=n
dx=n cx=n   si=n di=n ip=n sp=n   NS NZ NC    PE + EI

The n's in this figure represent 4-digit hexadecimal numbers.  The third line
in general displays the menu for whatever mode is currently active.  Here the
COMMAND MODE menu is showed in part.  This particular menu is displayed when
SST is started and whenever you type a Enter (double Enter's in ASSEMBLE
MODE).

     The register window groups the registers according to their typical
usage in 8086 code.  The ax, bx, cx, and dx registers are the general
accumulators that can also be split into pairs of 8-bit registers like ah and
al.  The segment registers ds, es, cs, and ss are shown directly above the
16-bit registers with which they are commonly paired.  Specifically, the
addresses ds:[si] and es:[di] are used with the powerful 8086 string
instructions.  The cs:[ip] address gives the current instruction, and the
ss:[sp] address gives the top of the program stack.  In addition, ds:[bx] and
ss:[bp] are common addresses, so it is handy to have the corresponding
registers near one another.

     On the top line the ds:[n]=n, which appears only when a memory reference
occurs and displays the value and address of such a reference.  If the value
is a byte value, only two hexadecimal digits are displayed.

     After the sp=n field on the second line, the flag values are displayed. 
For example, if the Zero flag is set to 1, you see "Z".  If it is reset to 0,
you see "NZ" as shown in the figure.  This notation corresponds to the
instruction mnemonics used by the unassemble and trace commands.  Note that
since the TRACE MODE reverse video bar for the current instruction indicates
whether a conditional jump will occur, it isn't nearly as important to
consult the flags as it is with DEBUG.COM.  PE means that the last
instruction that affects the parity flag found Even Parity, while PO stands
for Odd Parity.  A + or - indicates the direction in memory that repeated
string operations go.  The instruction CLD (CLear Direction) gives a plus
sign (+), which is the usual direction for most programs.  If Interrupts are
Enabled, you then see EI, while if they are Disabled, you see DI.  The two
remaining flags, OV (Overflow Flag) and AC (Alternate Carry) occur less often
and are only displayed if they are on.  This choice helps to reduce screen
clutter and separates the principle set of flags (Sign, Carry, and Zero) from
the others.

     Following the Interrupt flag value, four SST status values are displayed
in reverse video if their corresponding functions are enabled.  These are E
for active Echo output (see n> command), S for active Super-Trace conditions
(see trace command), T for Tracking memory display window (see trace
command), and V for 80286 protected Virtual address mode (see vm command).

80386 Register Window

     By default on 80386-based computers, the register window displays the
complete 32-bit 80386 register values in the form

eax=n ebx=n   ds=n ss=n   ebp=n   ds:[n]=n
edx=n ecx=n   fs=n gs=n   esp=n   NS NZ NC
esi=n edi=n   es=n cs=n   eip=n   PE + EI

In COMMAND MODE, the r3 command and r1 switch to the 80386 and 8086 register
sets, respectively, while in TRACE MODE, the hot keys 1 and 3 perform these
switches.  The dr command displays special 80386 registers (see Chap. 12).


Disk and RamFont Editors

     SST contains a disk editor invoked by the command disk in COMMAND MODE. 
The idea is that in place of the segment specification for RAM, you type a
sector number.  The facility, described further in Chap. 9, has a variety of
options to facilitate moving around a disk.

     SST has a RamFont editor that allows you to create and modify the
characters sets that appear on your computer display.  This facility requires
the use of the Hercules Graphics Card Plus or the IBM Enhanced Graphics
Adapter, or other boards compatible with one of these.  See Chap. 10 for
further discussion.


Mouse Support

     The RamFont editor and the DISPLAY and TRACE MODEs can use the mouse to
move the cursor around.  To enable the mouse, you have to run the appropriate
MOUSE program at the DOS command level, and then tell SST that it should use
the mouse by typing the mouse command in SST's COMMAND MODE.  The mouse
allows you to move around the display screens rapidly and to edit character
fonts.

Super-Trace

     SST has a pair of exceedingly powerful conditional break facilities for
advanced users.  The first is the Super-Trace mode, which traces program
execution at about one-tenth full speed and after each instruction it checks
an arbitrary set of conditions specified by the user in assembly language. 
If the result of these conditions sets the Zero flag, tracing is halted;
otherwise the trace continues.  This allows a very rapid execution search for
any desired machine state.  It implements in software features that have been
hitherto performed only by expensive hardware tracing boards, and has
generality that the hardware methods cannot match.  The user conditions can
even call user-supplied subroutines, allowing specialized monitoring such as
program execution profiling.  The use of ordinary assembly language for the
user conditions combines the highest execution speed, the simplest
implementation and documentation, and the greatest power available in the
computer.  Because of the great flexibility of the method, you have to be
careful not to include a command that will crash the computer.  Hence we
consider the Super-Trace to be a facility for advanced users, although simple
Super-Traces can be run by beginners (see Chap. 3 demonstrations).


Conditional Breakpoints

     Alternatively, breakpoints can be associated with the same arbitrary set
of conditions as the Super-Trace.  For these, execution proceeds at full
speed until the computer attempts to execute the instruction at one of the
user-defined breakpoint locations.  The user's conditions are then checked. 
If they succeed in setting the Zero flag, program execution is halted and
control is returned to SST.  Otherwise execution proceeds again at full
speed.  If no breakpoint is encountered, you can usually recover control by
typing Ctrl-Enter.

How to Use this Manual

     This manual tells you how to use SST.  It should be used in combination
with a book or reference manual on assembly language for the Intel 8088/8086
microprocessor.  The book "The Personal Computer from the Inside Out" by
Murray Sargent III (SST author) and Richard L. Shoemaker (Addison-Wesley
Publishing Co., 2nd Edition, 1994) is one of several such books.  If you are
already familiar with assembly language and DEBUG.COM, you may just want to
glance at this introductory section, at Chap. 4 on Syntax, and then refer to
the command descriptions of Chap. 7 when the built-in help messages are too
terse.  If you are learning assembly language, read the Help section (Chap.
2), the Demonstration section (Chap. 3), run the Auto demo of Function Key 7,
read the Syntax section (Chap. 4), and read your book on assembly language. 
Try out the built-in demonstrations to get a feel for how memory looks and
how a program runs.  Assemble some simple code of your own and trace its
execution with the trace command.  You'll learn assembly language in a
fraction the time required by traditional methods.


References

     Many excellent assembly-language and higher-level language books are
available in your favorite bookstore.  For example, Dalton's carries a large
number of relevant books or check the references in Sargent and Shoemake
(1994).  Browse around a bit and choose the books that seem to be the most
helpful.
