Changeset 213


Ignore:
Timestamp:
Nov 3, 2010, 3:23:03 PM (9 years ago)
Author:
mulligan
Message:

implementing interrupts

Location:
Deliverables/D4.1
Files:
2 edited

Legend:

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

    r212 r213  
    14401440          match status.serial_k_out with
    14411441            None -> assert false (* correct? *)
    1442           | Some k' -> { status with io = k';
     1442          | Some k' -> { status with io   = k';
    14431443                                     scon = set_bit status.scon 1 true; }
    14441444        else
    14451445          status
    14461446     | _ -> assert false)
     1447;;
     1448
     1449let interrupts status =
     1450  let (ea,_,_,es), (et1,ex1,et0,ex0) = bits_of_byte status.ie in
     1451  let (_,_,_,ps), (pt1,px1,pt0,px0) = bits_of_byte status.ip in
     1452    (* DPM: are interrupts enabled? *)
     1453    if ea then
     1454      match (es,et1,ex1,et0,ex0) with
     1455        | (false,false,false,false,false) ->
     1456            (* no interrupts set *)
     1457            status
     1458        | _ -> assert false
     1459    else
     1460      status
    14471461;;
    14481462
     
    17401754  let status = serial_port_input status in_cont in
    17411755  let status = serial_port_output status out_cont in
     1756  let status = interrupts status in
    17421757    { status with previous_p1_val = get_bit status.p3 4;
    17431758                  previous_p3_val = get_bit status.p3 5 }
  • Deliverables/D4.1/ASMInterpret.mli

    r212 r213  
    9595module IntMap: Map.S with type key = int
    9696
    97 val assembly:
    98  ASM.assembly_program -> BitVectors.byte list (*ASM.instruction list * symbol_table *) * string IntMap.t
     97val assembly: ASM.assembly_program -> BitVectors.byte list (*ASM.instruction list * symbol_table *) * string IntMap.t
    9998
    10099(*
Note: See TracChangeset for help on using the changeset viewer.