1 /* ASSEMBLING FUNCTIONS */ 2 3 #ifndef __EXEC_H 4 #define __EXEC_H 5 6 extern int c_adc_sbc(int first,int type,int second,int offset,int d); 7 /* adc and sbc instructions */ 8 /* offset: code of adc(sbc) A,B */ 9 /* d: x in adc(sbc) HL,.. ED 4x */ 10 /* return value: 0=OK, 1=invalid argument, 2=value out of range,3 offset out of r. */ 11 12 13 extern int c_add(int first,int type,int second); 14 /* return value: 0=OK, 1=invalid argument, 2=value out of range,3=offset out of range */ 15 16 17 extern int c_logical(int type,int value,int offset); 18 /* logical instructions: and,or,xor and instructions cp,sub */ 19 /* offset: code of and(or,....) B */ 20 /* return value: 0=OK, 1=invalid argument, 2=value out of range */ 21 22 23 extern int c_ex(int t1,int v1,int v2); 24 25 26 extern void c_im(int v); 27 28 29 extern int c_in(int v1,int t2,int v2); 30 /* return value: 0=OK, 1=invalid argument, 2=value out of range */ 31 32 33 extern int c_inc_dec(int type,int value,int offs1,int offs2); 34 /* instructions inc and dec */ 35 /* offs1: code of inc(dec) B */ 36 /* offs2: code of inc(dec) BC */ 37 /* return value: 0=OK, 1=invalid argument, 2=value out of range */ 38 39 40 extern int c_out(int t1,int v1,int v2); 41 /* return value: 0=OK, 1=invalid argument, 2=value out of range */ 42 43 44 extern int c_push_pop(int v,int offset); 45 /* instructions for push & pop */ 46 /* offset: x in push(pop) AF 0xfx */ 47 48 49 extern int c_ret(int value); 50 51 52 extern int c_rst(int value); 53 54 55 extern int c_bit(int b,int type,int value,int offset); 56 /* bit operations: set,res,bit */ 57 /* offset: code of set(res,bit) x,B */ 58 /* return value: 0=OK, 1=invalid argument, 2=value out of range */ 59 60 61 extern int c_shift_rot(int type,int value,int offset); 62 /* shift and rotation instructions */ 63 /* rr,rl,rrc,rlc,sla,sra,srl,sll */ 64 /* offset: code of rr(rl,...) B */ 65 /* return value: 0=OK, 1=invalid argument, 2=value out of range */ 66 67 68 extern int c_jp(int t1,int v1,int t2,int v2); 69 70 71 extern int c_call(int t1,int v1,int t2,int v2); 72 73 74 extern int c_djnz(int t1,int v1); 75 /* return value: 0=OK, 1=invalid argument, 2=value out of range */ 76 77 78 extern int c_jr(int t1,int v1,int t2,int v2); 79 /* return value: 0=OK, 1=invalid argument, 2=value out of range */ 80 81 82 extern int c_ld(int t1,int v1,int t2,int v2); 83 84 #endif 85