Changeset 67


Ignore:
Timestamp:
Sep 13, 2010, 4:15:00 PM (9 years ago)
Author:
mulligan
Message:

DJNZ instruction finished.

Location:
Deliverables/D4.1
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/8051Series.ml

    r66 r67  
    1414
    1515  type processor_status
     16  type program_counter
    1617
    1718  type asm_instruction
     
    2021
    2122  val power_up: processor_status
     23  val next: program_counter -> processor_status ->
    2224end;;
  • Deliverables/D4.1/ASMInterpret.ml

    r62 r67  
    942942       else
    943943         { status with psw = (new_carry, b2, b3, b4),n2 }
    944 (*
    945  | DJNZ of [ reg | direct ] * rel
    946 *)
     944 | DJNZ (ag, (`REL rel)) ->
     945     let ag_val = fetch_arg8 status ag in
     946     let new_ag_val = byte_of_int ((int_of_byte ag_val) - 1) in
     947       if ag_val <> ((false,false,false,false),(false,false,false,false)) then
     948         { status with pc = status.pc ++ (int_of_byte rel) }
     949       else
     950         status
    947951 | NOP -> status
    948952;;
  • Deliverables/D4.1/Byte.ml

    r66 r67  
    5050end
    5151
    52 module ByteFunctor(Bit: BIT) (Nibble: NIBBLE with type bit = Bit.bit): BYTE
     52module ByteFunctor(Bit: BIT)
     53                  (Nibble: NIBBLE with type bit = Bit.bit): BYTE
    5354  with type bit = Bit.bit
    5455  and  type nibble = Nibble.nibble =
  • Deliverables/D4.1/Word.ml

    r66 r67  
    77(*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*)
    88
    9 open "Bit.ml";;
    10 open "Nibble.ml";;
    11 open "Byte.ml";;
     9open Bit;;
     10open Nibble;;
     11open Byte;;
    1212
    1313module type WORD =
     
    1919end;;
    2020
    21 module Word(Bit: BIT,
    22             Nibble: NIBBLE,
    23             Byte: BYTE)
     21module Word(Bit: BIT)
     22           (Nibble: NIBBLE with type bit = Bit.bit)
     23           (Byte: BYTE with type bit = Bit.bit and type nibble = Nibble.nibble): WORD
    2424  with type bit    = Bit.bit
    2525  and  type nibble = Nibble.nibble
Note: See TracChangeset for help on using the changeset viewer.