Changeset 49


Ignore:
Timestamp:
Sep 9, 2010, 1:19:58 PM (9 years ago)
Author:
mulligan
Message:

Fixed bug in ASMInterpret functions: CPL functions were not implemented.
More work on pretty printing.

Location:
Deliverables/D4.1
Files:
2 edited

Legend:

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

    r46 r49  
    130130       let pc,b1 = next pc in
    131131         CLR (`BIT b1), pc, 1
     132   | (true,true,true,true),(false,true,false,false) ->
     133         CPL `A, pc, 1
     134   | (true,false,true,true),(false,false,true,true) ->
     135         CPL `C, pc, 1
     136   | (true,false,true,true),(false,false,true,false) ->
     137       let pc,b1 = next pc in
     138         CPL (`BIT b1), pc, 1
    132139   | (true,true,false,true),(false,true,false,false) ->
    133140         DA `A, pc, 1
     
    405412  | CLR (`BIT b1) ->
    406413    [(true,true,false,false),(false,false,true,false);  b1]
     414  | CPL `A ->
     415    [(true,true,true,true),(false,true,false,false)]
     416  | CPL `C ->
     417    [(true,false,true,true),(false,false,true,true)]
     418  | CPL (`BIT b1) ->
     419    [(true,false,true,true),(false,false,true,false); b1]
    407420  | DA `A ->
    408421    [(true,true,false,true),(false,true,false,false)]
  • Deliverables/D4.1/Pretty.ml

    r46 r49  
    1919    "word11: " ^ pretty_word (((false,false,false,false),(false,b1,b2,b3)),b)
    2020
    21 let pretty_instruction =
     21let pretty_instruction_debug =
    2222 function
    2323    ACALL (`ADDR11 (a10,a9,a8,b1)) ->
     
    5757  | ANL (`U3 (`C,`NBIT b1)) ->
    5858     "ANL C /bit (" ^ pretty_byte b1 ^ ")"
     59  | CJNE (`U1 (`A, `DIRECT b1), `REL b2) ->
     60     "CJNE A direct rel (" ^ pretty_byte b1 ^ pretty_byte b2 ^ ")"
     61  | CJNE (`U1 (`A, `DATA b1), `REL b2) ->
     62     "CJNE A #data rel (" ^ pretty_byte b1 ^ pretty_byte b2 ^ ")"
     63  | CJNE (`U2 (`REG(r1,r2,r3), `DATA b1), `REL b2) ->
     64     "CJNE Ri #data rel (" ^ pretty_byte b1 ^ pretty_byte b2 ^ ")"
     65  | CJNE (`U2 (`INDIRECT i1, `DATA b1), `REL b2) ->
     66     "CJNE @Ri #data rel (" ^ pretty_bit i1 ^ pretty_byte b1 ^ pretty_byte b2 ^ ")"
     67  | CLR `A ->
     68     "CLR A"
     69  | CLR `C ->
     70    "CLR C"
     71  | CLR (`BIT b1) ->
     72    "CLR bit (" ^ pretty_byte b1 ^ ")"
    5973(*
    60   | CJNE (`U1 (`A, `DIRECT b1), `REL b2) ->
    61     [(true,false,true,true),(false,true,false,true); b1; b2]
    62   | CJNE (`U1 (`A, `DATA b1), `REL b2) ->
    63     [(true,false,true,true),(false,true,false,false); b1; b2]
    64   | CJNE (`U2 (`REG(r1,r2,r3), `DATA b1), `REL b2) ->
    65     [(true,false,true,true),(true,r1,r2,r3); b1; b2]
    66   | CJNE (`U2 (`INDIRECT i1, `DATA b1), `REL b2) ->
    67     [(true,false,true,true),(false,true,true,i1); b1; b2]
    68   | CLR `A ->
    69     [(true,true,true,false),(false,true,false,false)]
    70   | CLR `C ->
    71     [(true,true,false,false),(false,false,true,true)]
    72   | CLR (`BIT b1) ->
    73     [(true,true,false,false),(false,false,true,false); byte_of_byte7 b1]
    7474  | DA `A ->
    7575    [(true,true,false,true),(false,true,false,false)]
Note: See TracChangeset for help on using the changeset viewer.