diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-07-16 08:19:20 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-07-16 08:19:20 -0700 |
commit | c498f6cdd6477e2f40c2f940d02ab91b65b8e7fe (patch) | |
tree | b63d69dbf5a19964da095e0151eb808133e354ea | |
parent | b8cfbdc866c6a10dd057b94b6bb161c8aa382b00 (diff) | |
download | mu-c498f6cdd6477e2f40c2f940d02ab91b65b8e7fe.tar.gz |
4352 - subx: write() syscall
-rw-r--r-- | subx/019syscalls.cc | 5 |
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; } } |