English
Language : 

45111 Datasheet, PDF (61/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
7 The SASM Assembler
The following code snippet is an example of multiple WATCH directives and their output:
LCounter
Hcounter
Flags
String
WATCH
WATCH
WATCH
WATCH
EQU $08
EQU $09
EQU $0A
EQU $0B
LCounter, 16, UDEC
Flags.0, 1, UBIN
Flags.1, 1, UBIN
String, 3, FSTR
; (3 chars, $0B - $0D)
Start
MOV
MOV
MOV
MOV
MOV
MOV
LCounter, #$10
HCounter, #$F0
Flags, #%01
String, #’H’
String+1, #’I’
String+2, #’!’
; Start of main routine
This code snippet would result in a Watch window similar to Figure 13 – The Watch Window, below:
Figure 13 - The Watch Window
The first variable in the Watch window is created by the WATCH directive on line 5 of the source code.
It tells the SX-Key to display a value starting at bit 0 of LCounter (since bit 0 is assumed if no bit address
is specified) containing 16 bits and formatted as an unsigned decimal number. Note that although
LCounter is only an 8-bit register, the WATCH directive can span multiple registers (from low-byte to
high-byte) in order to construct up to a 32-bit value. In this case, LCounter ($08) is the lower 8 bits and
HCounter ($09) is the upper 8 bits of the displayed value (61,456 or $F010).
The second and third variables in the Watch window are created by the WATCH directives on lines 6
and 7 of the source code. Both are single bit values, shown in unsigned binary format. The first of these
corresponds to Flags’ bit 0 (Flags.0) and the second corresponds to Flags’ bit 1 (Flags.1) as specified by
the symbol arguments.
The fourth variable in the Watch window is created by the last WATCH directive. It tells the SX-Key to
display a fixed-length string (FSTR) of 3 bytes starting with the String symbol. In this case, ‘HI!’ is
displayed.
SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc. • Page 61