From 49f510d2d60129526832bfcd9c0f4049962bc80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20B=C3=B6hm?= Date: Mon, 18 May 2009 20:53:42 +0200 Subject: move stuff around and create initial source structure --- src/emu/syscall.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/emu/syscall.c (limited to 'src/emu/syscall.c') diff --git a/src/emu/syscall.c b/src/emu/syscall.c new file mode 100644 index 0000000..fe0d83e --- /dev/null +++ b/src/emu/syscall.c @@ -0,0 +1,23 @@ +#include +#include + +#include "cpu.h" +#include "mem.h" +#include "syscall.h" + +void do_syscall(void) +{ + switch (GPR[1]) { + case SYS_exit: + exit(GPR[2]); + break; + case SYS_read: + GPR[2] = read(GPR[2], &MEM[GPR[3]], GPR[4]); + break; + case SYS_write: + GPR[2] = write(GPR[2], &MEM[GPR[3]], GPR[4]); + break; + default: + GPR[2] = -1; + } +} -- cgit v1.2.3