Ignore:
Timestamp:
Sep 22, 2019, 9:31:49 PM (5 years ago)
Author:
chronos
Message:
  • Modified: All parts of virtual machine have own form in Forms subdirectory.
  • Modified: Main form moved to Forms subdirectory.
  • Modified: TCpu class moved to UCpu unit.
  • Added: Assembler and dissasembler forms.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/virtcpu varint/UVarInt.pas

    r196 r197  
    3939    class operator Multiply(A: TVarInt; B: TVarInt): TVarInt;
    4040    class operator IntDivide(A: TVarInt; B: TVarInt): TVarInt;
     41    class operator Modulus(A: TVarInt; B: TVarInt): TVarInt;
    4142    class operator Subtract(A: TVarInt; B: TVarInt): TVarInt;
    4243    class operator Equal(A: TVarInt; B: TVarInt): Boolean;
     
    6768    class operator Implicit(A: TVarUInt): Byte;
    6869    class operator Implicit(A: TVarUInt): Char;
     70    class operator Implicit(A: TVarUInt): TVarInt;
    6971    class operator Implicit(A: Byte): TVarUInt;
    7072    class operator Implicit(A: Integer): TVarUInt;
    7173    class operator Implicit(A: Int64): TVarUInt;
    7274    class operator Implicit(A: QWord): TVarUInt;
     75    class operator Implicit(A: TVarInt): TVarUInt;
    7376    class operator Explicit(A: Byte): TVarUInt;
    7477    class operator Explicit(A: Integer): TVarUInt;
     
    8386    class operator Multiply(A: TVarUInt; B: TVarUInt): TVarUInt;
    8487    class operator IntDivide(A: TVarUInt; B: TVarUInt): TVarUInt;
     88    class operator Modulus(A: TVarUInt; B: TVarUInt): TVarUInt;
    8589    class operator Subtract(A: TVarUInt; B: TVarUInt): TVarUInt;
    8690    class operator Equal(A: TVarUInt; B: TVarUInt): Boolean;
     
    148152end;
    149153
     154class operator TVarUInt.Implicit(A: TVarUInt): TVarInt;
     155begin
     156  Result.Value := A.Value;
     157end;
     158
    150159class operator TVarUInt.Implicit(A: Byte): TVarUInt;
    151160begin
     
    168177end;
    169178
     179class operator TVarUInt.Implicit(A: TVarInt): TVarUInt;
     180begin
     181  Result.Value := A.Value;
     182end;
     183
    170184class operator TVarUInt.Explicit(A: Byte): TVarUInt;
    171185begin
     
    226240begin
    227241  Result.Value := A.Value div B.Value;
     242end;
     243
     244class operator TVarUInt.Modulus(A: TVarUInt; B: TVarUInt): TVarUInt;
     245begin
     246  Result.Value := A.Value mod B.Value;
    228247end;
    229248
     
    466485end;
    467486
     487class operator TVarInt.Modulus(A: TVarInt; B: TVarInt): TVarInt;
     488begin
     489  Result.Value := A.Value mod B.Value;
     490end;
     491
    468492class operator TVarInt.Subtract(A: TVarInt; B: TVarInt): TVarInt;
    469493begin
    470   Result.Value := A.Value - B.Value
     494  Result.Value := A.Value - B.Value;
    471495end;
    472496
Note: See TracChangeset for help on using the changeset viewer.