|
@@ -107,7 +107,7 @@ Unit ramos6502asm;
|
|
|
function BuildRefConstExpression(out size:tcgint;startingminus:boolean=false):longint;
|
|
function BuildRefConstExpression(out size:tcgint;startingminus:boolean=false):longint;
|
|
|
procedure BuildConstantOperand(oper: tmos6502operand);
|
|
procedure BuildConstantOperand(oper: tmos6502operand);
|
|
|
procedure BuildReference(oper : tmos6502operand);
|
|
procedure BuildReference(oper : tmos6502operand);
|
|
|
- procedure BuildOperand(oper: tmos6502operand);
|
|
|
|
|
|
|
+ procedure BuildOperand(oper: tmos6502operand;iscalljmp: boolean);
|
|
|
procedure BuildOpCode(instr:TMOS6502Instruction);
|
|
procedure BuildOpCode(instr:TMOS6502Instruction);
|
|
|
procedure handleopcode;
|
|
procedure handleopcode;
|
|
|
function Assemble: tlinkedlist;override;
|
|
function Assemble: tlinkedlist;override;
|
|
@@ -1238,7 +1238,7 @@ Unit ramos6502asm;
|
|
|
oper.hastype:=true;
|
|
oper.hastype:=true;
|
|
|
oper.typesize:=l;
|
|
oper.typesize:=l;
|
|
|
Consume(AS_LPAREN);
|
|
Consume(AS_LPAREN);
|
|
|
- BuildOperand(oper);
|
|
|
|
|
|
|
+ BuildOperand(oper,false);
|
|
|
Consume(AS_RPAREN);
|
|
Consume(AS_RPAREN);
|
|
|
end
|
|
end
|
|
|
else
|
|
else
|
|
@@ -1706,7 +1706,7 @@ Unit ramos6502asm;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
- procedure tmos6502reader.BuildOperand(oper: tmos6502operand);
|
|
|
|
|
|
|
+ procedure tmos6502reader.BuildOperand(oper: tmos6502operand;iscalljmp: boolean);
|
|
|
|
|
|
|
|
//procedure AddLabelOperand(hl:tasmlabel);
|
|
//procedure AddLabelOperand(hl:tasmlabel);
|
|
|
//begin
|
|
//begin
|
|
@@ -1744,7 +1744,10 @@ Unit ramos6502asm;
|
|
|
AS_MINUS,
|
|
AS_MINUS,
|
|
|
AS_INTNUM :
|
|
AS_INTNUM :
|
|
|
begin
|
|
begin
|
|
|
- BuildReference(oper);
|
|
|
|
|
|
|
+ if iscalljmp then
|
|
|
|
|
+ BuildConstantOperand(oper)
|
|
|
|
|
+ else
|
|
|
|
|
+ BuildReference(oper);
|
|
|
|
|
|
|
|
//case oper.opr.typ of
|
|
//case oper.opr.typ of
|
|
|
// OPR_REFERENCE :
|
|
// OPR_REFERENCE :
|
|
@@ -1772,6 +1775,13 @@ Unit ramos6502asm;
|
|
|
|
|
|
|
|
AS_HASH:
|
|
AS_HASH:
|
|
|
begin
|
|
begin
|
|
|
|
|
+ if iscalljmp then
|
|
|
|
|
+ begin
|
|
|
|
|
+ Message(asmr_e_syn_operand);
|
|
|
|
|
+ RecoverConsume(true);
|
|
|
|
|
+ break;
|
|
|
|
|
+ end;
|
|
|
|
|
+
|
|
|
Consume(AS_HASH);
|
|
Consume(AS_HASH);
|
|
|
BuildConstantOperand(oper);
|
|
BuildConstantOperand(oper);
|
|
|
end;
|
|
end;
|
|
@@ -1973,7 +1983,7 @@ Unit ramos6502asm;
|
|
|
Consume(AS_COMMA);
|
|
Consume(AS_COMMA);
|
|
|
end;
|
|
end;
|
|
|
else
|
|
else
|
|
|
- BuildOperand(instr.Operands[operandnum] as tmos6502operand);
|
|
|
|
|
|
|
+ BuildOperand(instr.Operands[operandnum] as tmos6502operand,is_calljmp(instr.opcode));
|
|
|
end;
|
|
end;
|
|
|
until false;
|
|
until false;
|
|
|
instr.ops:=operandnum;
|
|
instr.ops:=operandnum;
|