Ignore:
Timestamp:
Nov 22, 2023, 10:09:35 PM (6 months ago)
Author:
chronos
Message:
  • Modified: Extended BigInt type implementation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ByteArray/Disassembler.pas

    r52 r55  
    1111
    1212  TDisassembler = class
     13  private
     14    function RegToStr(RegIndex: Byte): string;
     15  public
    1316    InstructionSet: TInstructionSet;
    1417    Memory: TMemory;
     
    2528  BigInt;
    2629
    27 function IntToHex(Value: TBigInt; Digits: Integer): string; overload;
     30function TDisassembler.RegToStr(RegIndex: Byte): string;
    2831begin
    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);
    3533end;
    3634
     
    6462            InstText := InstText + ' ';
    6563          if InstructionInfo.Params[J] = ptNumber then begin
    66             InstText := InstText + IntToHex(Value, 8);
     64            InstText := InstText + IntToHex(Value) + 'h';
    6765          end else
    6866          if InstructionInfo.Params[J] = ptReg then begin
    69             InstText := InstText + 'R' + IntToStr(Value);
     67            InstText := InstText + RegToStr(Value);
    7068          end else
    7169          if InstructionInfo.Params[J] = ptRegIndirect then begin
    72             InstText := InstText + '(R' + IntToStr(Value) + ')';
     70            InstText := InstText + '(' + RegToStr(Value) + ')';
    7371          end else
    7472          if InstructionInfo.Params[J] = ptRegIndirectIndex then begin
    75             InstText := InstText + '(R' + IntToStr(Value);
     73            InstText := InstText + '(' + RegToStr(Value);
    7674            Value := Memory.ReadPos(1);
    7775            InstBytes := InstBytes + IntToHex(Value, 2) + ' ';
    7876            InstText := InstText + ' + ' + IntToStr(Value) + ')';
    79           end else
    80           if InstructionInfo.Params[J] = ptRegIndirectGroup then begin
    81             InstText := InstText + '(R' + IntToStr(Value);
    82             Value := Memory.ReadPos(1);
    83             InstBytes := InstBytes + IntToHex(Value, 2) + ' ';
    84             InstText := InstText + ': R' + IntToStr(Value) + ')';
    8577          end;
    8678        end;
Note: See TracChangeset for help on using the changeset viewer.