1
0
mirror of https://github.com/golang/go synced 2024-11-25 20:27:57 -07:00

accept CALL $(constant) to call absolute PC

R=ken
OCL=34845
CL=34845
This commit is contained in:
Russ Cox 2009-09-21 09:41:21 -07:00
parent 11e313ae72
commit de0d762a0f
4 changed files with 14 additions and 2 deletions

View File

@ -285,6 +285,7 @@ rom:
} }
| reg | reg
| omem | omem
| imm
rim: rim:
rem rem

View File

@ -193,6 +193,7 @@ enum
Z_rp, Z_rp,
Zbr, Zbr,
Zcall, Zcall,
Zcallcon,
Zib_, Zib_,
Zib_rp, Zib_rp,
Zibo_m, Zibo_m,

View File

@ -260,7 +260,8 @@ uchar yloop[] =
uchar ycall[] = uchar ycall[] =
{ {
Ynone, Yml, Zo_m, 2, Ynone, Yml, Zo_m, 2,
Ynone, Ybr, Zcall, 1, Ynone, Ybr, Zcall, 0,
Ynone, Yi32, Zcallcon, 1,
0 0
}; };
uchar yjmp[] = uchar yjmp[] =

View File

@ -1109,6 +1109,15 @@ found:
} }
break; break;
case Zcallcon:
v = p->to.offset - p->pc - 5;
*andptr++ = op;
*andptr++ = v;
*andptr++ = v>>8;
*andptr++ = v>>16;
*andptr++ = v>>24;
break;
case Zjmp: case Zjmp:
q = p->pcond; q = p->pcond;
if(q) { if(q) {