Assembler
|
The OPT
keyword denotes how the following block of assembler should be handled. It
relates to every block seperately, so you must put the OPT
keyword at the start of
each block. For example:
FOR loop% = 0 TO 2 STEP 2 P% = code% [ OPT loop% ... some basic initialization stuff here ... ] IF computer_is_networked% THEN [ OPT loop% ... network code ... ] ELSE [ OPT loop% ... non-network code ... ] ENDIF [ OPT loop% ... the rest of the code ... ] NEXTThis is a rough example showing how different bits of code can be utilised depending upon the current conditions (and the code need not be the same number of instructions either!); and it shows how you must use the
OPT
keyword - even if you only have one loop. However
the power and complexity of BASIC can be utilised to build up all kinds of fancy code.
The OPT
parameters have the following meanings:
Bit 0 - Produce a listing during the compilation Bit 1 - Report errors, such as unresolved references Bit 2 - Offset assembly, if code is compiled for execution at a different place to where it currently is. Bit 3 - Range check, will report if the code being compiled overshoots the memory allocated. Option List Err Offs RChk -------------------------------- OPT 0 No No No No <-- First pass OPT 1 Yes No No No OPT 2 No Yes No No <-- Second pass OPT 3 Yes Yes No No OPT 4 No No Yes No OPT 5 Yes No Yes No OPT 6 No Yes Yes No OPT 7 Yes Yes Yes No OPT 8 No No No Yes <-- Alt. first pass OPT 9 Yes No No Yes OPT 10 No Yes No Yes <-- Alt. second pass OPT 11 Yes Yes No Yes OPT 12 No No Yes Yes OPT 13 Yes No Yes Yes OPT 14 No Yes Yes Yes OPT 15 Yes Yes Yes Yes The first two option codes indicated are common values used when compiling code. The alternative option codes are identical, except that range checking is enabled. This is useful for reporting if the code is larger than the space allocated.