From ac4fb25412982447af2e718d3824e6acf7d3a2dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20B=C3=B6hm?= Date: Mon, 6 Jul 2009 21:21:19 +0200 Subject: implement print statement --- src/emu/syscall.c | 8 +++----- src/emu/syscall.h | 7 ++----- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src/emu') diff --git a/src/emu/syscall.c b/src/emu/syscall.c index 625bbf4..aba3448 100644 --- a/src/emu/syscall.c +++ b/src/emu/syscall.c @@ -1,5 +1,6 @@ #include #include +#include #include "cpu.h" #include "mem.h" @@ -13,11 +14,8 @@ void do_syscall(void) case SYS_exit: exit(arg(1)); break; - case SYS_read: - push(read(arg(1), &MEM[arg(2)], arg(3))); - break; - case SYS_write: - push(write(arg(1), &MEM[arg(2)], arg(3))); + case SYS_print: + printf("%"PRIu32"\n", arg(1)); break; default: push(-1); diff --git a/src/emu/syscall.h b/src/emu/syscall.h index 7c7265c..afd3e9d 100644 --- a/src/emu/syscall.h +++ b/src/emu/syscall.h @@ -2,14 +2,11 @@ #define _SYSCALL_H /* calling convention: - * - pass syscall number in GPR[1] - * - pass arguments in GPR[2]-GPR[9] - * - return code is passed in GPR[2] + * - syscall number and params are passed on stack */ #define SYS_exit 0x00 -#define SYS_read 0x01 -#define SYS_write 0x02 +#define SYS_print 0x01 void do_syscall(void); -- cgit v1.2.3