'C' Libraries for targetting the BBC I/O ======================================== Version 1.00 - 12-Jun-2005 functions and macros -------------------------------------------------------------------------- void os_cli(char *s); char *s string to pass to OSCLI -------------------------------------------------------------------------- int os_fx(int a, int x, int y) int a OSBYTE function in A int x OSBYTE X value int y OSBYTE Y value Returns value in X. -------------------------------------------------------------------------- int os_byte(int a, int xy) int a OSBYTE function in A int XY OSBYTE X and Y values Returns X+256*Y, ie the value held in XY. Note: returned Carry is lost. -------------------------------------------------------------------------- int os_word(int a, char *xy) int a OSWORD function in A char *xy pointer to control block in XY Returns value in Y. -------------------------------------------------------------------------- void os_wrch(int ch) int ch; character sent to OSWRCH in A -------------------------------------------------------------------------- int os_rdch(void); Returns A in low byte and Carry in second byte. -------------------------------------------------------------------------- int os_file(int a, char *name, char *block); int a OSFILE function in A char *name filename char *block OSFILE control block in XY Returns filetype in A. -------------------------------------------------------------------------- long os_args(int a, int handle, long arg); int a OSARGS function in A int handle file handle in Y long arg argument to write, or zero to read Returns the new argument. -------------------------------------------------------------------------- int os_bget(int handle); int handle file handle in Y Returns A in low byte and Carry in second byte. -------------------------------------------------------------------------- int os_bput(int ch, int handle); int ch character to BPUT in A int handle file handle in Y -------------------------------------------------------------------------- int os_gbpb(int a, int handle, char *block); int a OSGBPB function in A int handle file handle in block[0] char *block address of control block in XY Returns A in low byte and Carry in second byte. -------------------------------------------------------------------------- int os_find(int a, char *name); int a OSFIND function in A char *name filename Returns file handle in A -------------------------------------------------------------------------- void os_close(int handle); int handle OSFIND handle in Y -------------------------------------------------------------------------- char *os_report(void); Returns address of error block from &FD/&FE. -------------------------------------------------------------------------- void os_error(int err, char *s); int err error number char *s error string Generates a BRK error. -------------------------------------------------------------------------- int os_escape(void); Returns the escape state from &FF -------------------------------------------------------------------------- void os_onerror(void *f()); void *f() function to jump to when an error occurs, or NULL -------------------------------------------------------------------------- char *os_call(char *regs); char *regs register block A,X,Y,P,PC Returns pointer to a register block holding A,X,Y,P -------------------------------------------------------------------------- int os_host(void) Returns the current BBC host type, as follows: Note: provisional, will be changed #define _kernel_HOST_UNDEFINED -1 #define _kernel_BBC_MOS1_0 0 #define _kernel_BBC_MOS1_2 1 #define _kernel_BBC_ACW 2 #define _kernel_BBC_MASTER 3 #define _kernel_BBC_MASTER_ET 4 #define _kernel_BBC_MASTER_COMPACT 5 #define _kernel_ARTHUR 6 #define _kernel_RISC_OS 6 #define _kernel_SPRINGBOARD 7 #define _kernel_A_UNIX 8 #define _kernel_SPECTRUM 31 #define _kernel_PC 32 -------------------------------------------------------------------------- #define __bbc__ Macro defined when targetting the BBC platform --------------------------------------------------------------------------