FIOLIB
C language library for futureOS
What is this project
fiolib, it's its name, is a c library to develop program for futureOS.
This library is developed by Stefan Stumpferl (the futureOS 's developer).
It's made in assembly and can be used for the small c compiler for amstrad cpc.
Here I just show you how to use this library and all its possibility.
But if you want to see an application go to my cpc awk project.
For further informations about it go and see the furureOS egroups.
CURRENT
- 24 03 2004 -
You can get the dsk file with this library and the compiler here
If you want to get directly the file and to compile by your own, it's here.
I will describe here all the functions implemented.
FIOLIB.TXT - Help-file for FIOLIB 25.3.2004 ================================= Before we start: Have a look at FTEST.C where some of the functions are used. cpcstart() ---------- This function prepares FutureOS for running Small-C programs. It is only used by FIOLIB.C itself. The user doesn't and shouldn't use that function. byebye() -------- This function is used to end a Small-C program under FutureOS. You can use this function or just end the program. Both has the same effect. The function byebye displays the message "Press any key to return to the Desktop." , then it waits for a pressed key and finally it jumps back to the Desktop of FutureOS. oscall(adr,regpack) ------------------- int adr; int *regpack; /* af,hl,de,bc */ This function is used to call a subroutine of the OS. The contents of "regpack" are loaded in the Z80 registers, then the OS-routine "adr" at the address "adr" is called and finally the Z80 registers are written back in "regpack". mode(n) ------- int n; Set the screen MODE to 0, 1, 2 or 3. Mode 0, 1 and 2 are the same as the MODE command of Basic. Don not use Mode 3! The mode is changed and the screen will be cleared, the cursor is set to the most left, most upper position. cls() ----- This is the same as the Basic command CLS. It just clears the screen and the cursor is set to the most left, most upper position. s80x25() -------- Just sets the format of the screen to 80 columns and 25 lines (Mode 2) or 40 columns and 25 lines (Mode 1). Only the screen format is changed, NO cls! s64x32() -------- Just sets the format of the screen to 64 columns and 32 lines (Mode 2) or 32 columns and 32 lines (Mode 1). Only the screen format is changed, NO cls! pen(n) ------ int n; Changes the PEN. You can use PEN 1, 2 or 3. It's the same like the command PEN in Basic. If you select PEN 0 then the two-color PEN is selected. Only the PEN of MODE 1 is changed. This command has no effect under MODE 2. ink(p,c) -------- int p,c; The INK function changes the color of a pen. It's the same like the INK command of Basic. Attention: You can only give ONE color to the pen. locate(x,y) ----------- int x,y; Function LOCATE is nearly the same like the Basic command LOCATE, you give the column (x) and the line (y) where the cursor should be positioned. You have 80 columns in Mode 2 and 40 columns in Mode 1 (if the screnn has 80x25 format). rr(s) ------ char *s; Returns the message "ERR" and displays an error number. putchar(c) ---------- char c; Uses putc() to display a character putc(c,unit) ------------ char c; int unit; Uses putb() to display a character. Adds CR to LF putb(c,unit) ------------ char c; int unit; Display a byte on the screen or write a byte to a file. getchar() --------- Waits for a pressed key, then returns. getc(unit) ---------- int unit; Get character from keyboard or from file. getb(unit) ---------- int unit; Get byte from keyboard of from file. puts(buf) --------- char *buf; Print a null-terminated string on the screen. upper(c) -------- int c; Converts letter to upper case. exit() ------ Exit the Small-C program and return to the Desktop.
*************************************************************************************************