Ignore:
Timestamp:
Aug 19, 2020, 11:54:20 PM (4 years ago)
Author:
chronos
Message:
  • Added: TMachine class which contains CPU and peripherals.
  • Added: Execute TCpu inside background thread.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/virtcpu fixed int/UInstructionWriter.pas

    r168 r215  
    66
    77uses
    8   Classes, SysUtils, UMachine;
     8  Classes, SysUtils, UCpu;
    99
    1010type
     
    2828    procedure Subtract(R1, R2: Integer);
    2929    procedure Jump(Addr: Integer);
    30     procedure JumpNotZero(R1: Integer; Addr: Integer);
    31     procedure JumpZero(R1: Integer; Addr: Integer);
     30    procedure JumpCond(Addr: Integer);
     31    procedure TestZero(R: Integer);
    3232    {$IFDEF EXT_REL_JUMP}procedure JumpRelative(Addr: Integer);{$ENDIF}
     33    procedure SysCall;
    3334    procedure Increment(R: Integer);
    3435    procedure Decrement(R: Integer);
     
    112113end;
    113114
    114 procedure TInstructionWriter.JumpNotZero(R1: Integer; Addr: Integer);
     115procedure TInstructionWriter.JumpCond(Addr: Integer);
    115116begin
    116   Write(T(opJumpNotZero));
    117   Write(R1);
     117  Write(T(opJumpCond));
    118118  Write(Addr);
    119119end;
    120120
    121 procedure TInstructionWriter.JumpZero(R1: Integer; Addr: Integer);
     121procedure TInstructionWriter.TestZero(R: Integer);
    122122begin
    123   Write(T(opJumpZero));
    124   Write(R1);
    125   Write(Addr);
     123  Write(T(opTestZero));
     124  Write(R);
     125end;
     126
     127procedure TInstructionWriter.SysCall;
     128begin
     129  Write(T(opSysCall));
    126130end;
    127131
Note: See TracChangeset for help on using the changeset viewer.