source: Deliverables/D4.1/ASMInterpret.mli @ 194

Last change on this file since 194 was 193, checked in by mulligan, 10 years ago

Fixed type errors relating to serial output. The serial port code (for
output at least) seems to correctly simulate the compiled C code that I
sent Roberto on Friday.

File size: 2.1 KB
Line 
1open BitVectors;;
2open Physical;;
3
4exception CodeTooLarge
5
6type time = int;;
7type line = [ `P1 of byte
8            | `P3 of byte
9            | `SerialBuff of [ `Eight of byte | `Nine of BitVectors.bit * byte ]];;
10
11val string_of_line: line -> string;;
12(* In:  reception time, line of input, new continuation,
13   Out: transmission time, output line, expected duration until reply,
14        new continuation.
15*)
16type continuation =
17  [`In of time * line * continuation] option *
18  [`Out of (time -> line -> time * continuation) ]
19
20type status = private
21 { code_memory: WordMap.map;        (* can be reduced *)
22   low_internal_ram: Byte7Map.map;
23   high_internal_ram: Byte7Map.map;
24   external_ram: WordMap.map;       (* can be reduced *)
25
26   pc: word;
27
28   (* sfr *)
29   sp: byte;
30   dpl: byte;
31   dph: byte;
32   pcon: byte;
33   tcon: byte;
34   tmod: byte;
35   tl0: byte;
36   tl1: byte;
37   th0: byte;
38   th1: byte;
39   p1: byte;
40   p1_latch: byte;
41   scon: byte;
42   sbuf: byte;
43   ie: byte;
44   p3: byte;
45   p3_latch: byte;
46   ip: byte;
47   psw: byte;
48   acc: byte;
49   b: byte;
50   t2con: byte; (* 8052 only *)
51   rcap2l: byte; (* 8052 only *)
52   rcap2h: byte; (* 8052 only *)
53   tl2: byte; (* 8052 only *)
54   th2: byte; (* 8052 only *)
55
56   clock: time;
57   timer0: word;
58   timer1: word;
59   timer2: word;  (* can be missing *)
60   expected_out_time: [ `None | `Now | `At of time ];
61   io: continuation
62 }
63
64module IntMap: Map.S with type key = int
65
66val assembly:
67 ASM.labelled_instruction list -> BitVectors.byte list (*ASM.instruction list * symbol_table *) * string IntMap.t
68
69(*
70val link:
71 (ASM.instruction list * symbol_table * cost_map) list -> BitVectors.byte list
72*)
73
74val initialize: status
75
76val load_mem: Physical.WordMap.map -> status -> status
77val load: BitVectors.byte list -> status -> status
78
79exception Halt  (* to be raised to stop execution *)
80
81(* the callback function is used to observe the execution
82   trace; it can raise Hold to stop execution. Otherwise
83   the processor never halts. *)
84val execute: (status -> unit) -> status -> status
85
86val fetch: Physical.WordMap.map -> word -> ASM.instruction * word * int
Note: See TracBrowser for help on using the repository browser.