home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / Geneve / 9640news / CAT15 / GPLCDN.ARK < prev    next >
Text File  |  2006-10-19  |  8KB  |  150 lines

  1. ?
  2.  
  3.                       A LITTLE INTRODUCTION TO GPL CODE
  4.                                By Craig Miller
  5.  
  6. Millers Graphics  will be releasing a GPL Assembler  in the first part of 86'.
  7. We thought you might like to see what a powerful and COMPACT language GPL code
  8. is. With  the GRAM  KRACKER and  our GPL  Assembler you  will be able to write
  9. programs that  can reside in  the Module space  and will be  displayed on your
  10. Main Menu as a selection. GPL can also link to Assembly and BASIC programs! So
  11. you will have FULL use of the THREE built-in languages  in our 4As (Basic, GPL
  12. and Assembly).  Eat your hearts  out all you  Atari, Commodore, IBM  and other
  13. computer owners!
  14.  
  15. *----------------------------------------------------------------------------*
  16.            * Disassembly of part of the Editor/Assembler Module *
  17.                     * Starting at Grom >6069 thru >6132 *
  18. *----------------------------------------------------------------------------*
  19.  
  20. >6069  MOVE  7 FROM G@REGDAT TO VR01       Load the Vdp registers
  21.  
  22.        CALL  CHKMEM                        Go check for memory expansion and
  23.                                            load the (C) character data
  24.  
  25.        MOVE  16 FROM G@CURSOR TO V@>08F0   Load the box and solid cursor data
  26.  
  27. * Put up the first Menu Screen
  28.  
  29.        ST    >7E,@SUBSTK               Initialize the Sub Return stack pointer
  30.        DCLR  @ERRCODE                  Zero out A/L Error Code indicator
  31.        DCLR  @GROMFLG                  Zero the Grom Flag
  32.        ALL   SPACE                     Clear the screen with space characters
  33.  
  34.        FMT                             Start formatted screen output
  35.        ROW   2                         At row 2
  36.        COL   1                         At column 1 (note 0,0 is home position)
  37.        HTEXT '* EDITOR/ASSEMBLER * '   Put up horizontal text
  38.        ROW+  2                         At current row plus 2
  39.        COL   1                         At column 1
  40.        HTEXT 'PRESS:'                  .
  41.        ROW+  2                         .
  42.        COL   2                         .
  43.        HTEXT '1 TO EDIT'               .  etc.
  44.        ROW+  2                         Note: VTEXT, HCHAR, VCHAR are also
  45.        COL   2                         allowed in a FMT, so is
  46.        HTEXT '2    ASSEMBLE'           FOR xx - where xx equals
  47.        ROW+  2                         the repeat loop counter
  48.        COL   2
  49.        HTEXT '3    LOAD AND RUN'
  50.        ROW+  2
  51.        COL   2
  52.        HTEXT '4    RUN'
  53.        ROW+  2
  54.        COL   2
  55.        HTEXT '5    RUN PROGRAM FILE'
  56.        ROW+  6
  57.        COL   2
  58.        HTEXT >0A                       >0A is the (C) character
  59.        HTEXT '1981 TEXAS INSTRUMENTS'
  60.        FEND                            End the formatted screen output
  61.  
  62. GETKY  SCAN                            Scan the keyboard for a key press
  63.        BR    GETKY                     BR (Branch on Reset) no NEW key pressed
  64.        CEQ   FCTN9,@KEY                Was FCTN 9 (Back) Pressed
  65.        BR    GETKY1                    NO! check the other keys
  66.        EXIT                            YES! Execute the Power Up routine
  67. GETKY1 SUB   >31,@KEY                  Subtract >31 from the keycode (0 - ?)
  68.        CHE   >05,@KEY                  If its now Higher than 4 - wrong key
  69.        BS    GETKY                     So, go wait for another key press
  70.  
  71.        CASE  @KEY                      Otherwise if @KEY equals
  72.  
  73.        BR    EDIT                      0 - goto Edit Menu
  74.        BR    ASSEM                     1 - goto Load Assembler Prompt
  75.        BR    LODRUN                    2 - goto Load and Run prompt
  76.        BR    RUN                       3 - goto Run Program prompt
  77.        BR    RUNPRG                    4 - goto Run Program File prompt
  78.  
  79. Notes: -----------------------------------------------------------------------
  80.  
  81. The above code only  requires 202 bytes of memory and  that includes 119 bytes
  82. of  text! So  that means  the actual  instruction code  only uses  83 bytes of
  83. memory! There  isn't another  language available  for our  99/4As that is this
  84. COMPACT  as GPL. And, when compared to  Assembly, it is much easier to program
  85. in. This  is THE  Language that  TI should  have released  to us  in the first
  86. place!
  87.  
  88. 1. Most  instructions can  work with  bytes or  words. The  D in  front of  an
  89.    instruction  indicates a word operation. The first operand to is SOURCE and
  90.    the  second is the DESTINATION. ie: ST  >03,@TEMP1 stores one byte with the
  91.    value of 3 into location TEMP1.
  92. 2. The COND bit in the GPL Status register (>837C) is turned ON if the test is
  93.    TRUE and OFF when FALSE. It is  also turned on when a NEW key is pressed on
  94.    a keyboard scan or when the result of certain instructions is zero.
  95. 3. BR  =  Branch  On  Reset...  or  Branch  if  the COND bit in the GPL Status
  96.    register is OFF
  97. 4. BS  =  Branch  On  Set.....  or  Branch  if  the COND bit in the GPL Status
  98.    register is ON
  99. 5. CASE is like ON X GOTO ..... except it starts at zero instead of 1
  100.    (Note: the COND bit is always turned OFF (reset) for a CASE or DCASE)
  101. 6. A CALL works like a GOSUB or Assembly's BL (Branch and Link)
  102. 7. 'ALL'  fills  the  screen  with   the  one  byte  character  following  the
  103.    instruction. (That's right only 2 bytes to clear the screen!!!!)
  104. 8. MOVE is a very powerful  GPL instruction. With it you can MOVE  x number of
  105.    bytes FROM any type of memory TO any type of memory You can also move bytes
  106.    to the VDP  Registers! The MOVE instruction only requires  6 to 7 bytes for
  107.    its object code!
  108. 9. SCAN only requires 1 byte of object code!!! (SCAN = >03)
  109.  
  110. Speed Test: ------------------------------------------------------------------
  111.  
  112. We ran the old 1  to 10,000 timing test in  GPL to see how it  compares to the
  113. other languages and here is how it came out.
  114.  
  115. 1. In an incrementing loop with a DCEQ (double Compare Equal) 6.8 seconds.
  116. 2. In a decrementing loop (no compare just BR (not zero)) 4.3 seconds.
  117.  
  118. As we hav seen from previous tests this places third on the list.
  119.  
  120.                    1.  Assembly - well under .5 second
  121.                    2.  Forth    - approx 1.3 seconds
  122.                    3.  GPL      - 4.3 to 6.8 seconds
  123.                    4.  Pascal   - I think this is where it falls
  124.                    4.  XB       - 33.9 seconds
  125.                    5.  Basic    - weeks          (just kidding)
  126.  
  127. Since  its not as fast as Assembly or  Forth you are probably wondering why we
  128. are so  excited about GPL?! True, a CRAY 3  its not. However, it requires LESS
  129. THAN one half the space of Assembly code! With the Gram Kracker you have up to
  130. 58K of GPL  program space (with 6K  reserved for the Operating  System), which
  131. would require AT LEAST 116K of Assembly  code. This still leaves ALL of memory
  132. expansion  free plus  the 16K  of cartridge  RAM free  for other things or for
  133. Assembly routines for your GPL programs  to link to (another 48K). That  gives
  134. us a TOTAL program space of 106K plus 16K of VDP Ram for a total of 122K (128K
  135. with  the  Operating  System  area).  Also  with  GPL you can EXPAND or modify
  136. existing Modules. And,  last but certainly  not least, GPL  is the controlling
  137. language for  our 4As,  so now  you make  it do  most anything you want! Start
  138. thinking about those changes you've wanted to  make for the last 6 years, your
  139. chance is coming!!!
  140. (Hmmmmm, lets see, a cold boot of an Assembly, GPL, Forth, XB or Basic program
  141. that would ........................)
  142.  
  143.  
  144.  
  145.  
  146.  
  147. Download complete.  Turn off Capture File.
  148.  
  149.  
  150.