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

442 45 The operating system calls Machine code user programs should communicate with the operating system by calling routines in the address range &FF00 to &FFFF. These routines then call a specific internal routine whose address may change in different operating systems. The address of the specific routine is held in RAM between locations &200 and &2FF. The user may change the address held in these RAM locations to intercept any operating system call he or she wishes. Thus the ‘output the character in A’ routine is entered at &FFEE in all environments. The routine indirects through location &20E in all machines.

The contents of locations &20E and &20F will vary depending on the machine and the version of the operating system. In one particular machine the address in &20E and &20F is &E0A4 which is the local internal address of the normal ‘output the character in A’ routine. Parameters are passed to the routines in various ways using either the 6512 A, X and Y registers, zero page locations or a parameter block. All routines should be called with a JSR and with the decimal flag clear (ie in binary mode). In the detailed descriptions which follow A refers to the accumulator; X and Y refer to the registers; C, D, N, V and Z refer to the processor flags.

The table on the next page gives a summary of operating system calls and indirect vectors. Files Files are treated as a sequence of eight bit bytes. They can be accessed in one operation (using OSFILE) or in blocks (using OSGBPB) or a byte at a time (using OSBGET and OSBPUT). The following attributes may be associated with each file. Load address is the address in memory to which the file should normally be loaded. This can be over-ridden when the file is loaded, if necessary. Execution address is meaningful only if the file contains executable machine code, in which case it is the address where execution should start.

If the file contains a high level language program then the execution address is unimportant. Length is the total number of bytes in the file. It may be zero. Pointer is an index pointing to the next byte of data that is to be processed. The value of ‘pointer’ may be read or written (using OSARGS), and it does not indicate whether the appropriate byte has yet been transferred from file to memory or vice versa. Pointer is automatically updated by OSBGET and OSBPUT.