Changeset 195


Ignore:
Timestamp:
Oct 19, 2010, 10:40:47 AM (9 years ago)
Author:
mulligan
Message:

Added printout of processor status when we enter the infinite SJMP loop
at the end. Need to add printout of register status, though. Every
other important SFR, etc. is already implemented.

Location:
Deliverables/D4.1
Files:
4 edited

Legend:

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

    r194 r195  
    233233  let (_,_,_,_),(_,_,_,p) = bits_of_byte status.psw in p
    234234
     235let string_of_status status =   
     236  let acc_str = string_of_vect status.acc in
     237  let b_str   = string_of_vect status.b in
     238  let psw_str = string_of_vect status.psw in
     239  let sp_str  = string_of_vect status.sp in
     240  let ip_str  = string_of_vect status.ip in
     241  let pc_str  = string_of_vect status.pc in
     242  let dpl_str = string_of_vect status.dpl in
     243  let dph_str = string_of_vect status.dph in
     244  let scn_str = string_of_vect status.scon in
     245  let sbf_str = string_of_vect status.sbuf in
     246    "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n" ^
     247    " Processor status:                               \n" ^
     248    "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n" ^
     249    "   ACC : " ^ acc_str ^ "\n"                          ^
     250    "   B   : " ^ b_str   ^ "\n"                          ^
     251    "   PSW : " ^ psw_str ^ "\n"                          ^
     252    "    where                                        \n" ^
     253    "     CY  : " ^ (string_of_bool <*> get_cy_flag $ status) ^ "\n" ^
     254    "     AC  : " ^ (string_of_bool <*> get_ac_flag $ status) ^ "\n" ^
     255    "     FO  : " ^ (string_of_bool <*> get_fo_flag $ status) ^ "\n" ^
     256    "     RS1 : " ^ (string_of_bool <*> get_rs1_flag $ status) ^ "\n" ^
     257    "     RS0 : " ^ (string_of_bool <*> get_rs0_flag $ status) ^ "\n" ^
     258    "     OV  : " ^ (string_of_bool <*> get_ov_flag $ status) ^ "\n" ^
     259    "     UD  : " ^ (string_of_bool <*> get_ud_flag $ status) ^ "\n" ^
     260    "     P   : " ^ (string_of_bool <*> get_p_flag $ status) ^ "\n" ^
     261    "   SP  : " ^ sp_str  ^ "\n"                          ^
     262    "   IP  : " ^ ip_str  ^ "\n"                          ^
     263    "   PC  : " ^ pc_str  ^ "\n"                          ^
     264    "   DPL : " ^ dpl_str ^ "\n"                          ^
     265    "   DPH : " ^ dph_str ^ "\n"                          ^
     266    "   SCON: " ^ scn_str ^ "\n"                          ^
     267    "   SBUF: " ^ sbf_str ^ "\n"                          ^
     268    "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n"
    235269(* timings taken from SIEMENS *)
    236270
  • Deliverables/D4.1/ASMInterpret.mli

    r193 r195  
    6262 }
    6363
     64val string_of_status: status -> string
     65
    6466module IntMap: Map.S with type key = int
    6567
  • Deliverables/D4.1/Test.hex

    r187 r195  
    1 :03000000020008F3
    2 :0300610002000397
    3 :0500030012006480FE04
    4 :0E006400439840438920758DFD438780C299E3
    5 :0300720075990578
    6 :070075003099FD9000052207
    7 :06003700E478FFF6D8FD9D
    8 :080015007900E94400601B7A48
    9 :05001D00009000807856
    10 :030022000075A0C6
    11 :0A00250000E493F2A308B8000205FE
    12 :08002F00A0D9F4DAF275A0FF7C
    13 :08003D007800E84400600A7934
    14 :030045000075A0A3
    15 :0600480000E4F309D8FCFE
    16 :08004E007800E84400600C7921
    17 :0B00560000900000E4F0A3D8FCD9FAF1
    18 :03000800758107F8
    19 :0A000B0012007CE58260030200038E
    20 :04007C007582002267
     1:100000000200081200B580FE7581091200EEE5823B
     2:1000100060030200037900E94400601B7A0090004D
     3:10002000F2780075A000E493F2A308B8000205A0DE
     4:10003000D9F4DAF275A0FFE478FFF6D8FD7800E88D
     5:100040004400600A790075A000E4F309D8FC780048
     6:10005000E84400600C7900900000E4F0A3D8FCD9DB
     7:10006000FA020003AA82AB83EA4B700490000122DB
     8:10007000BA0107BB000490000122EA24FFF582EBDD
     9:1000800034FFF583C002C0031200648582088583B3
     10:1000900009D003D0028A828B830200D14398404367
     11:1000A0008920758DFD43878022AA82AB83C2998AFD
     12:1000B000993099FD2212009C90000A1200A990002C
     13:1000C000141200A99000031200641200A990000508
     14:1000D00022E5828508F0A4C582C0F08509F0A4D08D
     15:1000E000F025F0C5838508F0A42583F58322758269
     16:0200F0000022EC
    2117:00000001FF
  • Deliverables/D4.1/test.ml

    r150 r195  
    11open BitVectors;;
     2open ASMInterpret;;
    23open Util;;
    34open Pretty;;
     
    910 let pc = status.ASMInterpret.pc in
    1011 let instr,_,_ = ASMInterpret.fetch status.ASMInterpret.code_memory pc in
    11    prerr_string (BitVectors.hex_string_of_vect pc) ;
    12    prerr_endline (": " ^ pp_instruction instr)
     12   let _ = prerr_string (BitVectors.hex_string_of_vect pc) in
     13   let _ = prerr_endline (": " ^ pp_instruction instr) in
     14     match instr with
     15       `SJMP (`REL b) ->
     16          if int_of_vect b = 254 then
     17            prerr_endline <*> string_of_status $ status
     18          else
     19            ()
     20     | _ -> ()
    1321in
    1422(* DPM: for debugging! *)
Note: See TracChangeset for help on using the changeset viewer.