Example #1
0
void execute_tablesetelem(instruction* instr){
	//printf("exec_tableset\n");
	avm_memcell* t = avm_translate_operand(&instr->arg1,(avm_memcell*) 0);
	avm_memcell* i = avm_translate_operand(&instr->arg2,&ax);
	avm_memcell* c = avm_translate_operand(&instr->result,&bx);
	assert(t && &stack[AVM_STACKSIZE-1] >= t && t > &stack[top]);
	assert(i && c);
	if(t->type != table_m)
		avm_error("illigal use of type as table!");
	else
		avm_tablesetelem(t->data.tableVal, i, c);
}
Example #2
0
void execute_tablesetelem (instruction* instr){
	avm_memcell* t = avm_translate_operand(&instr->result, (avm_memcell*) 0);
	avm_memcell* i = avm_translate_operand(&instr->arg1, &ax);
	avm_memcell* c = avm_translate_operand(&instr->arg2, &bx);

//	assert(t && &stack[N-1] >= t && t > &stack[top]);
	assert(i && c);

	if(t->type != table_m)
		{
		avm_error("illegal use of type %s as table!\n", typeStrings[t->type]);
		executionFinished = 1;
		}
	else
		{
		avm_tablesetelem(t->data.tableVal, i, c);
		}
}