Changeset 145


Ignore:
Timestamp:
Sep 30, 2010, 2:52:02 PM (9 years ago)
Author:
mulligan
Message:

Bug in LCALL fixed.

Location:
Deliverables/D4.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/.ocamlinit

    r138 r145  
     1#directory "_build";;
    12#load "Util.cmo";;
    23#load "BitVectors.cmo";;
     
    45#load "Parser.cmo";;
    56#load "IntelHex.cmo";;
    6 #load "ASM.cmo";;
    77#load "ASMInterpret.cmo";;
    88#load "Pretty.cmo";;
  • Deliverables/D4.1/ASMInterpret.ml

    r144 r145  
    44open Pretty;;
    55open IntelHex;;
     6open Util;;
    67open Parser;;
    78
     
    943944  else true
    944945;;
    945 
    946 let ($) f x = f x
    947946
    948947let read_at_sp status =
     
    12001199       let status = { status with sp = new_sp } in
    12011200       let pc_upper_byte, pc_lower_byte = from_word status.pc in
    1202        let status = write_at_sp status pc_upper_byte in
     1201       let status = write_at_sp status pc_lower_byte in
    12031202       let cry, new_sp = half_add status.sp (vect_of_int 1 `Eight) in
    12041203       let status = { status with sp = new_sp } in
    1205        let status = write_at_sp status pc_lower_byte in
     1204       let status = write_at_sp status pc_upper_byte in
    12061205         { status with pc = addr }
    12071206  | `AJMP (`ADDR11 a) ->
  • Deliverables/D4.1/test.ml

    r142 r145  
    1 let hex = IntelHex.intel_hex_of_file Sys.argv.(1) in
     1let hex = IntelHex.intel_hex_of_file "Test.hex" in
    22let mem = IntelHex.process_intel_hex hex in
    33let status = ASMInterpret.load_mem mem ASMInterpret.initialize in
     
    55 let pc = status.ASMInterpret.pc in
    66 let instr,_,_ = ASMInterpret.fetch status.ASMInterpret.code_memory pc in
    7   prerr_string (BitVectors.hex_string_of_vect pc) ;
    8   prerr_endline (": " ^ Pretty.pp_instruction instr)
     7   prerr_string (BitVectors.hex_string_of_vect pc) ;
     8   prerr_endline (": " ^ Pretty.pp_instruction instr)
    99in
    1010 ASMInterpret.execute observe status
Note: See TracChangeset for help on using the changeset viewer.