Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF

439 100 ] 110 NEXT 120 CALL GAP Here, the assembly language is enclosed in a loop such that two passes are made, with the value of OPT as 0 on the first pass and 3 on the second pass. (The same device is employed in the triangle drawing example above.) The values which are assigned to OPT have the following effects: 0 Assembler errors suppressed, no listing 1 Assembler errors suppressed, listing 2 Assembler errors reported, no listing 3 Assembler errors reported, listing So, in the above example, OPT=0 on the first pass so there will be no listing and no errors reported. This allows the forward referenced label to be identified without the assembly being interrupted.

On the second pass, OPT=3 and so a listing of the compiled code is produced, along with any programming errors. Note that the assignment statement P%=GAP must be enclosed within the loop so that it is reset before each pass. If the above program is RUN , its assembly and execution should now be successful. (The program is trivial; it merely loads a byte from the memory location specified by address, and, if the byte is non-zero, transfers it to the next memory location). Setting OPT equal to 4, 5, 6 or 7 has the same effect as setting it to 0, 1, 2 or 3 (respectively) except that the code is placed in memory starting at the address supplied in O%, rather than that in P%.

Note that OPT is not an assembly language mnemonic, but a so-called ‘pseudo- operation’, or assembler directive. It tells the assembler to do something, but is not an assembled instruction. The EQUate facility EQU is a pseudo-operation, which allows data to be incorporated into the body of an assembly language program. The EQU operations available are: EQUB equate byte reserves one byte of memory EQUW equate word reserves two bytes of memory EQUD equate double word reserves four bytes of memory EQUS equate string reserves memory as required