aboutsummaryrefslogtreecommitdiffstats
path: root/c/libc.s
diff options
context:
space:
mode:
Diffstat (limited to 'c/libc.s')
-rw-r--r--c/libc.s8
1 files changed, 7 insertions, 1 deletions
diff --git a/c/libc.s b/c/libc.s
index b413f3b..5b176d9 100644
--- a/c/libc.s
+++ b/c/libc.s
@@ -1,6 +1,6 @@
.module libc
.globl _writes, _putc, _puts, _nl, _strlen, _readc, _sexit, _getpid, _getargs
- .globl _open, _close, _fgetc, _fputc, _flist, _fremove, _pipe, _ssend, _srecv, _srecv_nb, _pollin
+ .globl _open, _close, _fgetc, _fputc, _flist, _fremove, _pipe, _ssend, _srecv, _srecv_nb, _pollin, _pollcon
.globl _sys_net, _gsleep
;; SDCC sm83 sdcccall(1): 1st arg -> A (byte) or DE (pointer); ret A / BC.
;; rst $30 (the trap) clobbers BC/DE/HL; SDCC treats them caller-saved, so
@@ -136,6 +136,12 @@ _pollin:
rst #0x30
ret
+ ;; unsigned char pollcon(void) -> A (queued console byte, or 0)
+_pollcon:
+ ld c, #35 ; SYS_POLLCON
+ rst #0x30
+ ret
+
;; unsigned char open(const char *name /*DE*/, unsigned char mode /*A*/) -> A(fd)
_open:
ld b, a ; B = mode