two new instructions: move and movep: basicly memmove. qfcc support coming

as soon as I get it working :)
This commit is contained in:
Bill Currie 2002-10-16 06:44:41 +00:00
parent 0c0e4b23de
commit be4b8096d4
3 changed files with 14 additions and 0 deletions

View File

@ -255,6 +255,9 @@ typedef enum {
OP_GE_P,
OP_LT_P,
OP_GT_P,
OP_MOVE,
OP_MOVEP,
} pr_opcode_e;
typedef struct opcode_s {

View File

@ -889,6 +889,14 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
OPC.integer_var = OPA.integer_var != OPB.integer_var;
break;
case OP_MOVE:
memmove (&OPC, &OPA, st->b);
break;
case OP_MOVEP:
memmove (pr->pr_globals + OPC.integer_var,
pr->pr_globals + OPA.integer_var, OPB.uinteger_var);
break;
// LordHavoc: to be enabled when Progs version 7 (or whatever it will be numbered) is finalized
/*
case OP_BOUNDCHECK:

View File

@ -247,6 +247,9 @@ opcode_t pr_opcodes[] = {
{"==", "eq.p", OP_EQ_P, false, ev_pointer, ev_pointer, ev_integer, PROG_VERSION},
{"!=", "ne.p", OP_NE_P, false, ev_pointer, ev_pointer, ev_integer, PROG_VERSION},
{"<MOVE>", "move", OP_MOVE, true, ev_struct, ev_short, ev_struct, PROG_VERSION},
{"<MOVE>", "movep", OP_MOVEP, true, ev_pointer, ev_integer, ev_pointer, PROG_VERSION},
// end of table
{0},
};