Parallax BASIC Stamp 2e Programming Manual page 100

Table of Contents

Advertisement

DEBUG - BASIC Stamp Command Reference
DEBUG can also print and format numbers (values) from both constants
and variables. The formatting methods for DEBUG are very different for
the BS1, than for any other BASIC Stamp. Please read the appropriate
sections, below, carefully.
BASIC Stamp 1 Formatting
On the BS1, the DEBUG command, by default, displays numbers in the
format "symbol = value" (followed by a carriage return), using the decimal
number system. For example,
SYMBOL
X = B0
X = 75
DEBUG X
displays "X = 75" on the screen. To display the value, in decimal, without
the "X =" text, use the decimal formatter (#) before the variable name. For
example, the following code displays "75" on the screen.
SYMBOL
X = B0
X = 75
DEBUG #X
To display numbers in hexadecimal or binary form, use the $ or %
formatter, respectively. The code below displays the same number in its
hexadecimal and binary forms.
SYMBOL
X = B0
X = 75
DEBUG $X, %X
After running the above code, "X = $4B" and "X = %01001011" should
appear on the screen. The hexadecimal ($) and binary (%) formatters
always display the number using the format "symbol = value" (followed
by a carriage return). There is no built-in way to display hexadecimal or
binary numbers in any other form when using the BS1's DEBUG
command.
To display a number as its ASCII character equivalent, use the ASCII
formatter (@). Typing DEBUG @X (in place of the DEBUG statement in
the code above) would display "X = 'K'" on the screen.
Page 98 • BASIC Stamp Programming Manual 2.0b • www.parallaxinc.com
1
D
ISPLAYING DECIMAL NUMBERS
(BS1).
D
ISPLAYING HEXADECIMAL OR BINARY
(BS1).
NUMBERS
D
ASCII
ISPLAYING
CHARACTERS
(BS1).

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents