Skip to content

Instantly share code, notes, and snippets.

@nihirash
Created April 4, 2023 18:25
Show Gist options
  • Select an option

  • Save nihirash/1018436bc9f5953d2c0098590635673e to your computer and use it in GitHub Desktop.

Select an option

Save nihirash/1018436bc9f5953d2c0098590635673e to your computer and use it in GitHub Desktop.
Minimal hello world 24 for Agon Light
ASSUME ADL=1
org $40000
jp _start
align 64
db "MOS" ; Header
db 00 ; Version
db 01 ; ADL
_start:
;; Reseting Z80 segment - API will know that we working in ADL
ld a,mb
;; Saving it to stack
push af
xor a
ld mb, a
call _main
pop af
;; Restoring Z80 segment
ld mb,a
ld hl,0
ret
include "crt.inc"
_main:
ld hl,hello
ld bc,0
xor a
rst.lil $18 ;; Looks like prefix is important for restarts
ret
hello:
db "HELLO, WORLD"
db 13, 10
db 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment