Commit 04c52595 authored by Martin Pépin's avatar Martin Pépin
Browse files

oubli

parent 25e140f3
......@@ -69,7 +69,6 @@ module Env = struct
(* Accessors *)
let ram env = env.ram
let rom env = env.rom
end
......@@ -201,7 +200,7 @@ let interp asm_file n script_mode input_c output_c p =
Env.set_tick_byte env 1
end;
(* Handling system calls *)
let return_code = Syscall.syscall (Env.ram env) (Env.rom env) in
let return_code = Syscall.syscall (Env.ram env) in
let return_code_bin = Ram.bits_of_int 32 return_code in
Env.write_on_ram 32 env (Ram.bits_of_int 8 4) return_code_bin;
flush stdout
......
(** Prints an integer on stdout and returns 0 *)
let sys_print_int a0 =
Format.printf "%d@?" a0;
Format.printf "\n\n ==> %d\n\n@?" a0;
0
(** Reads an integer from stdin and returns it *)
......@@ -34,7 +34,7 @@ let reset ram =
- The syscall is executed
- The return value is written at the right place in RAM
*)
let syscall ram rom =
let syscall ram =
let a0 = Ram.int_of_bits @@ Ram.get_word ram 8 in
let v0 = Ram.int_of_bits @@ Ram.get_word ram 4 in
match v0 with
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment