Shop OBEX P1 Docs P2 Docs Learn Events
How code is uploaded — Parallax Forums

How code is uploaded

Miguel AngelMiguel Angel Posts: 15
edited 2010-05-20 16:17 in BASIC Stamp
I want to know about the process which transform the legible code to BS code (uploaded code to BS).

1) a commented code is converted in a not commented code when upload?

2) space between lines are deleted when upload?

3) all others question about make better use of the memory when I try to do many things with BS



I'm using a Time clock kepper for obtain hour of test
a temperature sensor (for test temperature)
a memory stick datalogger for save the data tested

and left me

a DAC (digital-analogg converter) for test voltage
and XXXX (don't remenber) for turn on/off a relay.........


I need more memory and maybe more PIN,,,,

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-05-19 21:48
    The Stamp Editor compiles the program into instructions for an interpreter that's built-into the Stamp. All comments are removed. All variable names and labels are removed. The various statements are compiled into byte-codes. The details of the byte codes are proprietary to Parallax. There is no public documentation on the details although a few companies have "reverse-engineered" them, but not published anything.

    In terms of making good use of memory ...

    String constants are copied directly into the compiled code, so output statements including DEBUG statements tend to take a lot of memory, especially when there are long strings involved.

    If you haven't looked at it, www.emesystems.com has a lot of information about Stamp programming including estimates of execution time for various statements, multiple precision arithmetic, and many other topics. Browse the website.
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-05-20 13:56
    Any "CON" parameters you define are replaced by the value when you use it in the code. This means, if you define a CON but don't use it, it costs nothing.

    Any variable used is replaced by an address parameter in the Byte-code tokens. Destination addresses are also replaced by an address parameter.

    Keys to making best use of the limited resources: Create 'temp' variables for subroutines to manipulate so you can re-use RAM. Only save what information you NEED to save at any one time. Use SERIN/SEROUT or SHIFTIN/SHIFTOUT to minimize use of pins.
  • Miguel AngelMiguel Angel Posts: 15
    edited 2010-05-20 16:17
    double Thanks......
Sign In or Register to comment.