Example #1
0
File: a2_vm.c Project: eagles125/A2
// not 
static inline void _vm_not(struct a2_vm* vm_p){
	struct a2_obj* _d = callinfo_sfreg(curr_ci, ir_ga(curr_ir));
	struct a2_obj* _v = _getvalue(vm_p, ir_gbx(curr_ir));

	switch(obj_t(_v)){
		case A2_TNIL:
			*_d = a2_bool2obj(1);
			break;
		case A2_TBOOL:
			*_d = a2_bool2obj(!(obj_vX(_v, uinteger)));
			break;
		default:
			vm_error("the varable is not bool type.");
	}

	curr_pc++;
}
Example #2
0
A2_API inline void a2_pushbool(struct a2_state* state, int b){
	struct a2_obj obj = a2_bool2obj(b);
	a2_pushstack(state->env_p, &obj);
}