4 ; Generate AOF files from BASIC
6 ; © 1994-1998 Straylight
9 ;----- Licensing note -------------------------------------------------------
11 ; This file is part of Straylight's BASIC Assembler Supplement.
13 ; BAS is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
18 ; BAS is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ; GNU General Public License for more details.
23 ; You should have received a copy of the GNU General Public License
24 ; along with BAS. If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 ;----- Overview -------------------------------------------------------------
44 [ :LNOT::DEF:aofGen__dfn
49 ; On entry: R7 == address of workspace
50 ; R8-R12 set up by BASIC
54 ; CALL syntax: asmCode%
56 ; Use: Initialises workspace for generation of AOF code. Remembers
57 ; that code generation will start at asmCode%.
67 ; Use: Signals the start of a new assembly pass.
71 ; --- aof_firstPass ---
75 ; On exit: CS if on first pass, CC otherwise
77 ; Use: Informs the caller whether we're on the first or second pass.
83 ; On entry: R0 == address of anchor and size info
84 ; R1 == free space required
86 ; On exit: R0 == address of first free byte in area
88 ; Use: Ensures that there is the requested quantity of memory free
89 ; in the given block. If not, bas_noMem is called.
95 ; On entry: R0 == AREA attributes word
96 ; R7 == address of workspace
97 ; R8-R12 set up by BASIC
103 ; Use: Makes a new AREA start at the current location.
113 ; Use: Sets the image entry point to be the current location.
119 ; On entry: R0 == pointer to variable name
120 ; R1 == pointer to symbol name
121 ; R3 == attribute bits (not including bits 0,1)
125 ; Use: Imports a symbol, and sets the given variable to point to
126 ; it. If the symbol is already imported, another alias is
127 ; set up, but no actual symbol is created.
131 ; --- aof_iImport ---
133 ; On entry: R0 == WEAK flag
134 ; R7 == address of workspace
135 ; R8-R12 set up by BASIC
139 ; CALL syntax: name$,alias$
141 ; Use: Imports a symbol name$, and makes the variable whose name
142 ; is in alias$ refer to it.
148 ; On entry: R0 == STRONG flag
149 ; R7 == pointer to workspace
150 ; R8-R12 as set up by BASIC
154 ; CALL syntax: alias$,name$
156 ; Use: Exports the value held in the given alias as the symbol
163 ; On entry: R7 == workspace address
167 ; Use: Marks the current address as being the start of a relocation
168 ; block. If a relocation block is current, this is a no-op.
172 ; --- aof_noReloc ---
174 ; On entry: R7 == workspace address
178 ; Use: Marks the current address as being the start of a non-
179 ; relocation block. If a non-relocation block is current,
186 ; On entry: R7 == workspace address
187 ; R8-R12 set up by BASIC
193 ; Use: Saves the current AOF file. It also resets all the AOF
194 ; state, so that another AOF file can be built subsequently.
200 ;----- That's all, folks ----------------------------------------------------