diff options
Diffstat (limited to 'c/libc.s')
| -rw-r--r-- | c/libc.s | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,6 +1,6 @@ .module libc .globl _writes, _putc, _puts, _nl, _strlen, _readc, _sexit, _getpid, _getargs - .globl _open, _close, _fgetc, _fputc, _flist, _fremove + .globl _open, _close, _fgetc, _fputc, _flist, _fremove, _pipe ;; 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 ;; wrappers need not preserve them - but we compute cleanly regardless. @@ -86,6 +86,12 @@ _getpid: rst #0x30 ret + ;; unsigned char pipe(void) -> A (read fd; write end is read+1) +_pipe: + ld c, #28 ; SYS_PIPE + rst #0x30 + ret + ;; unsigned char open(const char *name /*DE*/, unsigned char mode /*A*/) -> A(fd) _open: ld b, a ; B = mode |
