ack/util/int/do_store.c

105 lines
1.8 KiB
C
Raw Normal View History

2019-03-17 14:42:00 +00:00
/** @file
* Sources of the "STORE" group instructions
1988-06-22 16:57:09 +00:00
*/
1994-06-24 11:31:16 +00:00
/* $Id$ */
1988-06-22 16:57:09 +00:00
2019-03-17 14:42:00 +00:00
#include "em_abs.h"
1988-06-22 16:57:09 +00:00
#include "global.h"
#include "log.h"
#include "mem.h"
#include "trap.h"
#include "text.h"
#include "fra.h"
#include "warn.h"
2019-03-17 14:42:00 +00:00
/** STL l: Store local or parameter */
void DoSTL(register long l)
1988-06-22 16:57:09 +00:00
{
LOG(("@S6 DoSTL(%ld)", l));
1988-06-22 16:57:09 +00:00
spoilFRA();
l = arg_l(l);
1989-11-22 13:38:37 +00:00
popw_st(loc_addr(l));
1988-06-22 16:57:09 +00:00
}
2019-03-17 14:42:00 +00:00
/** STE g: Store external */
void DoSTE(register unsigned long arg)
1988-06-22 16:57:09 +00:00
{
register ptr p = i2p(arg);
1988-06-22 16:57:09 +00:00
LOG(("@S6 DoSTE(%lu)", p));
1988-06-22 16:57:09 +00:00
spoilFRA();
1989-11-22 13:38:37 +00:00
popw_m(arg_g(p));
1988-06-22 16:57:09 +00:00
}
2019-03-17 14:42:00 +00:00
/** SIL l: Store into word pointed to by l-th local or parameter */
void DoSIL(register long l)
1988-06-22 16:57:09 +00:00
{
LOG(("@S6 DoSIL(%ld)", l));
1988-06-22 16:57:09 +00:00
spoilFRA();
l = arg_l(l);
1989-11-22 13:38:37 +00:00
popw_m(st_lddp(loc_addr(l)));
1988-06-22 16:57:09 +00:00
}
2019-03-17 14:42:00 +00:00
/** STF f: Store offsetted */
void DoSTF(register long l)
1988-06-22 16:57:09 +00:00
{
register ptr p = dppop();
LOG(("@S6 DoSTF(%ld)", l));
1988-06-22 16:57:09 +00:00
spoilFRA();
1989-11-22 13:38:37 +00:00
popw_m(p + arg_f(l));
1988-06-22 16:57:09 +00:00
}
2019-03-17 14:42:00 +00:00
/** STI o: Store indirect o bytes (pop address, then data) */
void DoSTI(register size l)
1988-06-22 16:57:09 +00:00
{
register ptr p = dppop();
LOG(("@S6 DoSTI(%ld)", l));
1988-06-22 16:57:09 +00:00
spoilFRA();
pop_m(p, arg_o(l));
}
2019-03-17 14:42:00 +00:00
/** STS w: Store indirect, w-byte integer on top of stack gives object size */
void DoSTS(register size l)
1988-06-22 16:57:09 +00:00
{
register ptr p;
LOG(("@S6 DoSTS(%ld)", l));
1988-06-22 16:57:09 +00:00
spoilFRA();
l = upop(arg_wi(l));
p = dppop();
pop_m(p, arg_o(l));
}
2019-03-17 14:42:00 +00:00
/** SDL l: Store double local or parameter */
void DoSDL(register long l)
1988-06-22 16:57:09 +00:00
{
LOG(("@S6 DoSDL(%ld)", l));
1988-06-22 16:57:09 +00:00
spoilFRA();
l = arg_l(l);
pop_st(loc_addr(l), dwsize);
}
2019-03-17 14:42:00 +00:00
/** SDE g: Store double external */
void DoSDE(register unsigned long arg)
1988-06-22 16:57:09 +00:00
{
register ptr p = i2p(arg);
1988-06-22 16:57:09 +00:00
LOG(("@S6 DoSDE(%lu)", p));
1988-06-22 16:57:09 +00:00
spoilFRA();
pop_m(arg_g(p), dwsize);
}
2019-03-17 14:42:00 +00:00
/** SDF f: Store double offsetted */
void DoSDF(register long l)
1988-06-22 16:57:09 +00:00
{
register ptr p = dppop();
LOG(("@S6 DoSDF(%ld)", l));
1988-06-22 16:57:09 +00:00
spoilFRA();
pop_m(p + arg_f(l), dwsize);
}