open BitVectors;; open Physical;; exception CodeTooLarge type time = int;; type line = [ `P1 of byte | `P3 of byte | `SerialBuff of [ `Eight of byte | `Nine of BitVectors.bit * byte ]];; val string_of_line: line -> string;; (* In: reception time, line of input, new continuation, Out: transmission time, output line, expected duration until reply, new continuation. *) type continuation = [`In of time * line * continuation] option * [`Out of (time -> line -> time * continuation) ] type status = private { code_memory: WordMap.map; (* can be reduced *) low_internal_ram: Byte7Map.map; high_internal_ram: Byte7Map.map; external_ram: WordMap.map; (* can be reduced *) pc: word; (* sfr *) sp: byte; dpl: byte; dph: byte; pcon: byte; tcon: byte; tmod: byte; tl0: byte; tl1: byte; th0: byte; th1: byte; p1: byte; p1_latch: byte; scon: byte; sbuf: byte; ie: byte; p3: byte; p3_latch: byte; ip: byte; psw: byte; acc: byte; b: byte; t2con: byte; (* 8052 only *) rcap2l: byte; (* 8052 only *) rcap2h: byte; (* 8052 only *) tl2: byte; (* 8052 only *) th2: byte; (* 8052 only *) clock: time; timer0: word; timer1: word; timer2: word; (* can be missing *) expected_out_time: [ `None | `Now | `At of time ]; io: continuation } module IntMap: Map.S with type key = int val assembly: ASM.labelled_instruction list -> BitVectors.byte list (*ASM.instruction list * symbol_table *) * string IntMap.t (* val link: (ASM.instruction list * symbol_table * cost_map) list -> BitVectors.byte list *) val initialize: status val load_mem: Physical.WordMap.map -> status -> status val load: BitVectors.byte list -> status -> status exception Halt (* to be raised to stop execution *) (* the callback function is used to observe the execution trace; it can raise Hold to stop execution. Otherwise the processor never halts. *) val execute: (status -> unit) -> status -> status val fetch: Physical.WordMap.map -> word -> ASM.instruction * word * int