; ============================================================================= ; tasks.asm - two demo userland tasks (text-in-ROM model). ; Each loops: write its letter to the console, then yield. This exercises the ; whole pipeline: syscall trap, console, and the HRAM context switch swapping ; RAM banks / SVBK between tasks. ; ============================================================================= INCLUDE "include/gbos.inc" SECTION "tasks", ROM0 TaskA:: .loop ld de, .msg ld b, 1 ; len ld c, SYS_WRITE rst $30 ld c, SYS_YIELD rst $30 jr .loop .msg db "A" TaskB:: .loop ld de, .msg ld b, 1 ld c, SYS_WRITE rst $30 ld c, SYS_YIELD rst $30 jr .loop .msg db "B"