RISC-V Second Processor
(initial documentation)
An emulated Second Processor for the BBC/Master containing a RISC-V processor.
The RISC-V client MOS provides the basic system required to communicate with the host computer.
MOS API Calls
Programs communicate with the kernal and MOS via the ECALL instruction. Parameters are passed in registers A0 onwards.
On entry, A0-A7 contain values to pass to ECALL call A8=ECALL number On exit, A0-A7 contain returned data V=0 - no error occured V=1 - error occured, R0=>error block
ECALL &00 - OS_QUIT
On entry: On exit: A0=Return value
ECALL &01 - OS_CLI
On entry: On exit: A0=>command string A0=Return value
ECALL &02 - OS_BYTE
On entry: On exit A0=function A0=preserved A1=first parameter A1=returned word A2=second parameter A2=returned word DIV 256 Cy=returned carry flag
ECALL &03 - OS_WORD
On entry: On exit: A0=function Control block updated A1=>control block A1=returned line length for OSWORD 0
ECALL &04 - OS_WRCH
On entry: On exit: A0=character A0=preserved
ECALL &05 - OS_NEWL
On entry: On exit: A0=13
ECALL &06 - OS_RDCH
On entry: On exit: A0=character Cy=carry flag
ECALL &07 - OS_FILE
On entry: On exit: A0=function A0=onject type A1=>filename A1=preserved A2=load address A2=load address A3=exec address A3=exec address A4=start address A4=length A5=end address/attrs A5=attributes
ECALL &08 - OS_ARGS
On entry: On exit: A0=function A0=result A1=handle A1=preserved A2=data A2=data
ECALL &09 - OS_BGET
On entry: On exit: A0=byte A1=handle A1=preserved Cy=carry flag
ECALL &0A - OS_BPUT
On entry: On exit: A0=byte A0=preserved A1=handle A1=preserved
ECALL &0B - OS_GBPB
On entry: On exit: A0=function A0=result A1=handle A1=handle or cycle number A2=start address A2=updated address A3=count A3=updated count A4=offset A4=updated offset Cy=carry flag
ECALL &0C - OS_FIND
On entry: On exit: A0=function A0=handle A1=>string or handle
ECALL &0D - OS_SYST
On entry: R0=subfunction
ECALL &0E - OS_HANDLER
On entry: On exit: A0=handler number
ECALL &0F - OS_ERROR
ECALL &0F is followed by the error block in memory: ECALL 15 EQUW error EQUS "error string" EQUB 0
See also
- [[1]]