Ignore:
Timestamp:
Sep 22, 2019, 7:13:15 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Address CPU memory as pointer instead array of bytes.
  • Added: TMachine class to represent virtual machine itself.
Location:
branches/virtcpu varint
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/virtcpu varint

    • Property svn:ignore set to
      lib
      virtcpu
      virtcpu.lps
  • branches/virtcpu varint/UVarInt.pas

    r195 r196  
    3232    class operator Explicit(A: TVarInt): Int64;
    3333    class operator Inc(A: TVarInt): TVarInt;
    34     class operator Inc(A: TVarInt; B: Integer): TVarInt;
     34    class operator Inc(A: TVarInt; B: TVarInt): TVarInt;
    3535    class operator Dec(A: TVarInt): TVarInt;
     36    class operator Dec(A: TVarInt; B: TVarInt): TVarInt;
    3637    class operator Negative(A: TVarInt): TVarInt;
    3738    class operator Add(A: TVarInt; B: TVarInt): TVarInt;
     
    7576    class operator Explicit(A: TVarUInt): Int64;
    7677    class operator Inc(A: TVarUInt): TVarUInt;
    77     class operator Inc(A: TVarUInt; B: Integer): TVarUInt;
     78    class operator Inc(A: TVarUInt; B: TVarInt): TVarUInt;
    7879    class operator Dec(A: TVarUInt): TVarUInt;
     80    class operator Dec(A: TVarUInt; B: TVarUInt): TVarUInt;
    7981    class operator Negative(A: TVarUInt): TVarUInt;
    8082    class operator Add(A: TVarUInt; B: TVarUInt): TVarUInt;
     
    191193end;
    192194
    193 class operator TVarUInt.Inc(A: TVarUInt; B: Integer): TVarUInt;
    194 begin
    195   Result.Value := A.Value + B;
     195class operator TVarUInt.Inc(A: TVarUInt; B: TVarInt): TVarUInt;
     196begin
     197  Result.Value := A.Value + B.Value;
    196198end;
    197199
     
    199201begin
    200202  Result.Value := A.Value - 1;
     203end;
     204
     205class operator TVarUInt.Dec(A: TVarUInt; B: TVarUInt): TVarUInt;
     206begin
     207  Result.Value := A.Value - B.Value;
    201208end;
    202209
     
    424431end;
    425432
    426 class operator TVarInt.Inc(A: TVarInt; B: Integer): TVarInt;
    427 begin
    428   Result := A.Value + B;
     433class operator TVarInt.Inc(A: TVarInt; B: TVarInt): TVarInt;
     434begin
     435  Result := A.Value + B.Value;
    429436end;
    430437
     
    432439begin
    433440  Result.Value := A.Value - 1;
     441end;
     442
     443class operator TVarInt.Dec(A: TVarInt; B: TVarInt): TVarInt;
     444begin
     445  Result.Value := A.Value - B.Value;
    434446end;
    435447
Note: See TracChangeset for help on using the changeset viewer.