1 /**************************************************************************** 2 * 3 * Description: table of directives 4 * 5 ****************************************************************************/ 6 7 /* v1.96: items needn't be sorted anymore! 8 * The items are stored in structures of type special_item. 9 * If an item is inserted, moved or deleted, the project needs 10 * a full rebuild. 11 */ 12 13 /* directives field usage: 14 * value = DF_ flags SpecialTable.value unsigned 15 * bytval = DRT_ value SpecialTable.bytval uint_8 16 * flags = RWF_ flags ResWordTable.flags uint_8 17 * cpu = cpu flags SpecialTable.cpu uint_16 18 * sflags = dep. on DRT_ SpecialTable.sflags unsigned 19 */ 20 21 /* cpu directives */ 22 23 /* token str value bytval flags cpu sflags */ 24 res(DOT_8086, .8086, 0, DRT_CPU, 0, P_86, P_86 ) 25 res(DOT_186, .186, 0, DRT_CPU, 0, P_86, P_186 ) 26 res(DOT_286, .286, 0, DRT_CPU, 0, P_86, P_286 ) 27 res(DOT_286C, .286c, 0, DRT_CPU, 0, P_86, P_286 ) 28 res(DOT_286P, .286p, 0, DRT_CPU, 0, P_86, P_286p ) 29 res(DOT_386, .386, 0, DRT_CPU, 0, P_86, P_386 ) 30 res(DOT_386C, .386c, 0, DRT_CPU, 0, P_86, P_386 ) 31 res(DOT_386P, .386p, 0, DRT_CPU, 0, P_86, P_386p ) 32 res(DOT_486, .486, 0, DRT_CPU, 0, P_86, P_486 ) 33 res(DOT_486P, .486p, 0, DRT_CPU, 0, P_86, P_486p ) 34 res(DOT_586, .586, 0, DRT_CPU, 0, P_86, P_586 ) 35 res(DOT_586P, .586p, 0, DRT_CPU, 0, P_86, P_586p ) 36 res(DOT_686, .686, 0, DRT_CPU, 0, P_86, P_686 ) 37 res(DOT_686P, .686p, 0, DRT_CPU, 0, P_86, P_686p ) 38 res(DOT_K3D, .k3d, 0, DRT_CPU, 0, P_586, P_K3D|P_MMX ) 39 res(DOT_MMX, .mmx, 0, DRT_CPU, 0, P_586, P_MMX ) 40 res(DOT_XMM, .xmm, 0, DRT_CPU, 0, P_686, P_MMX|P_SSEALL ) 41 #if AMD64_SUPPORT 42 res(DOT_X64, .x64, 0, DRT_CPU, 0, P_86, P_64 ) 43 res(DOT_X64P, .x64p, 0, DRT_CPU, 0, P_86, P_64p ) 44 #endif 45 46 res(DOT_8087, .8087, 0, DRT_CPU, 0, P_86, P_87 ) 47 res(DOT_287, .287, 0, DRT_CPU, 0, P_86, P_287 ) 48 res(DOT_387, .387, 0, DRT_CPU, 0, P_86, P_387 ) 49 res(DOT_NO87, .no87, 0, DRT_CPU, 0, P_86, P_NO87 ) 50 51 /* listing directives */ 52 /* .LFCOND is synonym for .LISTIF 53 * .SFCOND is synonym for .NOLISTIF 54 * .TFCOND toggles .LFCOND, .SFCOND 55 */ 56 57 res(DOT_CREF, .cref, 0, DRT_LISTING, 0, P_86, 0) 58 res(DOT_LFCOND, .lfcond, 0, DRT_LISTING, 0, P_86, 0) 59 res(DOT_LIST, .list, 0, DRT_LISTING, 0, P_86, 0) 60 res(DOT_LISTALL, .listall, 0, DRT_LISTING, 0, P_86, 0) 61 res(DOT_LISTIF, .listif, 0, DRT_LISTING, 0, P_86, 0) 62 res(DOT_NOCREF, .nocref, DF_NOEXPAND, DRT_LISTING, 0, P_86, 0) 63 res(DOT_NOLIST, .nolist, 0, DRT_LISTING, 0, P_86, 0) 64 res(DOT_NOLISTIF, .nolistif, 0, DRT_LISTING, 0, P_86, 0) 65 res(DOT_SFCOND, .sfcond, 0, DRT_LISTING, 0, P_86, 0) 66 res(DOT_TFCOND, .tfcond, 0, DRT_LISTING, 0, P_86, 0) 67 res(DOT_XCREF, .xcref, DF_NOEXPAND, DRT_LISTING, 0, P_86, 0) 68 res(DOT_XLIST, .xlist, 0, DRT_LISTING, 0, P_86, 0) 69 res(PAGE, page, 0, DRT_LISTING, 0, P_86, 0) 70 res(SUBTITLE, subtitle, 0, DRT_LISTING, 0, P_86, 0) 71 res(SUBTTL, subttl, 0, DRT_LISTING, 0, P_86, 0) 72 res(TITLE, title, 0, DRT_LISTING, 0, P_86, 0) 73 74 /* list macro directives 75 * .XALL is synonym for .LISTMACRO 76 * .LALL is synonym for .LISTMACROALL 77 * .SALL is synonym for .NOLISTMACRO 78 */ 79 res(DOT_LISTMACRO, .listmacro, 0, DRT_LISTMAC, 0, P_86, LM_LISTMACRO) 80 res(DOT_LISTMACROALL, .listmacroall, 0, DRT_LISTMAC, 0, P_86, LM_LISTMACROALL) 81 res(DOT_NOLISTMACRO, .nolistmacro, 0, DRT_LISTMAC, 0, P_86, LM_NOLISTMACRO) 82 res(DOT_XALL, .xall, 0, DRT_LISTMAC, 0, P_86, LM_LISTMACRO) 83 res(DOT_LALL, .lall, 0, DRT_LISTMAC, 0, P_86, LM_LISTMACROALL) 84 res(DOT_SALL, .sall, 0, DRT_LISTMAC, 0, P_86, LM_NOLISTMACRO) 85 86 87 res(DOT_ALPHA, .alpha, 0, DRT_SEGORDER, 0, P_86, SEGORDER_ALPHA ) 88 res(DOT_DOSSEG, .dosseg, 0, DRT_SEGORDER, 0, P_86, SEGORDER_DOSSEG) 89 res(DOT_SEQ, .seq, 0, DRT_SEGORDER, 0, P_86, SEGORDER_SEQ ) 90 res(DOSSEG, dosseg, 0, DRT_SEGORDER, 0, P_86, SEGORDER_DOSSEG) 91 92 /* simplified segment directives, numbers in sflags must match enum sim_seg (simseg.c) */ 93 res(DOT_CODE, .code, DF_NOSTRUC|DF_PROC|DF_CGEN, DRT_SIMSEG, 0, P_86, 0) 94 res(DOT_STACK, .stack, DF_NOSTRUC|DF_PROC|DF_CGEN, DRT_SIMSEG, 0, P_86, 1) 95 res(DOT_DATA, .data, DF_NOSTRUC|DF_PROC|DF_CGEN, DRT_SIMSEG, 0, P_86, 2) 96 res(DOT_DATA_UN, .data?, DF_NOSTRUC|DF_PROC|DF_CGEN, DRT_SIMSEG, 0, P_86, 3) 97 res(DOT_FARDATA, .fardata, DF_NOSTRUC|DF_PROC|DF_CGEN, DRT_SIMSEG, 0, P_86, 4) 98 res(DOT_FARDATA_UN, .fardata?, DF_NOSTRUC|DF_PROC|DF_CGEN, DRT_SIMSEG, 0, P_86, 5) 99 res(DOT_CONST, .const, DF_NOSTRUC|DF_PROC|DF_CGEN, DRT_SIMSEG, 0, P_86, 6) 100 101 /* hll directives */ 102 103 res(DOT_IF, .if, DF_CGEN|DF_CEXPR|DF_NOSTRUC|DF_STORE|DF_PROC, DRT_HLLSTART, 0, P_86, 0) 104 res(DOT_REPEAT, .repeat, DF_CGEN|DF_NOSTRUC|DF_STORE|DF_PROC, DRT_HLLSTART, 0, P_86, 0) 105 res(DOT_WHILE, .while, DF_CGEN|DF_CEXPR|DF_NOSTRUC|DF_STORE|DF_PROC, DRT_HLLSTART, 0, P_86, 0) 106 res(DOT_BREAK, .break, DF_CGEN, DRT_HLLEXIT, 0, P_86, 0) 107 res(DOT_CONTINUE, .continue, DF_CGEN, DRT_HLLEXIT, 0, P_86, 0) 108 res(DOT_ELSE, .else, DF_CGEN, DRT_HLLEXIT, 0, P_86, 0) 109 res(DOT_ELSEIF, .elseif, DF_CGEN|DF_CEXPR, DRT_HLLEXIT, 0, P_86, 0) 110 res(DOT_ENDIF, .endif, DF_CGEN, DRT_HLLEND, 0, P_86, 0) 111 res(DOT_ENDW, .endw, DF_CGEN, DRT_HLLEND, 0, P_86, 0) 112 res(DOT_UNTIL, .until, DF_CGEN|DF_CEXPR, DRT_HLLEND, 0, P_86, 0) 113 res(DOT_UNTILCXZ, .untilcxz, DF_CGEN|DF_CEXPR, DRT_HLLEND, 0, P_86, 0) 114 115 res(DOT_EXIT, .exit, DF_CGEN|DF_STORE, DRT_STARTEXIT, 0, P_86, 0) 116 res(DOT_STARTUP, .startup, DF_CGEN|DF_STORE, DRT_STARTEXIT, 0, P_86, 0) 117 118 res(DOT_MODEL, .model, DF_CGEN, DRT_MODEL, 0, P_86, 0) 119 res(DOT_RADIX, .radix, 0, DRT_RADIX, 0, P_86, 0) 120 121 /* directives invalid for IA32+ */ 122 123 #if COFF_SUPPORT 124 res(DOT_SAFESEH, .safeseh, 0, DRT_SAFESEH, RWF_IA32, P_386, 0) 125 #endif 126 127 /* error directives */ 128 129 res(DOT_ERR, .err, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, 0) 130 res(DOT_ERR1, .err1, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, CC_PASS1 ) 131 res(DOT_ERR2, .err2, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, CC_PASS2 ) 132 res(DOT_ERRE, .erre, DF_STORE, DRT_ERRDIR, 0, P_86, CC_NUMARG) 133 res(DOT_ERRNZ, .errnz, DF_STORE, DRT_ERRDIR, 0, P_86, CC_NUMARG) 134 res(DOT_ERRDIF, .errdif, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, CC_LITARG) 135 res(DOT_ERRDIFI, .errdifi, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, CC_LITARG) 136 res(DOT_ERRIDN, .erridn, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, CC_LITARG) 137 res(DOT_ERRIDNI, .erridni, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, CC_LITARG) 138 res(DOT_ERRB, .errb, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, CC_BLKARG) 139 res(DOT_ERRNB, .errnb, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, CC_BLKARG) 140 res(DOT_ERRDEF, .errdef, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, CC_SYMARG) 141 res(DOT_ERRNDEF, .errndef, DF_STRPARM|DF_STORE, DRT_ERRDIR, 0, P_86, CC_SYMARG) 142 143 /* conditional assembly directives, handled by preprocessor */ 144 145 /* token str value bytval flgs cpu sflags */ 146 res(COMMENT, comment, 0, DRT_CONDDIR, 0, P_86, 0) 147 res(IF, if, 0, DRT_CONDDIR, 0, P_86, CC_NUMARG) 148 res(IFE, ife, 0, DRT_CONDDIR, 0, P_86, CC_NUMARG) 149 res(IF1, if1, 0, DRT_CONDDIR, 0, P_86, CC_PASS1 ) 150 res(IF2, if2, 0, DRT_CONDDIR, 0, P_86, CC_PASS2 ) 151 res(IFDIF, ifdif, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_LITARG) 152 res(IFDIFI, ifdifi, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_LITARG) 153 res(IFIDN, ifidn, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_LITARG) 154 res(IFIDNI, ifidni, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_LITARG) 155 res(IFB, ifb, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_BLKARG) 156 res(IFNB, ifnb, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_BLKARG) 157 res(IFDEF, ifdef, DF_NOEXPAND, DRT_CONDDIR, 0, P_86, CC_SYMARG) 158 res(IFNDEF, ifndef, DF_NOEXPAND, DRT_CONDDIR, 0, P_86, CC_SYMARG) 159 res(ELSE, else, 0, DRT_CONDDIR, 0, P_86, 0) 160 res(ELSEIF, elseif, 0, DRT_CONDDIR, 0, P_86, CC_NUMARG) 161 res(ELSEIFE, elseife, 0, DRT_CONDDIR, 0, P_86, CC_NUMARG) 162 res(ELSEIF1, elseif1, 0, DRT_CONDDIR, 0, P_86, CC_PASS1 ) 163 res(ELSEIF2, elseif2, 0, DRT_CONDDIR, 0, P_86, CC_PASS2 ) 164 res(ELSEIFDIF, elseifdif, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_LITARG) 165 res(ELSEIFDIFI, elseifdifi, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_LITARG) 166 res(ELSEIFIDN, elseifidn, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_LITARG) 167 res(ELSEIFIDNI, elseifidni, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_LITARG) 168 res(ELSEIFB, elseifb, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_BLKARG) 169 res(ELSEIFNB, elseifnb, DF_STRPARM, DRT_CONDDIR, 0, P_86, CC_BLKARG) 170 res(ELSEIFDEF, elseifdef, DF_NOEXPAND, DRT_CONDDIR, 0, P_86, CC_SYMARG) 171 res(ELSEIFNDEF, elseifndef, DF_NOEXPAND, DRT_CONDDIR, 0, P_86, CC_SYMARG) 172 res(ENDIF, endif, 0, DRT_CONDDIR, 0, P_86, 0) 173 174 /* assembly time loop directives, handled by preprocessor */ 175 176 res(FOR, for, DF_NOEXPAND, DRT_LOOPDIR, 0, P_86, 0) 177 res(FORC, forc, DF_NOEXPAND, DRT_LOOPDIR, 0, P_86, 0) 178 res(IRP, irp, 0, DRT_LOOPDIR, 0, P_86, 0) 179 res(IRPC, irpc, 0, DRT_LOOPDIR, 0, P_86, 0) 180 res(REPEAT, repeat, 0, DRT_LOOPDIR, 0, P_86, 0) 181 res(REPT, rept, 0, DRT_LOOPDIR, 0, P_86, 0) 182 res(WHILE, while, 0, DRT_LOOPDIR, 0, P_86, 0) 183 184 /* other preprocessor directives */ 185 186 res(MACRO, macro, DF_LABEL, DRT_MACRO, 0, P_86, 0) 187 res(EXITM, exitm, DF_STRPARM, DRT_MACINT, 0, P_86, 0) 188 res(ENDM, endm, 0, DRT_MACINT, 0, P_86, 0) 189 res(GOTO, goto, 0, DRT_MACINT, 0, P_86, 0) 190 res(PURGE, purge, 0, DRT_PURGE, 0, P_86, 0) 191 res(INCLUDE, include, DF_NOEXPAND|DF_NOCONCAT,DRT_INCLUDE,0, P_86, 0) 192 res(TEXTEQU, textequ, DF_STRPARM | DF_LABEL, DRT_CATSTR, 0, P_86, 0) 193 res(CATSTR, catstr, DF_STRPARM | DF_LABEL, DRT_CATSTR, 0, P_86, 0) 194 res(SUBSTR, substr, DF_STRPARM | DF_LABEL, DRT_SUBSTR, 0, P_86, 0) 195 196 /* INSTR and SIZESTR aren't true preprocessor directives */ 197 res(INSTR, instr, DF_STRPARM | DF_LABEL, DRT_INSTR, 0, P_86, 0) 198 res(SIZESTR, sizestr, DF_STRPARM | DF_LABEL, DRT_SIZESTR, 0, P_86, 0) 199 200 /* data definition directives */ 201 res(DB, db, DF_LABEL, DRT_DATADIR, 0, P_86, T_BYTE ) 202 res(DW, dw, DF_LABEL, DRT_DATADIR, 0, P_86, T_WORD ) 203 res(DD, dd, DF_LABEL, DRT_DATADIR, 0, P_86, T_DWORD) 204 res(DF, df, DF_LABEL, DRT_DATADIR, 0, P_86, T_FWORD) 205 res(DQ, dq, DF_LABEL, DRT_DATADIR, 0, P_86, T_QWORD) 206 res(DT, dt, DF_LABEL, DRT_DATADIR, 0, P_86, T_TBYTE) 207 208 #if AMD64_SUPPORT 209 res(DOT_ALLOCSTACK, .allocstack, 0, DRT_EXCFRAME, RWF_X64, P_64, 0) 210 res(DOT_ENDPROLOG, .endprolog, 0, DRT_EXCFRAME, RWF_X64, P_64, 0) 211 res(DOT_PUSHFRAME, .pushframe, 0, DRT_EXCFRAME, RWF_X64, P_64, 0) 212 res(DOT_PUSHREG, .pushreg, 0, DRT_EXCFRAME, RWF_X64, P_64, 0) 213 res(DOT_SAVEREG, .savereg, 0, DRT_EXCFRAME, RWF_X64, P_64, 0) 214 res(DOT_SAVEXMM128, .savexmm128, 0, DRT_EXCFRAME, RWF_X64, P_64, 0) 215 res(DOT_SETFRAME, .setframe, 0, DRT_EXCFRAME, RWF_X64, P_64, 0) 216 #endif 217 218 /* "type" directives */ 219 res(STRUC, struc, DF_LABEL, DRT_STRUCT, 0, P_86, 0) 220 res(STRUCT, struct, DF_LABEL, DRT_STRUCT, 0, P_86, 0) 221 res(UNION, union, DF_LABEL, DRT_STRUCT, 0, P_86, 0) 222 res(TYPEDEF, typedef, DF_LABEL, DRT_TYPEDEF,0, P_86, 0) 223 res(RECORD, record, DF_LABEL, DRT_RECORD, 0, P_86, 0) 224 225 /* "global" directives */ 226 res(COMM, comm, 0, DRT_COMM, 0, P_86, 0) 227 res(EXTERN, extern, 0, DRT_EXTERN, 0, P_86, 0) 228 res(EXTRN, extrn, 0, DRT_EXTERN, 0, P_86, 0) 229 res(EXTERNDEF, externdef, 0, DRT_EXTERNDEF,0, P_86, 0) 230 res(PUBLIC, public, 0, DRT_PUBLIC, 0, P_86, 0) 231 232 /* "proc" directives */ 233 res(PROTO, proto, DF_LABEL, DRT_PROTO, 0, P_86, 0) 234 res(PROC, proc, DF_CGEN|DF_LABEL|DF_NOSTRUC|DF_STORE,DRT_PROC, 0, P_86, 0) 235 res(ENDP, endp, DF_LABEL|DF_NOSTRUC, DRT_ENDP, 0, P_86, 0) 236 res(LOCAL, local, 0, DRT_LOCAL, 0, P_86, 0) 237 res(LABEL, label, DF_LABEL|DF_NOSTRUC|DF_STORE, DRT_LABEL, 0, P_86, 0) 238 res(INVOKE, invoke, DF_CGEN|DF_NOSTRUC|DF_PROC|DF_STORE, DRT_INVOKE, 0, P_86, 0) 239 240 /* other directives */ 241 242 /* token str len value bytval flags cpu sflags */ 243 res(ORG, org, 0, DRT_ORG, 0, P_86, 0) 244 res(ALIGN, align, 0, DRT_ALIGN, 0, P_86, 0) 245 res(EVEN, even, 0, DRT_ALIGN, 0, P_86, 0) 246 247 res(SEGMENT, segment, DF_LABEL|DF_NOSTRUC|DF_PROC,DRT_SEGMENT, 0, P_86, 0) 248 /* v2.10: ENDS should not trigger prologue creation if it is to end a structure */ 249 //res(ENDS, ends, DF_LABEL|DF_PROC, DRT_ENDS, 0, P_86, 0) 250 res(ENDS, ends, DF_LABEL, DRT_ENDS, 0, P_86, 0) 251 res(GROUP, group, DF_LABEL, DRT_GROUP, 0, P_86, 0) 252 res(ASSUME, assume, 0, DRT_ASSUME, 0, P_86, 0) 253 254 res(ALIAS, alias, 0, DRT_ALIAS, 0, P_86, 0) 255 res(ECHO, echo, DF_NOEXPAND|DF_NOCONCAT, DRT_ECHO, 0, P_86, 0) 256 res(END, end, DF_CGEN|DF_NOSTRUC|DF_STORE,DRT_END, 0, P_86, 0) 257 res(EQU, equ, DF_STRPARM|DF_LABEL, DRT_EQU, 0, P_86, 0) 258 #if INCBINSUPP 259 res(INCBIN, incbin, DF_NOSTRUC|DF_PROC|DF_STORE,DRT_INCBIN, 0, P_86, 0) 260 #endif 261 res(INCLUDELIB, includelib, DF_NOCONCAT, DRT_INCLIB, 0, P_86, 0) 262 res(NAME, name, 0, DRT_NAME, 0, P_86, 0) 263 res(OPTION, option, 0, DRT_OPTION, 0, P_86, 0) 264 res(POPCONTEXT, popcontext, 0, DRT_CONTEXT, 0, P_86, 0) 265 res(PUSHCONTEXT, pushcontext, 0, DRT_CONTEXT, 0, P_86, 0) 266 267