Changeset 152 for trunk/Target


Ignore:
Timestamp:
Jun 6, 2024, 9:10:15 PM (7 months ago)
Author:
chronos
Message:
  • Fixed: A typo in interpreter target name.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Target/TargetInterpreter.pas

    r151 r152  
    1 unit TargetInterpretter;
     1unit TargetInterpreter;
    22
    33interface
     
    77
    88type
    9   TTargetInterpretter = class;
    10 
    11   { TTargetInterpretterThread }
    12 
    13   TTargetInterpretterThread = class(TThread)
     9  TTargetInterpreter = class;
     10
     11  { TTargetInterpreterThread }
     12
     13  TTargetInterpreterThread = class(TThread)
    1414  private
    1515    FNewState: TRunState;
     
    1919    procedure SetStateSafe(State: TRunState);
    2020  public
    21     Parent: TTargetInterpretter;
     21    Parent: TTargetInterpreter;
    2222    procedure Execute; override;
    2323  end;
     
    2525  TCommandHandler = procedure of object;
    2626
    27   { TTargetInterpretter }
    28 
    29   TTargetInterpretter = class(TBFTarget)
     27  { TTargetInterpreter }
     28
     29  TTargetInterpreter = class(TBFTarget)
    3030  private
    3131    FThreadState: Boolean;
    32     FThread: TTargetInterpretterThread;
     32    FThread: TTargetInterpreterThread;
    3333    FStepCount: Integer;
    3434    FCommandTable: array[TMachineCommand] of TCommandHandler;
     
    8989  SBreakPointIndexError = 'Break point index error: %d';
    9090
    91 { TTargetInterpretterThread }
    92 
    93 procedure TTargetInterpretterThread.Execute;
     91{ TTargetInterpreterThread }
     92
     93procedure TTargetInterpreterThread.Execute;
    9494var
    9595  BreakPoint: TBreakPoint;
     
    130130end;
    131131
    132 procedure TTargetInterpretterThread.DoMessage;
     132procedure TTargetInterpreterThread.DoMessage;
    133133begin
    134134  Parent.SendMessage(FMessage);
    135135end;
    136136
    137 procedure TTargetInterpretterThread.DoSetState;
     137procedure TTargetInterpreterThread.DoSetState;
    138138begin
    139139  Parent.State := FNewState;
    140140end;
    141141
    142 procedure TTargetInterpretterThread.SetStateSafe(State: TRunState);
     142procedure TTargetInterpreterThread.SetStateSafe(State: TRunState);
    143143begin
    144144  if Parent.State = State then Exit;
     
    147147end;
    148148
    149 { TTargetInterpretter }
    150 
    151 procedure TTargetInterpretter.SetState(AValue: TRunState);
     149{ TTargetInterpreter }
     150
     151procedure TTargetInterpreter.SetState(AValue: TRunState);
    152152begin
    153153  if FState = AValue then Exit;
     
    156156end;
    157157
    158 procedure TTargetInterpretter.SetThread(State: Boolean);
     158procedure TTargetInterpreter.SetThread(State: Boolean);
    159159begin
    160160  if FThreadState = State then Exit;
    161161  FThreadState := State;
    162162  if State then begin
    163     FThread := TTargetInterpretterThread.Create(True);
     163    FThread := TTargetInterpreterThread.Create(True);
    164164    FThread.Parent := Self;
    165165    FThread.FreeOnTerminate := False;
     
    170170end;
    171171
    172 procedure TTargetInterpretter.PrepareJumpTable;
     172procedure TTargetInterpreter.PrepareJumpTable;
    173173type
    174174  TArrayOfInteger = array of Integer;
     
    205205end;
    206206
    207 procedure TTargetInterpretter.CommandInput;
     207procedure TTargetInterpreter.CommandInput;
    208208var
    209209  Addr: Integer;
     
    221221end;
    222222
    223 procedure TTargetInterpretter.CommandOutput;
     223procedure TTargetInterpreter.CommandOutput;
    224224begin
    225225  if OutputPosition > Length(Output) then
     
    231231end;
    232232
    233 procedure TTargetInterpretter.CommandLoopStart;
     233procedure TTargetInterpreter.CommandLoopStart;
    234234begin
    235235  if Memory[MemoryPosition + FProgram[FProgramIndex].RelIndex] = 0 then
     
    237237end;
    238238
    239 procedure TTargetInterpretter.CommandLoopEnd;
     239procedure TTargetInterpreter.CommandLoopEnd;
    240240begin
    241241  if Memory[MemoryPosition + FProgram[FProgramIndex].RelIndex] > 0 then
     
    243243end;
    244244
    245 procedure TTargetInterpretter.CommandInc;
     245procedure TTargetInterpreter.CommandInc;
    246246var
    247247  Addr: Integer;
     
    253253end;
    254254
    255 procedure TTargetInterpretter.CommandDec;
     255procedure TTargetInterpreter.CommandDec;
    256256var
    257257  Addr: Integer;
     
    263263end;
    264264
    265 procedure TTargetInterpretter.CommandPointerInc;
     265procedure TTargetInterpreter.CommandPointerInc;
    266266begin
    267267  if MemoryPosition < MemorySize then
     
    270270end;
    271271
    272 procedure TTargetInterpretter.CommandPointerDec;
     272procedure TTargetInterpreter.CommandPointerDec;
    273273begin
    274274  if MemoryPosition > 0 then
     
    277277end;
    278278
    279 procedure TTargetInterpretter.CommandSet;
     279procedure TTargetInterpreter.CommandSet;
    280280var
    281281  Addr: Integer;
     
    288288end;
    289289
    290 procedure TTargetInterpretter.CommandMultiply;
     290procedure TTargetInterpreter.CommandMultiply;
    291291var
    292292  Addr: Integer;
     
    300300end;
    301301
    302 procedure TTargetInterpretter.Reset;
     302procedure TTargetInterpreter.Reset;
    303303var
    304304  I: Integer;
     
    322322end;
    323323
    324 procedure TTargetInterpretter.Compile;
     324procedure TTargetInterpreter.Compile;
    325325begin
    326326  inherited;
     
    328328end;
    329329
    330 procedure TTargetInterpretter.PrepareBreakPoints;
     330procedure TTargetInterpreter.PrepareBreakPoints;
    331331var
    332332  I: Integer;
     
    340340end;
    341341
    342 procedure TTargetInterpretter.CheckMemoryBounds(Address: Integer);
     342procedure TTargetInterpreter.CheckMemoryBounds(Address: Integer);
    343343begin
    344344  if Address < 0 then raise Exception.Create(SProgramLowerMemoryLimit);
     
    346346end;
    347347
    348 procedure TTargetInterpretter.EmitTargetCode;
     348procedure TTargetInterpreter.EmitTargetCode;
    349349var
    350350  I: Integer;
     
    369369end;
    370370
    371 function TTargetInterpretter.GetExecutionPosition: Integer;
     371function TTargetInterpreter.GetExecutionPosition: Integer;
    372372begin
    373373  Result := FProgramIndex;
    374374end;
    375375
    376 procedure TTargetInterpretter.OptimizeSource;
     376procedure TTargetInterpreter.OptimizeSource;
    377377begin
    378378  inherited;
    379379end;
    380380
    381 procedure TTargetInterpretter.Run;
     381procedure TTargetInterpreter.Run;
    382382begin
    383383  PrepareBreakPoints;
     
    390390end;
    391391
    392 procedure TTargetInterpretter.Pause;
     392procedure TTargetInterpreter.Pause;
    393393begin
    394394  if State = rsRunning then State := rsPaused;
    395395end;
    396396
    397 procedure TTargetInterpretter.Stop;
     397procedure TTargetInterpreter.Stop;
    398398begin
    399399  State := rsStopped;
     
    401401end;
    402402
    403 procedure TTargetInterpretter.StepInto;
     403procedure TTargetInterpreter.StepInto;
    404404var
    405405  Step: TDebugStep;
     
    421421end;
    422422
    423 procedure TTargetInterpretter.StepOver;
     423procedure TTargetInterpreter.StepOver;
    424424var
    425425  Step: TDebugStep;
     
    440440end;
    441441
    442 procedure TTargetInterpretter.StepOut;
     442procedure TTargetInterpreter.StepOut;
    443443var
    444444  Step: TDebugStep;
     
    462462end;
    463463
    464 procedure TTargetInterpretter.RunToCursor(Pos: Integer);
     464procedure TTargetInterpreter.RunToCursor(Pos: Integer);
    465465begin
    466466  Breakpoints.SetSystem(Pos);
     
    468468end;
    469469
    470 constructor TTargetInterpretter.Create;
     470constructor TTargetInterpreter.Create;
    471471begin
    472472  inherited;
    473   FName := 'Interpretter';
     473  FName := 'Interpreter';
    474474  FImageIndex := 25;
    475475  FCapabilities := [tcRun, tcPause, tcStop, tcCompile, tcStepOut, tcStepInto,
     
    489489end;
    490490
    491 destructor TTargetInterpretter.Destroy;
     491destructor TTargetInterpreter.Destroy;
    492492begin
    493493  FState := rsStopped;
Note: See TracChangeset for help on using the changeset viewer.