Changeset 46 for branches/ByteArray/Cpu.pas
- Timestamp:
- Oct 23, 2023, 11:34:54 PM (13 months ago)
- Location:
- branches/ByteArray
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ByteArray
-
Property svn:ignore
set to
heaptrclog.trc
lib
ByteArray
ByteArray.exe
ByteArray.lps
ByteArray.res
ByteArray.dbg
-
Property svn:ignore
set to
-
branches/ByteArray/Cpu.pas
r45 r46 22 22 inJump, inJumpSize, 23 23 inJumpNotZero, inJumpNotZeroSize, 24 inJumpZero, inJumpZeroSize, 24 25 inJumpRel, inJumpRelSize, 25 26 inCall, inCallSize, … … 36 37 inOtir, inOti, inOtdr, inOtd, 37 38 inCpir, inCpi, inCpdr, inCpd, 38 inEx, 39 inC p);39 inEx, inEnableInterrupts, inDisableInterrupts, 40 inCompare); 40 41 41 42 TRegIndex = (riA, riB, riC, riD, riE, riF, riG, riH); … … 64 65 procedure InstructionJumpNotZero; 65 66 procedure InstructionJumpNotZeroSize; 67 procedure InstructionJumpZero; 68 procedure InstructionJumpZeroSize; 66 69 procedure InstructionJumpRel; 67 70 procedure InstructionJumpRelSize; … … 257 260 end; 258 261 262 procedure TCpu.InstructionJumpZero; 263 var 264 RegIndex: TRegIndex; 265 Address: TBigInt; 266 begin 267 RegIndex := ReadRegIndex; 268 Address := Read(AddressWidth); 269 if Byte(Regs[RegIndex]) = 0 then 270 PC := Address; 271 end; 272 273 procedure TCpu.InstructionJumpZeroSize; 274 var 275 RegIndex: TRegIndex; 276 Address: TBigInt; 277 DataSize: Byte; 278 AddressSize: Byte; 279 begin 280 DataSize := Read(1); 281 AddressSize := Read(1); 282 RegIndex := ReadRegIndex; 283 Address := Read(AddressSize); 284 if Int64(Regs[RegIndex].Copy(DataSize)) = 0 then 285 PC := Address; 286 end; 287 259 288 procedure TCpu.InstructionJumpRel; 260 289 begin … … 430 459 Instructions[inJumpNotZero] := InstructionJumpNotZero; 431 460 Instructions[inJumpNotZeroSize] := InstructionJumpNotZeroSize; 461 Instructions[inJumpZero] := InstructionJumpZero; 462 Instructions[inJumpZeroSize] := InstructionJumpZeroSize; 432 463 Instructions[inJumpRel] := InstructionJumpRel; 433 464 Instructions[inJumpRelSize] := InstructionJumpRelSize;
Note:
See TracChangeset
for help on using the changeset viewer.