1988-06-22 16:57:09 +00:00
|
|
|
/*
|
|
|
|
* Sources of the "LOAD" group instructions
|
|
|
|
*/
|
|
|
|
|
1994-06-24 11:31:16 +00:00
|
|
|
/* $Id$ */
|
1988-06-22 16:57:09 +00:00
|
|
|
|
|
|
|
#include <em_abs.h>
|
|
|
|
#include "global.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "mem.h"
|
|
|
|
#include "trap.h"
|
|
|
|
#include "text.h"
|
|
|
|
#include "fra.h"
|
|
|
|
#include "rsb.h"
|
|
|
|
#include "warn.h"
|
|
|
|
|
|
|
|
PRIVATE ptr lexback_LB();
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLOC(l)
|
|
|
|
register long l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LOC c: Load constant (i.e. push one word onto the stack) */
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLOC(%ld)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
1989-11-13 15:36:12 +00:00
|
|
|
wpush(arg_c(l));
|
1988-06-22 16:57:09 +00:00
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLDC(l)
|
|
|
|
register long l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LDC d: Load double constant ( push two words ) */
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLDC(%ld)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
1990-06-21 12:16:31 +00:00
|
|
|
l = arg_d(l);
|
1988-06-22 16:57:09 +00:00
|
|
|
npush(l, dwsize);
|
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLOL(l)
|
|
|
|
register long l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LOL l: Load word at l-th local (l<0) or parameter (l>=0) */
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLOL(%ld)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
l = arg_l(l);
|
1989-11-22 13:38:37 +00:00
|
|
|
pushw_st(loc_addr(l));
|
1988-06-22 16:57:09 +00:00
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLOE(arg)
|
|
|
|
register long arg;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LOE g: Load external word g */
|
1990-06-21 12:16:31 +00:00
|
|
|
register ptr p = i2p(arg);
|
1988-06-22 16:57:09 +00:00
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLOE(%lu)", p));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
1989-11-22 13:38:37 +00:00
|
|
|
pushw_m(arg_g(p));
|
1988-06-22 16:57:09 +00:00
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLIL(l)
|
|
|
|
register long l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LIL l: Load word pointed to by l-th local or parameter */
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLIL(%ld)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
l = arg_l(l);
|
1989-11-22 13:38:37 +00:00
|
|
|
pushw_m(st_lddp(loc_addr(l)));
|
1988-06-22 16:57:09 +00:00
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLOF(l)
|
|
|
|
register long l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LOF f: Load offsetted (top of stack + f yield address) */
|
|
|
|
register ptr p = dppop();
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLOF(%ld)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
1989-11-22 13:38:37 +00:00
|
|
|
pushw_m(p + arg_f(l));
|
1988-06-22 16:57:09 +00:00
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLAL(l)
|
|
|
|
register long l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LAL l: Load address of local or parameter */
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLAL(%ld)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
l = arg_l(l);
|
|
|
|
dppush(loc_addr(l));
|
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLAE(arg)
|
|
|
|
register unsigned long arg;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LAE g: Load address of external */
|
1990-06-21 12:16:31 +00:00
|
|
|
register ptr p = i2p(arg);
|
1988-06-22 16:57:09 +00:00
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLAE(%lu)", p));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
dppush(arg_lae(p));
|
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLXL(l)
|
|
|
|
register unsigned long l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LXL n: Load lexical (address of LB n static levels back) */
|
|
|
|
register ptr p;
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLXL(%lu)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
l = arg_n(l);
|
|
|
|
p = lexback_LB(l);
|
|
|
|
dppush(p);
|
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLXA(l)
|
|
|
|
register unsigned long l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LXA n: Load lexical (address of AB n static levels back) */
|
|
|
|
register ptr p;
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLXA(%lu)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
l = arg_n(l);
|
|
|
|
p = lexback_LB(l);
|
|
|
|
dppush(p + rsbsize);
|
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLOI(l)
|
|
|
|
register size l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LOI o: Load indirect o bytes (address is popped from the stack) */
|
|
|
|
register ptr p = dppop();
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLOI(%ld)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
1990-06-21 12:16:31 +00:00
|
|
|
l = arg_o(l);
|
1988-06-22 16:57:09 +00:00
|
|
|
push_m(p, l);
|
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLOS(l)
|
|
|
|
register size l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LOS w: Load indirect, w-byte integer on top of stack gives object size */
|
|
|
|
register ptr p;
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLOS(%ld)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
l = arg_wi(l);
|
|
|
|
l = upop(l);
|
|
|
|
p = dppop();
|
|
|
|
push_m(p, arg_o(l));
|
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLDL(l)
|
|
|
|
register long l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LDL l: Load double local or parameter (two consecutive words are stacked) */
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLDL(%ld)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
l = arg_l(l);
|
|
|
|
push_st(loc_addr(l), dwsize);
|
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLDE(arg)
|
|
|
|
register long arg;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LDE g: Load double external (two consecutive externals are stacked) */
|
1990-06-21 12:16:31 +00:00
|
|
|
register ptr p = i2p(arg);
|
1988-06-22 16:57:09 +00:00
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLDE(%lu)", p));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
push_m(arg_g(p), dwsize);
|
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLDF(l)
|
|
|
|
register long l;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LDF f: Load double offsetted (top of stack + f yield address) */
|
|
|
|
register ptr p = dppop();
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLDF(%ld)", l));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
push_m(p + arg_f(l), dwsize);
|
|
|
|
}
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
DoLPI(pi)
|
|
|
|
register long pi;
|
1988-06-22 16:57:09 +00:00
|
|
|
{
|
|
|
|
/* LPI p: Load procedure identifier */
|
|
|
|
|
1990-06-21 12:16:31 +00:00
|
|
|
LOG(("@L6 DoLPI(%ld)", pi));
|
1988-06-22 16:57:09 +00:00
|
|
|
spoilFRA();
|
|
|
|
npush(arg_p(pi), psize);
|
|
|
|
}
|
|
|
|
|
|
|
|
PRIVATE ptr lexback_LB(n)
|
|
|
|
unsigned long n;
|
|
|
|
{
|
|
|
|
/* LB n static levels back */
|
|
|
|
register ptr lb = LB;
|
|
|
|
|
|
|
|
while (n != 0) {
|
|
|
|
lb = st_lddp(lb + rsbsize);
|
|
|
|
n--;
|
|
|
|
}
|
|
|
|
return lb;
|
|
|
|
}
|
|
|
|
|