about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-16 08:19:20 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-16 08:19:20 -0700
commitc498f6cdd6477e2f40c2f940d02ab91b65b8e7fe (patch)
treeb63d69dbf5a19964da095e0151eb808133e354ea
parentb8cfbdc866c6a10dd057b94b6bb161c8aa382b00 (diff)
downloadmu-c498f6cdd6477e2f40c2f940d02ab91b65b8e7fe.tar.gz
4352 - subx: write() syscall
-rw-r--r--subx/019syscalls.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/subx/019syscalls.cc b/subx/019syscalls.cc
index fdafd7d4..f9698957 100644
--- a/subx/019syscalls.cc
+++ b/subx/019syscalls.cc
@@ -14,11 +14,14 @@ case 0xcd: {  // int imm8 (software interrupt)
 void process_int80() {
   switch (Reg[EAX].u) {
   case 1:
-    exit(Reg[EBX].u);
+    exit(/*exit code*/Reg[EBX].u);
     break;
   case 3:
     Reg[EAX].i = read(/*file descriptor*/Reg[EBX].u, /*memory buffer*/mem_addr_u8(Reg[ECX].u), /*size*/Reg[EDX].u);
     break;
+  case 4:
+    Reg[EAX].i = write(/*file descriptor*/Reg[EBX].u, /*memory buffer*/mem_addr_u8(Reg[ECX].u), /*size*/Reg[EDX].u);
+    break;
   }
 }