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

Last change on this file since 166 was 166, checked in by mulligan, 9 years ago

I/O support added for serial buffer.

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