Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
add support float mode for @dec & @inc
Browse files Browse the repository at this point in the history
  • Loading branch information
0xF6 committed May 4, 2020
1 parent 567ff63 commit b5e49b1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions vm/csharp/component/State.eval.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,19 @@ public void Eval()
break;

case 0xB1: /* @inc */
trace($"call :: increment 0x{r1:X}++");
unchecked { mem[r1]++; }
trace($"call :: increment [0x{r1:X}]++");
if(!ff)
unchecked { mem[r1]++; }
else
mem[r1] = f32u64 & ((u64f32 & mem[r1]) + 1f);
break;

case 0xB2: /* @dec */
trace($"call :: decrement 0x{r1:X}--");
unchecked { mem[r1]--; }
trace($"call :: decrement [0x{r1:X}]--");
if (!ff)
unchecked { mem[r1]--; }
else
mem[r1] = f32u64 & ((u64f32 & mem[r1]) - 1f);
break;

case 0xB3: /* @dup */
Expand Down

0 comments on commit b5e49b1

Please sign in to comment.