Changeset 145 for Deliverables/D4.1
- Timestamp:
- Sep 30, 2010, 2:52:02 PM (10 years ago)
- Location:
- Deliverables/D4.1
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Deliverables/D4.1/.ocamlinit
r138 r145 1 #directory "_build";; 1 2 #load "Util.cmo";; 2 3 #load "BitVectors.cmo";; … … 4 5 #load "Parser.cmo";; 5 6 #load "IntelHex.cmo";; 6 #load "ASM.cmo";;7 7 #load "ASMInterpret.cmo";; 8 8 #load "Pretty.cmo";; -
Deliverables/D4.1/ASMInterpret.ml
r144 r145 4 4 open Pretty;; 5 5 open IntelHex;; 6 open Util;; 6 7 open Parser;; 7 8 … … 943 944 else true 944 945 ;; 945 946 let ($) f x = f x947 946 948 947 let read_at_sp status = … … 1200 1199 let status = { status with sp = new_sp } in 1201 1200 let pc_upper_byte, pc_lower_byte = from_word status.pc in 1202 let status = write_at_sp status pc_ upper_byte in1201 let status = write_at_sp status pc_lower_byte in 1203 1202 let cry, new_sp = half_add status.sp (vect_of_int 1 `Eight) in 1204 1203 let status = { status with sp = new_sp } in 1205 let status = write_at_sp status pc_ lower_byte in1204 let status = write_at_sp status pc_upper_byte in 1206 1205 { status with pc = addr } 1207 1206 | `AJMP (`ADDR11 a) -> -
Deliverables/D4.1/test.ml
r142 r145 1 let hex = IntelHex.intel_hex_of_file Sys.argv.(1)in1 let hex = IntelHex.intel_hex_of_file "Test.hex" in 2 2 let mem = IntelHex.process_intel_hex hex in 3 3 let status = ASMInterpret.load_mem mem ASMInterpret.initialize in … … 5 5 let pc = status.ASMInterpret.pc in 6 6 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) 9 9 in 10 10 ASMInterpret.execute observe status
Note: See TracChangeset
for help on using the changeset viewer.