Changeset 183 for branches/virtualcpu4/UCpu.pas
- Timestamp:
- Apr 24, 2019, 5:04:53 PM (6 years ago)
- Location:
- branches/virtualcpu4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/virtualcpu4
- Property svn:ignore
-
old new 5 5 *.res 6 6 heaptrclog.trc 7 *.dbg
-
- Property svn:ignore
-
branches/virtualcpu4/UCpu.pas
r182 r183 15 15 opDataPrefix32, opDataPrefix64, opDataSize, opAddrSize, opTest, opAnd, opOr, 16 16 opXor, opLddr, opLdir, opMul, opDiv, opMod, opAddrPrefix8, opAddrPrefix16, 17 opAddrPrefix32, opAddrPrefix64 );17 opAddrPrefix32, opAddrPrefix64, opConvert); 18 18 19 19 TAddressSigned = Int64; … … 51 51 Z: Boolean; 52 52 Thread: TCpuThread; 53 procedure InstConvert; 53 54 procedure InstNop; 54 55 procedure InstHalt; … … 197 198 (Name: 'AP16'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True), 198 199 (Name: 'AP32'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True), 199 (Name: 'AP64'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True) 200 (Name: 'AP64'; Param1: prNone; Param2: prNone; Param3: prNone; Prefix: True), 201 (Name: 'CON'; Param1: prReg; Param2: prNone; Param3: prNone; Prefix: True) 200 202 ); 201 203 … … 770 772 end; 771 773 end; 774 775 procedure TCpu.InstConvert; 776 var 777 R: TRegIndex; 778 begin 779 R := Read8; 780 case AddrSize of 781 bw8: case DataSize of 782 bw8: Registers[R].B := Registers[R].B; 783 bw16: Registers[R].B := Registers[R].W; 784 bw32: Registers[R].B := Registers[R].D; 785 bw64: Registers[R].B := Registers[R].Q; 786 end; 787 bw16: case DataSize of 788 bw8: Registers[R].W := Registers[R].B; 789 bw16: Registers[R].W := Registers[R].W; 790 bw32: Registers[R].W := Registers[R].D; 791 bw64: Registers[R].W := Registers[R].Q; 792 end; 793 bw32: case DataSize of 794 bw8: Registers[R].D := Registers[R].B; 795 bw16: Registers[R].D := Registers[R].W; 796 bw32: Registers[R].D := Registers[R].D; 797 bw64: Registers[R].D := Registers[R].Q; 798 end; 799 bw64: case DataSize of 800 bw8: Registers[R].Q := Registers[R].B; 801 bw16: Registers[R].Q := Registers[R].W; 802 bw32: Registers[R].Q := Registers[R].D; 803 bw64: Registers[R].Q := Registers[R].Q; 804 end; 805 end; 806 end; 807 772 808 773 809 procedure TCpu.InstLddr; … … 1088 1124 Instructions[opDataPrefix16] := InstDataPrefix16; 1089 1125 Instructions[opDataPrefix32] := InstDataPrefix32; 1090 Instructions[opDataPrefix 32] := InstDataPrefix64;1126 Instructions[opDataPrefix64] := InstDataPrefix64; 1091 1127 Instructions[opAddrSize] := InstAddrSize; 1092 1128 Instructions[opAddrPrefix8] := InstAddrPrefix8; 1093 1129 Instructions[opAddrPrefix16] := InstAddrPrefix16; 1094 1130 Instructions[opAddrPrefix32] := InstAddrPrefix32; 1095 Instructions[opAddrPrefix 32] := InstAddrPrefix64;1131 Instructions[opAddrPrefix64] := InstAddrPrefix64; 1096 1132 Instructions[opTest] := InstTest; 1097 1133 Instructions[opAnd] := InstAnd; … … 1103 1139 Instructions[opDiv] := InstDiv; 1104 1140 Instructions[opMod] := InstMod; 1141 Instructions[opConvert] := InstConvert; 1105 1142 end; 1106 1143
Note:
See TracChangeset
for help on using the changeset viewer.