Hellorld on the Psion Organiser II LZ
| hellorld.jpg | Explanation | |
| hellorld.opl | Simplified version. | |
| Readme.md | Rephrase some things. | |
This is a machine code "Hello World" program for the Psion Organiser II, inspired by the critically-acclaimed retro-computing YouTuber Usagi Electric.
The Psion Organizer II is an early PDA released in 1986. It uses a 0.9MHz 6800-based CPU.
The program is 16 bytes of machine code:
swi UT$DISP ; 3F 6F Call OS service: utility - display
.asciz "\x0CHELLORLD!" ; 0C Control character: clear screen
; 48 45 4C 4C "HELLORLD!"
; 4F 52 4C 44
; 21 00
swi KB$GETK ; 3F 48 Call OS service: keyboard - get key
rts ; 39 Return from subroutine
The 6800 swi (software interrupt) instruction itself doesn't have any operands,
but the OS looks at the following byte to determine which subroutine to call.
UT$DISP is a formatted display function similar to C's printf.
Conveniently for us, it also expects its format string to follow the system call.
We can use the built-in Basic-like language, OPL, to enter and run the machine code.
HLRLD:
local p%(8) REM Array of 8 integers.
p%(1) = 3ドルF6F REM Integers are 2 bytes, big-endian.
p%(2) = 0ドルC48
p%(3) = 454ドルC
p%(4) = 4ドルC4F
p%(5) = 524ドルC
p%(6) = 4421ドル
p%(7) = 003ドルF
p%(8) = 4839ドル
usr(addr(p%()),0) REM Jump to memory location at the first element of p%.