Changeset 160


Ignore:
Timestamp:
Apr 26, 2018, 12:00:02 AM (7 years ago)
Author:
chronos
Message:
  • Added: Unfinished unit for Int128 type.
Location:
branches/virtualcpu3
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/virtualcpu3

    • Property svn:ignore
      •  

        old new  
        11lib
        22project1.exe
         3project1
        34*.lps
        45*.res
  • branches/virtualcpu3/UFormMain.lfm

    r155 r160  
    11object Form1: TForm1
    2   Left = 325
    3   Height = 300
    4   Top = 80
    5   Width = 400
     2  Left = 487
     3  Height = 783
     4  Top = 208
     5  Width = 1028
    66  Caption = 'Form1'
    7   DesignTimePPI = 120
     7  ClientHeight = 783
     8  ClientWidth = 1028
    89  OnShow = FormShow
    9   LCLVersion = '1.8.2.0'
     10  LCLVersion = '1.8.0.4'
     11  object Memo1: TMemo
     12    Left = 48
     13    Height = 686
     14    Top = 32
     15    Width = 902
     16    TabOrder = 0
     17  end
    1018end
  • branches/virtualcpu3/UFormMain.pas

    r159 r160  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, UMachine;
     8  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
     9  UMachine, UInt128;
    910
    1011type
     
    1314
    1415  TForm1 = class(TForm)
     16    Memo1: TMemo;
    1517    procedure FormShow(Sender: TObject);
    1618  private
    1719
    1820  public
    19 
     21    procedure TestInt128;
    2022  end;
    2123
     
    5254  Writer64: TInstWriter64;
    5355begin
    54   CPU8 := TCPU8.Create;
     56  TestInt128;
     57
     58{  CPU8 := TCPU8.Create;
    5559  Writer8 := TInstWriter8.Create;
    5660  Writer8.Machine := CPU8;
     
    6064  CPU8.Run;
    6165  CPU8.Free;
    62 
     66 }
    6367  CPU16 := TCPU16.Create;
    6468  Writer16 := TInstWriter16.Create;
     
    8993end;
    9094
     95procedure TForm1.TestInt128;
     96var
     97  A, B, C: Int128;
     98begin
     99  A := 2;
     100  B := 3;
     101  C := A + B;
     102  Memo1.Lines.Add(IntToStr(A) + ' + ' + IntToStr(B) + ' = ' + IntToStr(C));
     103  C := A * B;
     104  Memo1.Lines.Add(IntToStr(A) + ' * ' + IntToStr(B) + ' = ' + IntToStr(C));
     105end;
     106
    91107end.
    92108
  • branches/virtualcpu3/UMachine.pas

    r159 r160  
    3232    opTstZ, opTstNZ, opTstC, opTstNC, opLDMD, opSTMD, opLdir, opLddr,
    3333    opBitSet, opBitRes, opBitGet, opBitPut,
    34     opPrefix8, opPrefix16, opPrefix32, opPrefix64);
     34    opPrefix8, opPrefix16, opPrefix32, opPrefix64, opPrefix128);
    3535
    3636  TOpcodeHandler = procedure of object;
     
    348348begin
    349349  SetLength(Registers, 32);
    350   SetLength(Memory, 1000);
     350  SetLength(Memory, 100);
    351351  InitOpcodes;
    352352end;
  • branches/virtualcpu3/project1.lpi

    r158 r160  
    2828      </Item1>
    2929    </RequiredPackages>
    30     <Units Count="3">
     30    <Units Count="4">
    3131      <Unit0>
    3232        <Filename Value="project1.lpr"/>
     
    4444        <IsPartOfProject Value="True"/>
    4545      </Unit2>
     46      <Unit3>
     47        <Filename Value="UInt128.pas"/>
     48        <IsPartOfProject Value="True"/>
     49      </Unit3>
    4650    </Units>
    4751  </ProjectOptions>
     
    5660      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
    5761    </SearchPaths>
     62    <Parsing>
     63      <SyntaxOptions>
     64        <IncludeAssertionCode Value="True"/>
     65      </SyntaxOptions>
     66    </Parsing>
     67    <CodeGeneration>
     68      <Checks>
     69        <IOChecks Value="True"/>
     70        <RangeChecks Value="True"/>
     71        <OverflowChecks Value="True"/>
     72        <StackChecks Value="True"/>
     73      </Checks>
     74      <VerifyObjMethodCallValidity Value="True"/>
     75    </CodeGeneration>
    5876    <Linking>
    5977      <Options>
  • branches/virtualcpu3/project1.lpr

    r155 r160  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UFormMain, UMachine
     10  Forms, UFormMain, UMachine, UInt128
    1111  { you can add units after this };
    1212
Note: See TracChangeset for help on using the changeset viewer.