Changeset 103 for Deliverables
- Timestamp:
- Sep 22, 2010, 2:13:22 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Deliverables/D4.1/ASMInterpret.ml
r102 r103 680 680 raise CodeTooLarge 681 681 else 682 assert false683 (*684 let instr = ((List.filter (function `Label _ | `Cost _ | `Jmp _ | `Call _ -> false | _ -> true) l) : instruction list) in685 682 List.flatten (List.map 686 683 (function 687 684 `Label s -> [] 688 685 | `Cost s -> [] 689 | `Jmp s | `Call s->686 | `Jmp s -> 690 687 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))) 693 692 | #instruction as i -> assembly1 i) l) 694 *)695 693 ;; 696 694 … … 803 801 function 804 802 `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) -> 807 806 { 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) -> 810 809 (*CSC: SFR access, TO BE IMPLEMENTED *) 811 810 (* assert false for now. Try to understand what DEC really does *)
Note: See TracChangeset
for help on using the changeset viewer.