Add a movepi instruction to support indirect moves of fixed size.

This commit is contained in:
Bill Currie 2011-03-09 10:29:24 +09:00
parent 18005cc80d
commit 90de6b0499
3 changed files with 15 additions and 0 deletions

View file

@ -257,6 +257,7 @@ typedef enum {
OP_MOVEI,
OP_MOVEP,
OP_MOVEPI,
OP_SHL_U,
OP_SHR_U,

View file

@ -1055,6 +1055,15 @@ op_call:
pr->pr_globals + OPA.integer_var,
OPB.uinteger_var * 4);
break;
case OP_MOVEPI:
if (pr_boundscheck->int_val) {
PR_BoundsCheckSize (pr, OPC.integer_var, st->b);
PR_BoundsCheckSize (pr, OPA.integer_var, st->b);
}
memmove (pr->pr_globals + OPC.integer_var,
pr->pr_globals + OPA.integer_var,
st->b * 4);
break;
// LordHavoc: to be enabled when Progs version 7 (or whatever it will be numbered) is finalized
/*

View file

@ -1030,6 +1030,11 @@ VISIBLE opcode_t pr_opcodes[] = {
PROG_VERSION,
"%Ga, %Gb, %Gc",
},
{"<MOVEP>", "movepi", OP_MOVEPI, true,
ev_pointer, ev_short, ev_pointer,
PROG_VERSION,
"%Ga, %Gb, %Gc",
},
// end of table
{0},