From ec43c1144376e15b7907a07e59b1a5c7946be6aa Mon Sep 17 00:00:00 2001 From: Gale Faraday Date: Sun, 19 Oct 2025 19:22:33 -0500 Subject: [PATCH] feat(chibio): implement serial driver bindings for CHIBI/O --- src/biosint.s | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/biosint.s b/src/biosint.s index 786f102..71b38f0 100644 --- a/src/biosint.s +++ b/src/biosint.s @@ -23,6 +23,28 @@ CHIBIO tfr d,x ; Put in X for indexing mode jmp [CHIBIOPTRTBL,x] ; Jump! -; Jump table TODO: Document function IDs and pointers +; Jump table CHIBIOPTRTBL - fdb $8000 ; TODO Implement BIOS function wrappers (serial, etc) + fdb CIOPOUTCHAR ; serial/POUTCHAR wrapper + fdb CIOPOUTZSTR ; serial/POUTZSTR wrapper + fdb CIOPINCHAR ; serial/CIOPINCHAR wrapper + +; POUTCHAR wrapper +; @param B: char to write +CIOPOUTCHAR + tfr b,a + jsr POUTCHAR + rti + +; POUTZSTR wrapper +; @param X: start of zstring +CIOPOUTZSTR + jsr POUTZSTR + rti + +; PINCHAR +; @return A: filled with char from RX buffer or NUL if no char is ready +; @return B: filled with LSR status codes masked with $9F +CIOPINCHAR + jsr PINCHAR + rti