Ignore:
Timestamp:
Sep 14, 2010, 3:45:13 PM (9 years ago)
Author:
mulligan
Message:

RET instruction implemented.

File:
1 edited

Legend:

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

    r72 r73  
    815815           { status with acc = (upper_nibble, lower_nibble) }
    816816(*
    817  | ANL (`U1 (`A, ag)) ->
    818      let acc_val = fetch_arg8 status `A in
    819      let ag_val = fetch_arg8 status ag in
    820  | DA  of acc
    821 
    822817 (* logical operations *)
    823818 | ANL of
     
    832827    (acc * [ reg | direct | indirect ],
    833828     direct * [ acc | data ]) union2 *)
    834   | CLR `A -> set_arg8 status
     829 | CLR `A -> set_arg8 status
    835830     ((false,false,false,false),(false,false,false,false)) `A
    836831 | CLR `C ->
     
    947942       else
    948943         new_status
     944 | RET ->
     945     let high_bits = (Byte7Map.find (byte7_of_byte status.sp) status.low_internal_ram) in
     946     let new_sp = byte_of_int ((int_of_byte status.sp) - 1) in
     947     let status = { status with sp = new_sp } in
     948     let low_bits = (Byte7Map.find (byte7_of_byte status.sp) status.low_internal_ram) in
     949     let new_sp = byte_of_int ((int_of_byte status.sp) - 1) in
     950     let status = { status with sp = new_sp } in
     951       { status with pc = (high_bits, low_bits) }
    949952(*
    950953 | ACALL of addr11
Note: See TracChangeset for help on using the changeset viewer.