Memory on Stamp
Archiver
Posts: 46,084
Does anyone know how the Stamp compiler handles CON statements like
LED CON 0?
It seems that there is no limitations on number of CON statements, or
is there?
And does anyone know how the PBASIC program is actually stored in
EEPROM? Does EE contain assembly language or ASCII code?
Much appreciated.
LED CON 0?
It seems that there is no limitations on number of CON statements, or
is there?
And does anyone know how the PBASIC program is actually stored in
EEPROM? Does EE contain assembly language or ASCII code?
Much appreciated.
Comments
jim
http://www.geocities.com/jimforkin2003/
Original Message
From: basicstampede [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=H8Js8Dma5O-Rgxt0dqjjmEBJwz8_fSIxyp6VZHw9pcqyOJBGHWF6yG7fCafVSOWLtNgvIIgqPC32ahQ6LQ]basicstampede@y...[/url
Sent: Tuesday, May 20, 2003 12:05 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Memory on Stamp
Does anyone know how the Stamp compiler handles CON statements like
LED CON 0?
It seems that there is no limitations on number of CON statements, or
is there?
And does anyone know how the PBASIC program is actually stored in
EEPROM? Does EE contain assembly language or ASCII code?
Much appreciated.
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
not cost program space (the compiler substitutes the constant value for the
symbol just prior to the actual compilation process), will make your programs
easier to read and often easier to maintain.
Your PBASIC code is compiled to tokens [noparse][[/noparse]byte codes] for storage in the
Stamp's EEPROM. The trick is that the tokens are variable-width so that we
can squeeze the greatest number of tokens into the EEPROM possible.
-- Jon Williams
-- Parallax
In a message dated 5/20/2003 11:06:55 AM Central Standard Time,
basicstampede@y... writes:
> Does anyone know how the Stamp compiler handles CON statements like
> LED CON 0?
> It seems that there is no limitations on number of CON statements, or
> is there?
>
> And does anyone know how the PBASIC program is actually stored in
> EEPROM? Does EE contain assembly language or ASCII code?
[noparse][[/noparse]Non-text portions of this message have been removed]
as 'tokens' in the EEPROM. What's a Token?
PBasic is a 'p-compiled' language. This means
the tokens of the language (HIGH, LOW, GOTO, GOSUB)
are converted into a number 'Token'. This 'Token'
is then downloaded to the EEPROM as part of the
compilation process.
When the program is 'run', the PBasic interpreter
(firmware, on the BS2 PIC processor, proprietary
Parallax code) reads the 'Tokens' from EEPROM,
and based on the 'Token' calls subroutines in
its interpreter to do the requested action.
The benefits of this approach are you can program
in a 'high-level' language (PBasic), you can
test and debug easily, and the 'Tokens' take up
less space in the EEPROM than expanded assembly
code.
--- In basicstamps@yahoogroups.com, "basicstampede"
<basicstampede@y...> wrote:
> Does anyone know how the Stamp compiler handles CON statements like
> LED CON 0?
> It seems that there is no limitations on number of CON statements,
or
> is there?
>
> And does anyone know how the PBASIC program is actually stored in
> EEPROM? Does EE contain assembly language or ASCII code?
>
> Much appreciated.