Ignore:
Timestamp:
Sep 29, 2010, 12:25:28 PM (9 years ago)
Author:
sacerdot
Message:

Several bug fixes and code clean-up.
New main file: test.ml to parse and execute an HEX file.
Usage: ./test.native foo.hex

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/ASMInterpret.mli

    r101 r138  
     1open BitVectors;;
     2open Physical;;
     3
    14exception CodeTooLarge
    25
    3 type status
     6type time = int;;
     7type line = [`P0 | `P1 ];; (* ??? *)
     8type continuation =
     9unit (*
     10 [`In of time * line * byte * continuation] option *
     11 [`Out of (time -> line -> byte -> continuation) ]
     12*)
    413
    5 val assembly: ASM.labelled_instruction list -> BitVectors.byte list
     14type status = private
     15 { code_memory: WordMap.map;        (* can be reduced *)
     16   low_internal_ram: Byte7Map.map;
     17   high_internal_ram: Byte7Map.map;
     18   external_ram: WordMap.map;
     19
     20   pc: word;
     21
     22   (* sfr *)
     23   p0: byte;
     24   sp: byte;
     25   dpl: byte;
     26   dph: byte;
     27   pcon: byte;
     28   tcon: byte;
     29   tmod: byte;
     30   tl0: byte;
     31   tl1: byte;
     32   th0: byte;
     33   th1: byte;
     34   p1: byte;
     35   scon: byte;
     36   sbuf: byte;
     37   p2: byte;
     38   ie: byte;
     39   p3: byte;
     40   ip: byte;
     41   psw: byte;
     42   acc: byte;
     43   b: byte;
     44
     45   clock: time;
     46   timer0: word;
     47   timer1: word;
     48   timer2: word;  (* can be missing *)
     49   io: continuation
     50 }
     51
     52module IntMap: Map.S with type key = int
     53
     54val assembly:
     55 ASM.labelled_instruction list -> BitVectors.byte list (*ASM.instruction list * symbol_table *) * string IntMap.t
     56
     57(*
     58val link:
     59 (ASM.instruction list * symbol_table * cost_map) list -> BitVectors.byte list
     60*)
    661
    762val initialize: status
    863
     64val load_mem: Physical.WordMap.map -> status -> status
    965val load: BitVectors.byte list -> status -> status
    1066
     
    1571   the processor never halts. *)
    1672val execute: (status -> unit) -> status -> status
     73
     74val fetch: Physical.WordMap.map -> word -> ASM.instruction * word * int
Note: See TracChangeset for help on using the changeset viewer.