Only call "newrelo" when needed.
This commit is contained in:
parent
6bf947ee6e
commit
a6ecac6f1d
2 changed files with 23 additions and 12 deletions
|
@ -35,6 +35,7 @@ operation
|
||||||
{ emit1(0x10); emit1($1);
|
{ emit1(0x10); emit1($1);
|
||||||
$2.val -= (DOTVAL+2);
|
$2.val -= (DOTVAL+2);
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo($2.typ, RELPC|RELO2|RELBR);
|
newrelo($2.typ, RELPC|RELO2|RELBR);
|
||||||
#endif
|
#endif
|
||||||
emit2($2.val);
|
emit2($2.val);
|
||||||
|
@ -44,6 +45,7 @@ operation
|
||||||
{ emit1($1);
|
{ emit1($1);
|
||||||
$2.val -= (DOTVAL+2);
|
$2.val -= (DOTVAL+2);
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo($2.typ, RELPC|RELO2|RELBR);
|
newrelo($2.typ, RELPC|RELO2|RELBR);
|
||||||
#endif
|
#endif
|
||||||
emit2($2.val);
|
emit2($2.val);
|
||||||
|
@ -52,6 +54,7 @@ operation
|
||||||
IMMED '#' expr
|
IMMED '#' expr
|
||||||
{ emit1($1);
|
{ emit1($1);
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo($3.typ, RELO1);
|
newrelo($3.typ, RELO1);
|
||||||
#endif
|
#endif
|
||||||
emit1($3.val);
|
emit1($3.val);
|
||||||
|
@ -64,12 +67,14 @@ operation
|
||||||
case 0x0C:
|
case 0x0C:
|
||||||
case 0x0E:
|
case 0x0E:
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo($3.typ, RELO2|RELBR);
|
newrelo($3.typ, RELO2|RELBR);
|
||||||
#endif
|
#endif
|
||||||
emit2($3.val);
|
emit2($3.val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo($3.typ, RELO1);
|
newrelo($3.typ, RELO1);
|
||||||
#endif
|
#endif
|
||||||
emit1($3.val);
|
emit1($3.val);
|
||||||
|
@ -83,6 +88,7 @@ operation
|
||||||
else
|
else
|
||||||
emit1or2($1 - 0x10);
|
emit1or2($1 - 0x10);
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo($3.typ, RELO1);
|
newrelo($3.typ, RELO1);
|
||||||
#endif
|
#endif
|
||||||
emit1($3.val);
|
emit1($3.val);
|
||||||
|
@ -91,6 +97,7 @@ operation
|
||||||
XOP '>' expr
|
XOP '>' expr
|
||||||
{ emit1or2($1 + 0x10);
|
{ emit1or2($1 + 0x10);
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo($3.typ, RELO2|RELBR);
|
newrelo($3.typ, RELO2|RELBR);
|
||||||
#endif
|
#endif
|
||||||
emit2($3.val);
|
emit2($3.val);
|
||||||
|
@ -129,6 +136,7 @@ operation
|
||||||
{ emit1or2($1);
|
{ emit1or2($1);
|
||||||
emit1(0x9F);
|
emit1(0x9F);
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo($3.typ, RELO2|RELBR);
|
newrelo($3.typ, RELO2|RELBR);
|
||||||
#endif
|
#endif
|
||||||
emit2($3.val);
|
emit2($3.val);
|
||||||
|
@ -158,6 +166,7 @@ operation
|
||||||
} else {
|
} else {
|
||||||
emit1or2($1 + 0x10);
|
emit1or2($1 + 0x10);
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo($2.typ, RELO2|RELBR);
|
newrelo($2.typ, RELO2|RELBR);
|
||||||
#endif
|
#endif
|
||||||
emit2($2.val);
|
emit2($2.val);
|
||||||
|
|
|
@ -35,6 +35,7 @@ expr_t exp;
|
||||||
emit1(opc);
|
emit1(opc);
|
||||||
if (sm == 0) {
|
if (sm == 0) {
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo(exp.typ, RELPC|RELO2|RELBR);
|
newrelo(exp.typ, RELPC|RELO2|RELBR);
|
||||||
#endif
|
#endif
|
||||||
emit2(dist);
|
emit2(dist);
|
||||||
|
@ -93,6 +94,7 @@ expr_t exp;
|
||||||
} else {
|
} else {
|
||||||
emit1(0x89 + reg + ind);
|
emit1(0x89 + reg + ind);
|
||||||
#ifdef RELOCATION
|
#ifdef RELOCATION
|
||||||
|
if (rflag != 0 && PASS_RELO)
|
||||||
newrelo(exp.typ, RELO2|RELBR);
|
newrelo(exp.typ, RELO2|RELBR);
|
||||||
#endif
|
#endif
|
||||||
emit2(exp.val);
|
emit2(exp.val);
|
||||||
|
|
Loading…
Reference in a new issue