Changeset 116 for Deliverables
- Timestamp:
- Sep 23, 2010, 11:10:25 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Deliverables/D4.1/ASMInterpret.ml
r115 r116 1051 1051 else 1052 1052 status 1053 | `RET -> 1054 (* DPM: What happens when we underflow? *) 1055 let high_bits = Byte7Map.find (byte7_of_byte status.sp) status.low_internal_ram in 1056 let new_sp,_,_,_ = subb8_with_c status.sp (vect_of_int 1 `Eight) false in 1057 let status = { status with sp = new_sp } in 1058 let low_bits = Byte7Map.find (byte7_of_byte status.sp) status.low_internal_ram in 1059 let new_sp,_,_,_ = subb8_with_c status.sp (vect_of_int 1 `Eight) false in 1060 let status = { status with sp = new_sp } in 1061 { status with pc = mk_byte high_bits low_bits } 1062 | `RETI -> 1063 let high_bits = Byte7Map.find (byte7_of_byte status.sp) status.low_internal_ram in 1064 let new_sp,_,_,_ = subb8_with_c status.sp (vect_of_int 1 `Eight) false in 1065 let status = { status with sp = new_sp } in 1066 let low_bits = Byte7Map.find (byte7_of_byte status.sp) status.low_internal_ram in 1067 let new_sp,_,_,_ = subb8_with_c status.sp (vect_of_int 1 `Eight) false in 1068 let status = { status with sp = new_sp } in 1069 { status with pc = mk_byte high_bits low_bits } 1053 1070 (* 1054 | RET ->1055 let high_bits = (Byte7Map.find (byte7_of_byte status.sp) status.low_internal_ram) in1056 let new_sp = byte_of_int ((int_of_byte status.sp) - 1) in1057 let status = { status with sp = new_sp } in1058 let low_bits = (Byte7Map.find (byte7_of_byte status.sp) status.low_internal_ram) in1059 let new_sp = byte_of_int ((int_of_byte status.sp) - 1) in1060 let status = { status with sp = new_sp } in1061 { status with pc = (high_bits, low_bits) }1062 | RETI ->1063 let high_bits = (Byte7Map.find (byte7_of_byte status.sp) status.low_internal_ram) in1064 let new_sp = byte_of_int ((int_of_byte status.sp) - 1) in1065 let status = { status with sp = new_sp } in1066 let low_bits = (Byte7Map.find (byte7_of_byte status.sp) status.low_internal_ram) in1067 let new_sp = byte_of_int ((int_of_byte status.sp) - 1) in1068 let status = { status with sp = new_sp } in1069 { status with pc = (high_bits, low_bits) }1070 1071 | ACALL (`ADDR11 (b1,b2,b3,b)) -> 1071 1072 let status = { status with pc = status.pc ++ 2 } in
Note: See TracChangeset
for help on using the changeset viewer.