home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / Information / GEOBASICINFO.TXT < prev    next >
Encoding:
Text File  |  2019-04-13  |  9.9 KB  |  232 lines

  1.  
  2. Date: Sat, 17 Aug 96 18:07:50 +0600
  3. From: Pulthar@nietzsche.execpc.com
  4. Subject: Re: GeoBasic
  5.  
  6.   Here's the more technical info I have on geoBasic.  I've posted it to
  7. comp.sys.cbm as well.
  8.  
  9. geoBasic Module Definitions:
  10.  
  11. VLIR #     Constant   Loads @     Description
  12. ------     --------   -------     -----------
  13.      0     R_MAIN     $0400       Resident code. Two JMP's @ $0400 then skip
  14.                                   to $07fc to leave room for screen memory.
  15.                                   This module contains all the code that must
  16.                                   always be available.  All the other modules
  17.                                   use the subroutines contained here.
  18.  
  19.  
  20.      1     R_FILE     $4ec7       High level disk file stuff (Rename, Open,
  21.                                   etc).
  22.  
  23.  
  24.      2     R_DA      *$75d8       Run's DA's.  *Loads inside FG_BUFFER on 64
  25.                                   or SCREEN_BASE on the 128.  This keeps it
  26.                                   from overwriting Basic's code.
  27.  
  28.      3     R_INIT     $4ec7       geobasic Initialization code. Loaded from
  29.                                   Resident code.
  30.  
  31.      4     R_LOAD     $7501       Basic Program loader. Loads into FG_BUFFER
  32.                                   (see R_DA).
  33.  
  34.      5     R_BINT     $4f96       Interpreter (BasRes). This is the module that
  35.                                   actually runs the user's program.
  36.  
  37.      6     R_BINT2    $0400
  38.  
  39.  
  40.      7     R_FONT     $6f8b       Font Manager (cFont, cSysInfo, and
  41.                                   GetDiskBitmap).
  42.  
  43.      8     R_DISK     $6f8b       Lower level disk stuff (reading bytes, etc).
  44.  
  45.      9     R_PRINT    $6f8b       Printer Routines.
  46.  
  47.      10    R_MENU     $4ec7       Menu Utility.
  48.  
  49.      11    R_DBOX     $4ec7       Dialog Box Utility.
  50.  
  51.      12    R_ICON     $4ec7       Icon Utility.
  52.  
  53.      13    R_BMAP     $4ec7       Bitmap Utility.
  54.  
  55.      14    R_SPRT     $4ec7       Sprite Utility.
  56.  
  57.      15    R_EDIT     $4503       Editor.
  58.  
  59.      16    R_APPL     $4b00       Make Application (run-time).
  60.  
  61.      17    R_DEBUG    $47cc       Debugger.
  62.  
  63. GB Program, Disk Layout
  64.  
  65. Records 0 to 9 - left empty to leave room for GB code when making run-time.
  66.  
  67. Record #10 - VLIR table.  Keeps track of what modules hold what line #'s.  Used
  68. for doing the VLIR splitting.  The table is a single sector and there is one
  69. eight byte entry for each program module.  The entries have the following
  70. format:
  71.  
  72.      .word ?          ; Highest line number in module.
  73.      .word ?          ; Length_of_module (in bytes)
  74.      .byte ?          ; nesting_level
  75.      .byte ?          ; write_status
  76.      .byte ?          ; modified_status
  77.      .byte NULL       ; terminator
  78.  
  79. The very first entry is a bit different.  It looks like this:
  80.  
  81.      .word ???        ; (NULLS)
  82.      .byte x          ; number of entries in the VLIR table (not
  83.                       ; counting this one which is entry #0).
  84.      .byte x          ; number of labels in the label table (minus 1,
  85.                       ; labels are numbered from zero!).  If there
  86.                       ; are no labels then it equals $ff.
  87.      .byte $f0?
  88.      .byte $f6?
  89.      .word ???
  90.  
  91. Record #11 - Object table.  All of the geos objects are store in this record,
  92. one right after the other.
  93.  
  94. Record #12 - Label Table.  Here is where the labels (@xxxx and object names)
  95. are stored.  Each label entry is 8 bytes long and has the following format:
  96.  
  97.      For @ labels:
  98.      .block 6         ; label name padded with NULLs
  99.      .word line_number
  100.  
  101.      For object labels (i.e. bitmaps, menus, icons, etc.):
  102.      .byte type       ; $80 = Menu
  103.                       ; $81 = DB
  104.                       ; $82 = Icon
  105.                       ; $83 = Sprites
  106.                       ; $84 = Bitmap
  107.      .block 5         ; object name padded with NULLs
  108.      .word address    ; where in memory the object is located.
  109.  
  110. Record #13 onward - Holds the basic program lines.  Each line has the following
  111. format:
  112.  
  113.      .byte            ; length_of_line
  114.      .word            ; line_number
  115.      .block ???       ; now comes the tokenized text
  116.  
  117.  
  118. Record #126 backward - Disk loadable bitmaps are stored beginning at record
  119. #126.  Additional bitmaps are added backwards until they meet up with the
  120. program records.  Note that only disk loadable bitmaps are stored here.
  121. Regular bitmaps are stored in the Object Table (record #11).
  122.  
  123. Getting Registers after a CALL:
  124.  
  125. After using the CALL command use can get the return values of the registers by
  126. PEEKing the following memory locations:
  127.  
  128. A      = $28a (650)
  129. X      = $28b (651)
  130. Y      = $28c (652)
  131. SR     = $28d (653)
  132.  
  133.  
  134. POP Command:
  135.  
  136. The old (V1.0) Pop command had several serious bugs that caused a system crash.
  137.  
  138. POP Command:
  139.  
  140. The old (V1.0) Pop command had several serious bugs that caused a system crash.
  141. The new version works like this:  executing a POP will remove the current
  142. GOSUB/WHILE/REPEAT stack frame.  In other words it will allow you to 'forget'
  143. that you are in a subroutine or loop (this does not apply to a FOR...NEXT
  144. loop). One thing to keep in mind is that after executing a POP you must not
  145. allow the program to reach the RETURN/LOOP/UNTIL commands.  The best way of
  146. doing this is with a construct like this:
  147.  
  148.      10 GOSUB DoSomething
  149.      20 END
  150.      30
  151.      50 @DoSomething
  152.      60   <various commands>
  153.      70   IF something = error THEN POP : GOTO @DoError
  154.      80 RETURN
  155.      90
  156.      100 @DoError
  157.      110    .... etc
  158.  
  159. Of course if you are two levels deep in a subroutine and execute a POP, then
  160. you execute a RETURN the program will return TWO levels back rather then just
  161. one.  Could come in handy at times.
  162.  
  163. GB Variables - zero page
  164.  
  165. Name              Address     Size     Description
  166. ----              -------     ----     -----------
  167. basCur            $81/129     word     current character in basic memory
  168. basBegin          $83/131     word     pointer to beginning of basic
  169. basicEnd          $85/133     word     pointer to beginning of labels (minus 1
  170.                                        for end of basic)
  171. varBegin          $87/135     word     pointer to the beginning of variables
  172. arrayBegin        $89/137     word     pointer to the beginning of arrays
  173. arrayEnd          $8b/139     word     pointer to the end of arrays
  174. arrayLength       $8d/141     word     length of array/temporary register
  175. strnBegin         $8f/143     word     pointer to the beginning of strings
  176. arrayLength       $8d/141     word     length of array/temporary register
  177. strnBegin         $8f/143     word     pointer to the beginning of strings
  178. zeroShift         $91/145     byte     used by floating point routines
  179. dec_pt            $92/146     byte     used by floating point routines
  180. varPtr            $93/147     word     pointer to value of variable
  181. machine_type      $95/149     byte     0 if c64, $80 if 128
  182. strnStack         $96/150     9 bytes  stack for three temp string descriptors
  183. strnStkIndx       $9f/159     byte     index into strnStack
  184. prevStrnStkIndx   $a0/160     byte     previous strnStack index
  185. rdIndex           $a1/161     byte     index to reading in strings
  186. gax2              $a2/162     word     (not commented in source code)
  187. curStrn           $a4/164     word     pointer to most current string that
  188.                                        was added or moved.
  189. strnDes           $a6/166     word     pointer to string descriptor
  190. descPtr           $a8/168     word     pointer to string descriptor
  191.                                        for string operations.
  192. geosBegin         $aa/170     word     pointer to the beginning of object
  193.                                        (menus, icons, etc.) data.
  194. memAmnt           $ac/172     word     amount of memory to insert or delete
  195. curKeyBrdPos      $ae/174     word     (not commented in source)
  196. SetForIOTemp      $b0/176     word     (not commented in source)
  197. curLineNum        $b2/178     word     current line number being executed or
  198.                                        $ff in direct mode
  199. VLIRtabl          $b4/180     word     pointer to beginning of VLIR table
  200. xPos              $b6/182     word     X position for PRINT
  201. yPos              $b8/184     byte     Y position for PRINT
  202. opMask            $b9/185     byte     current comparison being performed
  203.                                        >/1, =/2, </4 or any combo of these
  204. comm_Flag         $ba/186     byte     flag for which command is currently
  205.                                        being executed: 0 = none, 1 = RUN,
  206.                                        -1 = LIST - used by the Editor
  207. dataPtr           $bc/188     word     pointer in basic to DATA statements
  208. FP_sgns           $be/190     byte     temp flag for sign of FP number
  209. exp_found         $bf/191     byte     flag for whether exponent was found
  210. fontBegin         $c0/192     word     pointer to beginning of font
  211. lastFontPtr       $c2/194     word     (not commented in source)
  212. curDBPtr          $c4/196     word     pointer to current dialog box data
  213. sprite stuff      $c6/198     36 bytes internal sprite variables
  214. r16               $ea/234     word     more registers
  215. r17               $ec/236     word
  216. r18               $ee/238     word
  217. r19               $f0/240     word
  218. r20               $f2/242     word
  219. r21               $f4/244     word
  220. numDim            $f6/246     byte     number of dimensions in array
  221. grbackground      $f7/247     byte     FG/BG colors of graphics screen
  222. dig_found         $f8/248     byte     flag for whether a digit was found
  223.                                        when converting strings to FP
  224. operand_mask      $f9/249     byte     >/1, =/2, </4
  225. strnFlag          $fa/250     byte     $ff if string expected, else 0
  226.  
  227.  
  228. ************************************************************************
  229.  Glenn Holmer (ulthar@execpc.com)  Q-Link: ShadowM
  230.  This is a text.  This is only a text.
  231.  If this were a actual emergency you would have recieved a core dump!
  232. ************************************************************************o