20 lines
600 B
OCaml
20 lines
600 B
OCaml
(* test_execute.ml *)
|
|
|
|
let regs = Processor.{a = 0; x = 0; l = 0; b = 0; s = 0; t = 0; f = 0.0; pc = 0; sw = 0}
|
|
let memSize = 1 lsl 20 (*2^20*)
|
|
let memory = Bytes.make memSize '\x00' (*mutbale kos pomnilnika velikosti memSize*)
|
|
let state = Processor.{regs; memory}
|
|
|
|
(* Test function *)
|
|
let test_runner () =
|
|
let khz = 0.001 in
|
|
Processor.print_memory state 80;
|
|
Loader.load_object_file state "/mnt/c/Programiranje/SPO/ass1/fact.obj";
|
|
Processor.print_memory state 80;
|
|
Printf.printf "\n\n---Starting execution!---\n\n";
|
|
Pogajalnik.run state khz
|
|
|
|
|
|
(* Run the test *)
|
|
let () = test_runner ()
|
|
|