Topic : The GFA-Basic Compendium Author : GFA Systemtechnik GmbH Version : GFABasic.HYP v2.98 (12/31/2023) Subject : Documentation/Programming Nodes : 899 Index Size : 28056 HCP-Version : 3 Compiled on : Atari @charset : atarist @lang : @default : Document not found @help : Help @options : +g -i -s +z @width : 75 @hostname : STRNGSRV @hostname : CAB @hostname : HIGHWIRE @hostname : THING View Ref-FileINLINE addr,length addr: 4-byte integer variable, (not an array variable) length: integer constant, less than 32700 This instruction reserves an area of memory within a program. No comment is possible on the same line as this instruction, since memory is internally reserved where otherwise the comment would be. The reserved area always begins at an even address and it is initially filled with zeros. When implementing INLINE this address is written to the integer variable addr. When the program is loaded or saved, the reserved memory area is also. Positioning the cursor on the program line which contains the INLINE instruction and pressing the Help key causes a menu line with the entries Load, Save, Dump, and Clear to appear on the top line of the editor. Load is used to load a machine code program or data into the reserved area. Save saves the contents of the reserved area to disk. Dump causes a hexadecimal printout on the printer of the reserved area. Clear fills the reserved area with zeros. If the INLINE instruction is deleted, so also is the reserved area. The default file extension is '.INL'. In to this storage area, for instance, could be put pictures, tables or machine code programs. Example: See the example for C: in the system routines section. Memo: length&=WORD{addr%-4} (this works in the interpreter only) The editor will not accept values over 32746, entering any value over this can cause strange behavior and/or a crash. Enter the value very carefully, once the editor issues the 'line too long' error message, it's too late! The editor will also accept -negative values and crash the moment you press the return key! The editor will also accept 0 as a size which does not appear to be fatal. However, one has to wonder what use this would have? Loading a file that is too large for the inline does not produce a warning of any kind. It will be truncated at the size of the inline. However it will complain 'end of file reached' if the file size is smaller than the inline size. It's not neccessary to strip the 28 byte header from assembler routines. The magic number $601A at the start of such a routine is actually a 'bra.s start_addr+28' instruction. The header is effectively skipped, however removing the header will save you 28 bytes and one less instruction per call. When a program is compiled the INLINEs end up perfectly stacked one after another in the order they are encountered. Example: If you have 3 INLINEs exactly 10 bytes each, the 3rd INLINE can be located by adding 20 to the address of the first INLINE. In theory you could reserve 64000 bytes simply by defining 2 INLINEs 32000 bytes each one after the other. This however is only valid when compiled. Extreme care must be taken when writing data to an INLINE! In the editor a buffer overrun will corrupt the token code itself! In a compiled program a buffer overrun will corrupt other INLINEs, DATA, or the BSS segment. An INLINE address is always even. Odd sizes waste a byte at the end of the block. ASM only appears if started from GFA Assembler. See GFA Assembler manual. Note: The oddly placed clock character appears to be a typo. It does not do anything.