static gpasmVal do_bdc(gpasmVal r, const char *name, int arity, struct pnode *parms) { do_insn("btfsc", make_constant_list(3, 1)); do_insn("goto", parms); return r; }
static gpasmVal do_subcf(gpasmVal r, const char *name, int arity, struct pnode *parms) { do_insn("btfsc", make_constant_list(3, 0)); do_insn("decf", parms); return r; }
static gpasmVal do_lgoto(gpasmVal r, const char *name, int arity, struct pnode *parms) { do_insn("pagesel", parms); do_insn("goto", parms); return r; }
static gpasmVal do_adddcf(gpasmVal r, char *name, int arity, struct pnode *parms) { do_insn("btfsc", make_constant_list(3, 1)); do_insn("incf", parms); return r; }
static gpasmVal do_negf(gpasmVal r, char *name, int arity, struct pnode *parms) { do_insn("comf", add_symbol_constant(parms, 1)); do_insn("incf", parms); return r; }
static gpasmVal do_lcall(gpasmVal r, char *name, int arity, struct pnode *parms) { do_insn("pagesel", parms); do_insn("call", parms); return r; }
static gpasmVal do_addcf(gpasmVal r, const char *name, int arity, struct pnode *parms) { gpvmessage(GPM_SPECIAL_MNEMONIC, NULL); do_insn("btfsc", make_constant_list(3, 0)); do_insn("incf", parms); return r; }
static gpasmVal do_negf(gpasmVal r, const char *name, int arity, struct pnode *parms) { if ((arity == 1) || (arity == 2)) { do_insn("comf", add_symbol_constant(parms, 1)); do_insn("incf", parms); } else { enforce_arity(arity, 2); } return r; }
static gpasmVal do_mode(gpasmVal r, const char *name, int arity, struct pnode *parms) { if (enforce_arity(arity, 1)) { struct pnode* val = HEAD(parms); if ((val->tag == PTAG_CONSTANT) && (val->value.constant > 0x1f)) { gpvwarning(GPW_RANGE, NULL); val->value.constant &= 0x1f; } do_insn("movlw", parms); do_insn("movwm", NULL); } return r; }
static gpasmVal do_b(gpasmVal r, char *name, int arity, struct pnode *parms) { do_insn("goto", parms); return r; }
static gpasmVal do_tstf(gpasmVal r, char *name, int arity, struct pnode *parms) { do_insn("movf", add_symbol_constant(parms, 1)); return r; }
static gpasmVal do_movfw(gpasmVal r, const char *name, int arity, struct pnode *parms) { if (enforce_arity(arity, 1)) { do_insn("movf", add_symbol_constant(parms, 0)); } return r; }
static gpasmVal do_skpnz(gpasmVal r, const char *name, int arity, struct pnode *parms) { if (arity) { gpverror(GPE_TOO_MANY_ARGU, NULL); } do_insn("btfsc", make_constant_list(3, 2)); return r; }
static gpasmVal do_setdc(gpasmVal r, char *name, int arity, struct pnode *parms) { if (arity) { gperror(GPE_TOO_MANY_ARGU, NULL); } do_insn("bsf", make_constant_list(3, 1)); return r; }
static gpasmVal do_lgoto(gpasmVal r, char *name, int arity, struct pnode *parms) { int address = maybe_evaluate(HEAD(parms)); int page = gp_processor_check_page(state.device.class, address); state.org += gp_processor_set_page(state.device.class, page, state.i_memory, state.org); do_insn("goto", parms); return r; }