Changeset 55 for branches/ByteArray/Disassembler.pas
- Timestamp:
- Nov 22, 2023, 10:09:35 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ByteArray/Disassembler.pas
r52 r55 11 11 12 12 TDisassembler = class 13 private 14 function RegToStr(RegIndex: Byte): string; 15 public 13 16 InstructionSet: TInstructionSet; 14 17 Memory: TMemory; … … 25 28 BigInt; 26 29 27 function IntToHex(Value: TBigInt; Digits: Integer): string; overload;30 function TDisassembler.RegToStr(RegIndex: Byte): string; 28 31 begin 29 Result := IntToHex(UInt64(Value), Digits); 30 end; 31 32 function IntToStr(Value: TBigInt): string; overload; 33 begin 34 Result := IntToStr(UInt64(Value)); 32 Result := Chr(Ord('A') + RegIndex); 35 33 end; 36 34 … … 64 62 InstText := InstText + ' '; 65 63 if InstructionInfo.Params[J] = ptNumber then begin 66 InstText := InstText + IntToHex(Value , 8);64 InstText := InstText + IntToHex(Value) + 'h'; 67 65 end else 68 66 if InstructionInfo.Params[J] = ptReg then begin 69 InstText := InstText + 'R' + IntToStr(Value);67 InstText := InstText + RegToStr(Value); 70 68 end else 71 69 if InstructionInfo.Params[J] = ptRegIndirect then begin 72 InstText := InstText + '( R' + IntToStr(Value) + ')';70 InstText := InstText + '(' + RegToStr(Value) + ')'; 73 71 end else 74 72 if InstructionInfo.Params[J] = ptRegIndirectIndex then begin 75 InstText := InstText + '( R' + IntToStr(Value);73 InstText := InstText + '(' + RegToStr(Value); 76 74 Value := Memory.ReadPos(1); 77 75 InstBytes := InstBytes + IntToHex(Value, 2) + ' '; 78 76 InstText := InstText + ' + ' + IntToStr(Value) + ')'; 79 end else80 if InstructionInfo.Params[J] = ptRegIndirectGroup then begin81 InstText := InstText + '(R' + IntToStr(Value);82 Value := Memory.ReadPos(1);83 InstBytes := InstBytes + IntToHex(Value, 2) + ' ';84 InstText := InstText + ': R' + IntToStr(Value) + ')';85 77 end; 86 78 end;
Note:
See TracChangeset
for help on using the changeset viewer.