Changeset 150


Ignore:
Timestamp:
Oct 5, 2010, 4:18:58 PM (9 years ago)
Author:
mulligan
Message:

Manages to load and emulate a simple array program. A few obscure bugs.

Location:
Deliverables/D4.1
Files:
3 edited

Legend:

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

    r148 r150  
    11641164      (* DPM: What happens when we underflow? *)
    11651165       let high_bits = read_at_sp status in
    1166        let new_sp,_,_,_ = subb8_with_c status.sp (vect_of_int 1 `Eight) false in
     1166       let new_sp,cy,_,_ = subb8_with_c status.sp (vect_of_int 1 `Eight) false in
    11671167       let status = { status with sp = new_sp } in
    11681168       let low_bits = read_at_sp status in
    1169        let new_sp,_,_,_ = subb8_with_c status.sp (vect_of_int 1 `Eight) false in
     1169       let new_sp,_,_,_ = subb8_with_c status.sp (vect_of_int 1 `Eight) cy in
    11701170       let status = { status with sp = new_sp } in
    11711171         { status with pc = mk_word high_bits low_bits }
  • Deliverables/D4.1/Pretty.ml

    r147 r150  
    2121  | `EXT_INDIRECT x -> "ext_indirect " ^ string_of_bool x
    2222  | `EXT_IND_DPTR -> "ext_indirect_dptr"
    23   | `INDIRECT x -> if x then "@R0" else "@R1"
     23(* DPM: weird: this seems to be reversed in mcu8051ide: change made. *)
     24  | `INDIRECT x -> if not x then "@R0" else "@R1"
    2425  | `IND_DPTR -> "@DPTR"
    2526;;
  • Deliverables/D4.1/test.ml

    r147 r150  
    1919      prerr_string $ (pp_instruction instr) ^ " ";
    2020      prerr_endline $ string_of_int cost;
    21       if int_of_vect pc' > 105 then (* DPM: hardcoded on a case-by-case basis *)
     21      if int_of_vect pc' > 200 then (* DPM: hardcoded on a case-by-case basis *)
    2222        ()
    2323      else
     
    2727    prerr_endline "-------------------------------------"
    2828in
    29  (* mem_pretty_print status; *)
     29 mem_pretty_print status;
    3030 ASMInterpret.execute observe status
    3131;;
Note: See TracChangeset for help on using the changeset viewer.