Reorganized folders, added pal-adapter io device folder
This commit is contained in:
12
pat80-computer/software/z80-assembly/applications/README.md
Normal file
12
pat80-computer/software/z80-assembly/applications/README.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Pat80 Applications
|
||||
|
||||
## Intro
|
||||
This folder contains some example applications.
|
||||
The folder `brief` contains little applications that can be entered directly via keyboard in the memory monitor.
|
||||
The folder `big` contains complete applications to be loaded via sdcard or tape.
|
||||
|
||||
## How to write an application
|
||||
When the Pat80 operating system is built, a `abi-generated.asm` file is built along with the rom binary. This file contains the description of the OS available API.
|
||||
An application targeting the last version of the OS should include this file, to make the system calls labels available inside the application code.
|
||||
The application can obtain the operating system ABI version (ABI -> https://en.wikipedia.org/wiki/Application_binary_interface) via the Sys_ABI call (it is a 16 bits integer returned in BC).
|
||||
The application's first command should be an ABI check: if the OS version is not compatible with the app, the app should exit displaying an error message.
|
@ -0,0 +1,7 @@
|
||||
org 0xA000
|
||||
include '../../os/abi-generated.asm'
|
||||
|
||||
STRING: DB "Hello",0
|
||||
ld bc, STRING
|
||||
call Sys_Print
|
||||
jp 0
|
@ -0,0 +1,38 @@
|
||||
;hd44780 lcd test procedure
|
||||
|
||||
LCD_INSTR_REG: EQU %00000000
|
||||
LCD_DATA_REG: EQU %00000001
|
||||
|
||||
;reset procedure
|
||||
ld a,%00111000
|
||||
out (LCD_INSTR_REG),a
|
||||
ld a,%00001000
|
||||
out (LCD_INSTR_REG),a
|
||||
ld a,%00000001
|
||||
out (LCD_INSTR_REG),a
|
||||
|
||||
;init procedure
|
||||
ld a,%00111000
|
||||
out (LCD_INSTR_REG),a
|
||||
ld a,%00001110
|
||||
out (LCD_INSTR_REG),a
|
||||
|
||||
;write characters to display
|
||||
ld a,%01000100
|
||||
out (LCD_DATA_REG),a
|
||||
ld a,%01100001
|
||||
out (LCD_DATA_REG),a
|
||||
ld a,%01101110
|
||||
out (LCD_DATA_REG),a
|
||||
ld a,%01101001
|
||||
out (LCD_DATA_REG),a
|
||||
ld a,%01100101
|
||||
out (LCD_DATA_REG),a
|
||||
ld a,%01101100
|
||||
out (LCD_DATA_REG),a
|
||||
ld a,%01100101
|
||||
out (LCD_DATA_REG),a
|
||||
ld a,%00100001
|
||||
out (LCD_DATA_REG),a
|
||||
|
||||
halt
|
Reference in New Issue
Block a user