Changeset 78


Ignore:
Timestamp:
Sep 15, 2010, 12:06:05 PM (9 years ago)
Author:
mulligan
Message:

LCALL implemented.

File:
1 edited

Legend:

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

    r77 r78  
    982982     let addr = (((p1,p2,p3,p4),(p5,b1,b2,b3)),b) in
    983983       { status with pc = addr }
    984 (* | LCALL (`ADDR16 addr) ->*)
     984 | LCALL (`ADDR16 addr) ->
     985     let status = { status with pc = status.pc ++ 3 } in
     986     let status = { status with sp = byte_of_int ((int_of_byte status.sp) + 1) } in
     987     let (bh, bl) = status.pc in
     988     let lower_mem = Byte7Map.add (byte7_of_byte status.sp) bl status.low_internal_ram in
     989     let status = { status with low_internal_ram = lower_mem } in
     990     let status = { status with sp = byte_of_int ((int_of_byte status.sp) + 1) } in
     991     let lower_mem = Byte7Map.add (byte7_of_byte status.sp) bh status.low_internal_ram in
     992     let status = { status with low_internal_ram = lower_mem } in
     993     let ((p1,p2,p3,p4),(p5,_,_,_)),b = status.pc in
     994       { status with pc = addr }
    985995 | AJMP (`ADDR11 (b1,b2,b3,b)) ->
    986996     let status = { status with pc = status.pc ++ 2 } in
Note: See TracChangeset for help on using the changeset viewer.