Writing new programs will be very easy using built-in functions in Z-Berry OS.
Vectors are links to routines. You don't need to know where routine is located. You should know address of vector only.
My second program:
ORG 8000h
LD A, 'C'
LD C, 2
LD B, 64
CALL SYS_BEEP
What you hear?
We played a tone 'C', the second octave, 64/128 long (1/4 sec.)
Similarily it is easy to write code to read from keyboard, read file, get current time or send data to new I2C device.
All you need is to call vectors with parameters.
Vectors are located in memory space from interrupt vectors to 100h.
OS vectors:
; BIOS vectors
; memory switching and pading
SYS_MEM_SWITCH EQU 46h ; switch RAM bank
SYS_MEM_PAGE EQU 49h ; RAM page selection
SYS_MEM_PUT EQU 4Ch ; save byte to second bank
SYS_MEM_GET EQU 4Fh ; read byte from second bank
; speaker operation, waiting
SYS_WAIT EQU 58h ; user configurable wait cycle
SYS_BEEP EQU 5Eh ; sound
; file operations
SYS_FS_OPENFILE EQU 70h ; find and open file
SYS_FS_WR_SEC EQU 73h ; write single sector
SYS_FS_RD_SEC EQU 76h ; read single sector
SYS_FS_INIT EQU 79h ; read filesystem parameters
SYS_FS_CHDIR EQU 7Ch ; change directory
SYS_FS_BROWSE EQU 7Fh ; list directory
SYS_FS_FIND EQU 82h ; find file/directory
SYS_FS_GETFILE EQU 85h ; load file
SYS_FS_RUNFILE EQU 88h ; load and run file
SYS_FS_NEXT_SEC EQU 8Bh ; prepare next sector for reading/writing
; inifile
SYS_INI_OPEN EQU 91h ; read inifile from card to memory
SYS_INI_KEY EQU 94h ; find key inside inifile
; keyboard operations
SYS_KBD_INIT EQU 97h ; initialize keyboard
SYS_KBD_LED EQU 9Ah ; change LEDs status
SYS_KBD_WRITE EQU 9Dh ; write settings to keyboard
SYS_KBD_READ EQU 0A0h ; get key(s) pressed
SYS_KBD_BLOCK EQU 0A3h ; stop sending data and start caching
SYS_KBD_CHECK EQU 0A6h ; check kbd is running well
; channel handling
; RST 10 ; send null-terminated string to channel
SYS_CH_SET EQU 0F1h ; set one from three built-in channels
SYS_CH_CHAR EQU 13h ; send one char to channel
SYS_CH_SEND EQU 0F4h ; send single byte to channel
SYS_CH_BCD EQU 0F7h ; convert BCD to two ascii chars and send to channel
SYS_CH_HEX EQU 0FAh ; convert byte to hex-ascii and send to channel
SYS_CH_PARAM EQU 0FDh ; set channel parameters
; serial port operations
; RST 20 ; send null-terminated string via serial line
SYS_TTY_INIT EQU 0AFh ; reserved
SYS_TTY_WRITE EQU 0B2h ; send one byte (no stop bit)
SYS_TTY_SEND EQU 23h ; send one byte/char (with stop bit)
SYS_TTY_READ EQU 0B5h ; wait for data from line
SYS_TTY_NEXT EQU 0B8h ; read byte from line, report if none
; date and time
SYS_RTC_SETDATE EQU 0BEh ; set actual date
SYS_RTC_SETTIME EQU 0C1h ; set time
SYS_RTC_GETDATE EQU 0C4h ; get date
SYS_RTC_GETTIME EQU 0C7h ; get current time
; SPI bus operations
SYS_SPI_READ EQU 0D0h ; read one byte from SPI bus
SYS_SPI_WRITE EQU 0D3h ; write one byte to SPI bud
SYS_SPI_RDWR EQU 0D6h ; read and write one byte simult.
; I2C bus operations
SYS_I2C_START EQU 0DFh ; start seq.
SYS_I2C_STOP EQU 0E2h ; stop seq.
SYS_I2C_WRITE EQU 0E5h ; send byte to bus
SYS_I2C_RDACK EQU 0E8h ; read byte from bus, positive ack
SYS_I2C_RDNACK EQU 0EBh ; read byte from bus, negative ack