cc68a136 |
1 | \r |
2 | #include <stdio.h>\r |
3 | #include <stdarg.h>\r |
4 | #include <stdlib.h>\r |
5 | #include <string.h>\r |
6 | \r |
0e11c502 |
7 | #ifndef CONFIG_FILE\r |
8 | #define CONFIG_FILE "config.h"\r |
9 | #endif\r |
10 | #include CONFIG_FILE\r |
cc68a136 |
11 | \r |
12 | // Disa.c\r |
13 | #include "Disa/Disa.h"\r |
14 | \r |
15 | // Ea.cpp\r |
0e11c502 |
16 | extern int earead_check_addrerr;\r |
17 | extern int eawrite_check_addrerr;\r |
cc68a136 |
18 | extern int g_jmp_cycle_table[];\r |
19 | extern int g_jsr_cycle_table[];\r |
20 | extern int g_lea_cycle_table[];\r |
21 | extern int g_pea_cycle_table[];\r |
22 | extern int g_movem_cycle_table[];\r |
23 | int Ea_add_ns(int *tab, int ea); // add nonstandard EA cycles\r |
b637c56a |
24 | int EaCalc(int a,int mask,int ea,int size,int top=0,int sign_extend=1); // 6\r |
25 | int EaRead(int a,int v,int ea,int size,int mask,int top=0,int sign_extend=1); // 7\r |
85a36a57 |
26 | int EaCalcRead(int r_ea,int r,int ea,int size,int mask,int sign_extend=1); // 6\r |
27 | int EaCalcReadNoSE(int r_ea,int r,int ea,int size,int mask);\r |
cc68a136 |
28 | int EaCanRead(int ea,int size);\r |
b637c56a |
29 | int EaWrite(int a,int v,int ea,int size,int mask,int top=0,int sign_extend_ea=1);\r |
cc68a136 |
30 | int EaCanWrite(int ea);\r |
31 | int EaAn(int ea);\r |
32 | \r |
33 | // Main.cpp\r |
cfb3dfa0 |
34 | extern int *CyJump; // Jump table\r |
35 | extern int ms; // If non-zero, output in Microsoft ARMASM format\r |
cc68a136 |
36 | extern char *Narm[4]; // Normal ARM Extensions for operand sizes 0,1,2\r |
37 | extern char *Sarm[4]; // Sign-extend ARM Extensions for operand sizes 0,1,2\r |
cfb3dfa0 |
38 | extern int Cycles; // Current cycles for opcode\r |
39 | extern int pc_dirty; // something changed PC during processing\r |
ee5e024c |
40 | extern int arm_op_count; // for stats\r |
cc68a136 |
41 | void ot(const char *format, ...);\r |
42 | void ltorg();\r |
0e11c502 |
43 | int MemHandler(int type,int size,int addrreg=0,int need_addrerr_check=1);\r |
cfb3dfa0 |
44 | void FlushPC(void);\r |
cc68a136 |
45 | \r |
46 | // OpAny.cpp\r |
85a36a57 |
47 | extern int g_op;\r |
0e11c502 |
48 | extern int opend_op_changes_cycles, opend_check_interrupt, opend_check_trace;\r |
cc68a136 |
49 | int OpGetFlags(int subtract,int xbit,int sprecialz=0);\r |
50 | void OpUse(int op,int use);\r |
ee5e024c |
51 | void OpStart(int op,int sea=0,int tea=0,int op_changes_cycles=0,int supervisor_check=0);\r |
0e11c502 |
52 | void OpEnd(int sea=0,int tea=0);\r |
85a36a57 |
53 | int OpBase(int op,int size,int sepa=0);\r |
cc68a136 |
54 | void OpAny(int op);\r |
55 | \r |
56 | //----------------------\r |
57 | // OpArith.cpp\r |
58 | int OpArith(int op);\r |
59 | int OpLea(int op);\r |
60 | int OpAddq(int op);\r |
61 | int OpArithReg(int op);\r |
62 | int OpMul(int op);\r |
63 | int OpAbcd(int op);\r |
64 | int OpNbcd(int op);\r |
65 | int OpAritha(int op);\r |
66 | int OpAddx(int op);\r |
67 | int OpCmpEor(int op);\r |
68 | int OpCmpm(int op);\r |
69 | int OpChk(int op);\r |
70 | int GetXBit(int subtract);\r |
71 | \r |
72 | // OpBranch.cpp\r |
73 | void OpPush32();\r |
74 | void OpPushSr(int high);\r |
75 | int OpTrap(int op);\r |
76 | int OpLink(int op);\r |
77 | int OpUnlk(int op);\r |
78 | int Op4E70(int op);\r |
79 | int OpJsr(int op);\r |
80 | int OpBranch(int op);\r |
81 | int OpDbra(int op);\r |
82 | \r |
83 | // OpLogic.cpp\r |
84 | int OpBtstReg(int op);\r |
85 | int OpBtstImm(int op);\r |
86 | int OpNeg(int op);\r |
87 | int OpSwap(int op);\r |
88 | int OpTst(int op);\r |
89 | int OpExt(int op);\r |
90 | int OpSet(int op);\r |
91 | int OpAsr(int op);\r |
92 | int OpAsrEa(int op);\r |
c008977e |
93 | int OpTas(int op, int gen_special=0);\r |
cc68a136 |
94 | \r |
95 | // OpMove.cpp\r |
96 | int OpMove(int op);\r |
97 | int OpLea(int op);\r |
98 | void OpFlagsToReg(int high);\r |
0e11c502 |
99 | void OpRegToFlags(int high,int srh_reg=0);\r |
cc68a136 |
100 | int OpMoveSr(int op);\r |
101 | int OpArithSr(int op);\r |
102 | int OpPea(int op);\r |
103 | int OpMovem(int op);\r |
104 | int OpMoveq(int op);\r |
105 | int OpMoveUsp(int op);\r |
106 | int OpExg(int op);\r |
85a36a57 |
107 | int OpMovep(int op);\r |
cc68a136 |
108 | int OpStopReset(int op);\r |
85a36a57 |
109 | void SuperEnd(void);\r |
0e11c502 |
110 | void SuperChange(int op,int srh_reg=-1);\r |
85a36a57 |
111 | \r |