First os version with ABI number and working system calls
This commit is contained in:
@ -2,7 +2,7 @@ bios:
|
||||
@echo "Building PAT80 rom..."
|
||||
@z80asm -i main.asm -o rom.bin || (exit 1)
|
||||
@echo "Generating label lookup table..."
|
||||
@z80asm -i main.asm -o rom.bin -L 2>&1 | grep "Sys_" > rom.label
|
||||
@z80asm -i main.asm -o rom.bin -L 2>&1 | grep "Sys_" > abi-generated.asm
|
||||
@echo "PAT80 Rom size:"
|
||||
@du -h rom.bin
|
||||
@echo "Stretching rom to EEPROM size..."
|
||||
|
15
assembly/bios/README.md
Normal file
15
assembly/bios/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Pat80 Operating System and Memory Monitor
|
||||
|
||||
## Intro
|
||||
This folder contains the Pat80 Operating System.
|
||||
It is a System Monitor that makes available also some system API to access hardware (monitor, sound, keyboard, parallel terminal...).
|
||||
|
||||
## Build
|
||||
### Requirements
|
||||
z80asm, minipro
|
||||
### Make
|
||||
The os can be build issuing command `make`.
|
||||
Two files will be generated:
|
||||
- `rom.bin` is the rom file to be flashed on the eeprom
|
||||
- `abi-generated.asm` is the file to be included in any Pat80 application to access system APIs (see README.md in ../applications/)
|
||||
The build routine will then try to write the rom to a MiniPRO.
|
6
assembly/bios/abi-generated.asm
Normal file
6
assembly/bios/abi-generated.asm
Normal file
@ -0,0 +1,6 @@
|
||||
Sys_ABI: equ $0003
|
||||
Sys_Beep: equ $0013
|
||||
Sys_Print: equ $0007
|
||||
Sys_Printc: equ $000a
|
||||
Sys_Readc: equ $000d
|
||||
Sys_Readline: equ $0010
|
@ -23,39 +23,37 @@ jp Sysinit ; Startup vector: DO NOT MOVE! Must be the first instruction
|
||||
; System calls provide access to low level functions (input from keyboard, output to screen etc).
|
||||
; The name starts always with Sys_
|
||||
|
||||
; Returns ABI version.
|
||||
; (ABI -> https://en.wikipedia.org/wiki/Application_binary_interface)
|
||||
; Any Pat80 application should check the ABI version on startup, and refuse to run if not compatible.
|
||||
; @return bc the ABI version
|
||||
Sys_ABI:
|
||||
ld bc, 0
|
||||
ret
|
||||
|
||||
; Prints string
|
||||
; @param BC Pointer to a null-terminated string first character
|
||||
org 0x0010
|
||||
Sys_Print:
|
||||
call Term_print
|
||||
ret
|
||||
jp Term_print
|
||||
|
||||
; Writes a single character
|
||||
; @param A Value of character to print
|
||||
org 0x0020
|
||||
Sys_Printc:
|
||||
call Term_printc
|
||||
ret
|
||||
jp Term_printc
|
||||
|
||||
; Reads a single character
|
||||
; @return A The read character
|
||||
org 0x0030
|
||||
Sys_Readc:
|
||||
call Term_readc
|
||||
ret
|
||||
jp Term_readc
|
||||
|
||||
; Reads a line
|
||||
; @return BC The pointer to a null-terminated read string
|
||||
org 0x0040
|
||||
Sys_Readline:
|
||||
call Term_readline
|
||||
ret
|
||||
jp Term_readline
|
||||
|
||||
; Emits system beep
|
||||
org 0x0050
|
||||
Sys_Beep:
|
||||
call Snd_beep
|
||||
ret
|
||||
jp Snd_beep
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
Sys_Beep: equ $0050
|
||||
Sys_Print: equ $0010
|
||||
Sys_Printc: equ $0020
|
||||
Sys_Readc: equ $0030
|
||||
Sys_Readline: equ $0040
|
Reference in New Issue
Block a user