Ignore:
Timestamp:
Sep 22, 2010, 2:13:22 PM (9 years ago)
Author:
mulligan
Message:

fixed implementation of assembly, fixed typing error in execute.

File:
1 edited

Legend:

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

    r102 r103  
    680680   raise CodeTooLarge
    681681  else
    682     assert false
    683 (*
    684     let instr = ((List.filter (function `Label _ | `Cost _ | `Jmp _ | `Call _ -> false | _ -> true) l) : instruction list) in
    685682      List.flatten (List.map
    686683         (function
    687684            `Label s -> []
    688685          | `Cost s -> []
    689           | `Jmp s | `Call s ->
     686          | `Jmp s ->
    690687              let pc_offset = StringMap.find s labels in
    691               let i,_,_ = fetch (load_code_memory (List.map assembly1 instr)) (vect_of_int pc_offset `Eight) in
    692                 i
     688                assembly1 (`LJMP (`ADDR16 (vect_of_int pc_offset `Sixteen)))
     689          | `Call s ->
     690              let pc_offset = StringMap.find s labels in
     691                assembly1 (`LCALL (`ADDR16 (vect_of_int pc_offset `Sixteen)))
    693692          | #instruction as i -> assembly1 i) l)
    694 *)
    695693;;
    696694
     
    803801 function
    804802    `DIRECT addr ->
    805       (match addr with
    806          (false,r1,r2,r3),n1 ->
     803      let (b1, b2) = from_byte addr in
     804      (match from_nibble b1 with
     805         (false,r1,r2,r3) ->
    807806           { status with low_internal_ram =
    808               Byte7Map.add (mk_byte7 r1 r2 r3 n1) v status.low_internal_ram }
    809        | (true,r1,r2,r3),n1 ->
     807              Byte7Map.add (mk_byte7 r1 r2 r3 b2) v status.low_internal_ram }
     808       | (true,r1,r2,r3) ->
    810809           (*CSC: SFR access, TO BE IMPLEMENTED *)
    811810           (* assert false for now. Try to understand what DEC really does *)
Note: See TracChangeset for help on using the changeset viewer.