Ignore:
Timestamp:
Oct 14, 2020, 8:04:25 PM (4 years ago)
Author:
chronos
Message:
  • Added: New LDI and STI instruction for indexed access to memory.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CpuSingleSize/UAssembler.pas

    r218 r219  
    174174      if I > 0 then
    175175        Parser.Expect(tkSpecialSymbol, ',');
     176      if InstructionInfo.Params[I] = ptNumber then begin
     177        Token := Parser.ReadNext;
     178        ParseNumParam(Token);
     179      end else
    176180      if InstructionInfo.Params[I] = ptReg then begin
    177181        Token := Parser.ReadNext;
     
    194198        Parser.Expect(tkSpecialSymbol, ')');
    195199      end else
    196       if InstructionInfo.Params[I] = ptNumber then begin
    197         Token := Parser.ReadNext;
    198         ParseNumParam(Token);
    199       end;
     200      if InstructionInfo.Params[I] = ptRegIndirectIndex then begin
     201        Parser.Expect(tkSpecialSymbol, '(');
     202        Token := Parser.ReadNext;
     203        if (Token.Value <> '') and (Token.Value[1] = 'R') then begin
     204          Token.Value := Copy(Token.Value, 2, MaxInt);
     205          if TryStrToInt(Token.Value, Number) then begin
     206            Memory.Write(Number);
     207            Parser.Expect(tkSpecialSymbol, '+');
     208            Token := Parser.ReadNext;
     209            ParseNumParam(Token);
     210          end else Error('Expected numeric register index error', Token.Pos);
     211        end else Error('Expected register name starting with R character.', Token.Pos);
     212        Parser.Expect(tkSpecialSymbol, ')');
     213      end else
    200214    end;
    201215  end;
Note: See TracChangeset for help on using the changeset viewer.