Changeset 15


Ignore:
Timestamp:
Nov 6, 2025, 10:51:17 PM (25 hours ago)
Author:
chronos
Message:
  • Added: Test loop.
Location:
branches/test2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/test2/Cpu.pas

    r14 r15  
    2020    opSetBit, opResetBit);
    2121
    22   TData = Cardinal;
     22  TData = Integer;
    2323
    2424  TInstruction = record
  • branches/test2/FormMain.pas

    r14 r15  
    4444const
    4545  Value0 = 0;
    46   Value1 = 0;
     46  Value1 = 1;
    4747  Port0 = 0;
     48  Port1 = 1;
     49var
     50  Label0: Integer;
    4851begin
    4952  with Cpu do begin
     
    5558    AddInstruction(opSet, Value1, 5);
    5659    AddInstruction(opAdd, Value0, Value1);
     60    AddInstruction(opOutput, Port1, Value0);
     61
     62    AddInstruction(opSet, Value0, 20);
     63    AddInstruction(opSet, Value1, 10);
     64    Label0 := Instructions.Count;
    5765    AddInstruction(opOutput, Port0, Value0);
     66    AddInstruction(opIncrement, Value0);
     67    AddInstruction(opDecrement, Value1);
     68    AddInstruction(opJumpRelativeNotZero, Label0 - Instructions.Count - 1, Value1);
     69
    5870    AddInstruction(opTerminate);
    5971    SetLength(Memory, 10000);
Note: See TracChangeset for help on using the changeset viewer.