comparison opcodes.h @ 16:a2a81589380d default tip

Reformat the whole source via clang-format for better consistency.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 14 Oct 2021 01:53:20 +0300
parents 89183953bddc
children
comparison
equal deleted inserted replaced
15:89183953bddc 16:a2a81589380d
84 accu=0, imm, abso, zp, zpx, zpy, absx, absy, 84 accu=0, imm, abso, zp, zpx, zpy, absx, absy,
85 iabsx, impl, rel, zrel, indx, indy, iabs, ind 85 iabsx, impl, rel, zrel, indx, indy, iabs, ind
86 }; 86 };
87 87
88 #ifdef _DUMP_C_ 88 #ifdef _DUMP_C_
89 static char *prefix[] = { "", "#", "", "", "", "", "", "", 89 static char *prefix[] = {"", "#", "", "", "", "", "", "", "(", "", "", "", "(", "(", "(", "("};
90 "(", "", "", "", "(", "(", "(", "(" };
91 90
92 /* static char *postfix[] = { " A", "", "", "", ",X", ",Y", ",X", ",Y", */ 91 /* static char *postfix[] = { " A", "", "", "", ",X", ",Y", ",X", ",Y", */
93 static char *postfix[] = { "", "", "", "", ",x", ",y", ",x", ",y", 92 static char *postfix[] = {"", "", "", "", ",x", ",y", ",x", ",y", ",x)", "", "", "", ",x)", "),y", ")", ")"};
94 ",x)", "", "", "", ",x)", "),y", ")", ")" };
95 #endif /* _DUMP_C_ */ 93 #endif /* _DUMP_C_ */
96 94
97 /* Adressing mode types. */ 95 /* Adressing mode types. */
98 enum 96 enum
99 { 97 {
100 absindir, /* absolute parameter (8 or 16 bits) for indirection */ 98 absindir, /* absolute parameter (8 or 16 bits) for indirection */
101 absolute, /* absolute parameter (8 or 16 bits), not indexed */ 99 absolute, /* absolute parameter (8 or 16 bits), not indexed */
102 other, /* something else (except impimm) */ 100 other, /* something else (except impimm) */
103 impimm /* implied or immediate parameter */ 101 impimm /* implied or immediate parameter */
104 }; 102 };
105 103
106 #ifndef _SCAN_C_ 104 #ifndef _SCAN_C_
107 extern unsigned int types[]; 105 extern unsigned int types[];
108 #else 106 #else
113 111
114 /* Number of bytes that instructions of different addressing modes occupy */ 112 /* Number of bytes that instructions of different addressing modes occupy */
115 #ifndef _SCAN_C_ 113 #ifndef _SCAN_C_
116 extern unsigned int sizes[]; 114 extern unsigned int sizes[];
117 #else 115 #else
118 unsigned int sizes[] = { 1, 2, 3, 2, 2, 2, 3, 3, 3, 1, 2, 3, 2, 2, 3, 2 }; 116 unsigned int sizes[] = {1, 2, 3, 2, 2, 2, 3, 3, 3, 1, 2, 3, 2, 2, 3, 2};
119 #endif 117 #endif
120 118
121 typedef struct opcodes 119 typedef struct opcodes
122 { 120 {
123 int mnemonic; /* index to mnemonic instruction name table */ 121 int mnemonic; /* index to mnemonic instruction name table */
124 int admode; /* addressing mode */ 122 int admode; /* addressing mode */
125 } opcodes; 123 } opcodes;
126 124
127 #ifndef _MAIN_C_ 125 #ifndef _MAIN_C_
128 extern 126 extern
129 #endif 127 #endif