Page 229 - The Ultimate Palm Robot
P. 229

Color profile: Generic CMYK printer profile
           Composite  Default screen
                                                      Bots / The Ultimate Palm Robot/ Mukhar & Johnson / 222880-6 / Chapter 8






                    212     The Ultimate Palm Robot



                                 TEA code is compiled using the command steep followed by the quoted
                               program name:

                               steep "chase.tea"


                                 This will take the TEAsource code and compile it into a form that can be used
                               by the virtual machine on the BrainStem controller. If you are running on a PC,
                               the compiled file will be placed into the \aObject directory. The name of the file
                               will be the same, but with a new extension: .cup. Thus, you now have a cup of
                               TEA. If you are running on a Palm, the cup file will be stored as another memo.


                                 The Robot Geek Says


                               Examining a cup File
                                         Although you can look at a cup file in its native format, it won’t do
                                      you much good since you don’t speak or read in byte code. However,
                                      you can process the byte code in the cup file into a somewhat more
                                      readable format. To create a readable file out of byte code in a cup file,
                                      you can
                                   ✖  Type ast simple on the console command line. This creates a file
                                      named simple.ast that shows the annotated syntax tree of the program.
                                   ✖  Type dsm simple on the console command line. This creates a file
                                      named simple.dsm that contains the assembler style machine code
                                      that corresponds to the byte code.

                    Downloading and Launching Programs

                               After you successfully compile the TEA program, you need to load it to the
                               BrainStem controller and launch the program. This is accomplished using
                               the load and launch commands. Launch the Console application. With the
                               BrainStem connected to the host, switch the robot power on. If the BrainStem
                               connects to the Console, you should see a green light on the BrainStem start
                               blinking. A similar light will start blinking in the Console application. If the
                               programs do not connect, you can try turning the BrainStem on first, then
                               launching the Console application. Now execute the load command:


                               load "simple.cup" 2 0









           P:\010Comp\Bots\880-6\ch08.vp
           Monday, May 12, 2003 1:16:46 PM
   224   225   226   227   228   229   230   231   232   233   234