1
0
mirror of https://github.com/golang/go synced 2024-11-25 15:08:02 -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
| omem
| imm
rim:
rem

View File

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

View File

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

View File

@ -105,7 +105,7 @@ start:
textsize = c;
n++;
}while(again);
if(INITRND) {
INITDAT = rnd(c, INITRND);
if(INITDAT != idat) {
@ -1109,6 +1109,15 @@ found:
}
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:
q = p->pcond;
if(q) {