Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1512 lines
52 KiB

  1. /* asm86.h -- include file for microsoft 80x86 assembler
  2. **
  3. ** microsoft (r) macro assembler
  4. ** copyright (c) microsoft corp 1986. all rights reserved
  5. **
  6. ** randy nevin
  7. */
  8. #include "asmconf.h"
  9. #include "asmdebug.h"
  10. #include <setjmp.h>
  11. #ifdef MSDOS
  12. # define PSEP '\\'
  13. # define ALTPSEP '/'
  14. # define BINOPEN (O_CREAT | O_TRUNC | O_WRONLY | O_BINARY)
  15. # define BINSTDIO "b"
  16. # define TEXTREAD (O_RDONLY | O_BINARY)
  17. # define OBJ_EXT ".obj"
  18. # define NLINE "\r\n"
  19. #else
  20. # define PSEP '/'
  21. # define ALTPSEP '\\'
  22. # define BINOPEN (O_CREAT | O_TRUNC | O_WRONLY)
  23. # define BINSTDIO
  24. # define TEXTREAD O_RDONLY
  25. # define OBJ_EXT ".o"
  26. # define NLINE "\n"
  27. #endif /* MSDOS */
  28. # ifdef MSDOS
  29. # define DEF_OBJBUFSIZ 8
  30. # define DEF_INCBUFSIZ 2
  31. # define DEF_SRCBUFSIZ 8
  32. # else
  33. # define DEF_OBJBUFSIZ 1
  34. # define DEF_INCBUFSIZ 1
  35. # define DEF_SRCBUFSIZ 1
  36. # endif /* MSDOS */
  37. # define DEF_LISTWIDTH 79
  38. #ifdef XENIX286
  39. # define DEF_LISTCON TRUE
  40. #else
  41. # define DEF_LISTCON FALSE
  42. #endif /* XENIX286 */
  43. #define DEF_CREFING FALSE
  44. #define DEF_DEBUG FALSE
  45. #define DEF_DUMPSYM TRUE
  46. #define DEF_LSTING FALSE
  47. #define DEF_OBJING TRUE
  48. #define DEF_ORIGCON FALSE
  49. #define DEF_SEGA FALSE
  50. #define DEF_VERBOSE FALSE
  51. #define SYMMAX 63
  52. #define ELSEMAX 20
  53. #define INCLUDEMAX 10
  54. #define PROCMAX 20
  55. #define NUMLIN 58
  56. #define EMITBUFSIZE 1023
  57. #define EMITBUFMAX 1022
  58. #define highWord(l) (*((USHORT *)&l+1))
  59. #define LST_EXT ".lst"
  60. #undef NULL
  61. #define NULL 0
  62. #define FALSE 0
  63. #define TRUE 1
  64. #define MAXCHR 27
  65. #define LINEMAX 200
  66. #define LBUFMAX 512
  67. #define LISTMAX 32
  68. #define TITLEWIDTH 61
  69. #define LSTDATA 7
  70. #define LSTMAX 25
  71. #define ESSEG 0
  72. #define CSSEG 1
  73. #define SSSEG 2
  74. #define DSSEG 3
  75. #define FSSEG 4
  76. #define GSSEG 5
  77. #define NOSEG 6
  78. #define FH_CLOSED -1 /* Used to mark a file temporarily closed */
  79. /* scanatom positioning options */
  80. #define SCEND 0 /* position at end of token */
  81. #define SCSKIP 1 /* position at end of white space */
  82. /* case sensitivity flags */
  83. #define CASEU 0 /* force case to upper case */
  84. #define CASEL 1 /* leave symbol case alone */
  85. #define CASEX 2 /* force all symbols except EXTRN and PUBLIC to upper */
  86. /* opcode types */
  87. #define PGENARG 0 /* general two argument opcodes */
  88. #define PCALL 1 /* call */
  89. #define PJUMP 2 /* jump */
  90. #define PSTACK 3 /* stack manipulation */
  91. #define PRETURN 4 /* return */
  92. #define PRELJMP 5 /* relative jumps */
  93. #define PNOARGS 6 /* no argument opcodes */
  94. #define PREPEAT 7 /* repeat */
  95. #define PINCDEC 8 /* increment/decrement */
  96. #define PINOUT 9 /* in/out */
  97. #define PARITH 10 /* arithmetic opcodes */
  98. #define PESC 11 /* escape */
  99. #define PXCHG 12 /* exchange */
  100. #define PLOAD 13 /* load */
  101. #define PMOV 14 /* moves */
  102. #define PSHIFT 15 /* shifts */
  103. #define PXLAT 16 /* translate */
  104. #define PSTR 17 /* string */
  105. #define PINT 18 /* interrupt */
  106. #define PENTER 19 /* enter */
  107. #define PBOUND 20 /* bounds */
  108. #define PCLTS 21 /* */
  109. #define PDESCRTBL 22 /* */
  110. #define PDTTRSW 23 /* */
  111. #define PARSL 24 /* */
  112. #define PARPL 25 /* */
  113. #define PVER 26 /* */
  114. #define PMOVX 27 /* movzx, movsx */
  115. #define PSETCC 28 /* setle, setge, etc */
  116. #define PBIT 29 /* bt, bts, etc */
  117. #define PBITSCAN 30 /* bsf, bsr */
  118. /* leave some room */
  119. #define OPCODPARSERS 37 /* number of non 8087/286 parsers */
  120. /* fltparsers, 8087 opcode types */
  121. #define FNOARGS 37
  122. #define F2MEMSTK 38
  123. #define FSTKS 39
  124. #define FMEMSTK 40
  125. #define FSTK 41
  126. #define FMEM42 42
  127. #define FMEM842 43
  128. #define FMEM4810 44
  129. #define FMEM2 45
  130. #define FMEM14 46
  131. #define FMEM94 47
  132. #define FWAIT 48
  133. #define FBCDMEM 49
  134. /* masks for opcode types */
  135. #define M_PGENARG (1L << PGENARG)
  136. #define M_PCALL (1L << PCALL)
  137. #define M_PJUMP (1L << PJUMP)
  138. #define M_PSTACK (1L << PSTACK)
  139. #define M_PRETURN (1L << PRETURN)
  140. #define M_PRELJMP (1L << PRELJMP)
  141. #define M_PNOARGS (1L << PNOARGS)
  142. #define M_PREPEAT (1L << PREPEAT)
  143. #define M_PINCDEC (1L << PINCDEC)
  144. #define M_PINOUT (1L << PINOUT)
  145. #define M_PARITH (1L << PARITH)
  146. #define M_PESC (1L << PESC)
  147. #define M_PXCHG (1L << PXCHG)
  148. #define M_PLOAD (1L << PLOAD)
  149. #define M_PMOV (1L << PMOV)
  150. #define M_PSHIFT (1L << PSHIFT)
  151. #define M_PXLAT (1L << PXLAT)
  152. #define M_PSTR (1L << PSTR)
  153. #define M_PINT (1L << PINT)
  154. #define M_PENTER (1L << PENTER)
  155. #define M_PBOUND (1L << PBOUND)
  156. #define M_PCLTS (1L << PCLTS)
  157. #define M_PDESCRTBL (1L << PDESCRTBL)
  158. #define M_PDTTRSW (1L << PDTTRSW)
  159. #define M_PARSL (1L << PARSL)
  160. #define M_PARPL (1L << PARPL)
  161. #define M_PVER (1L << PVER)
  162. /* dkind */
  163. /* low 4 bits reserved for dkinds 0-15 reseved for .model */
  164. #define NL 0
  165. #define IGNORECASE 0x10 /* ignorecase for if's */
  166. #define BLKBEG 0x20 /* macro */
  167. #define CONDBEG 0x40 /* condition */
  168. #define CONDCONT 0x80 /* elseif */
  169. /* assembler directive types */
  170. #define TNAME 1
  171. #define TPUBLIC 2
  172. #define TEXTRN 3
  173. #define TEND 4
  174. #define TORG 5
  175. #define TEVEN 6
  176. #define TPURGE 7
  177. #define TPAGE 8
  178. #define TRADIX 9
  179. #define TLIST 10
  180. #define TXLIST 11
  181. #define TLALL 12
  182. #define TXALL 13
  183. #define TSALL 14
  184. #define TCREF 15
  185. #define TXCREF 16
  186. #define TTFCOND 17
  187. #define TLFCOND 18
  188. #define TSFCOND 19
  189. #define TIF 20
  190. #define TIFE 21
  191. #define TIFDEF 22
  192. #define TIFNDEF 23
  193. #define TIFDIF 24
  194. #define TIFIDN 25
  195. #define TIF1 26
  196. #define T8086 27
  197. #define T8087 28
  198. #define T287 29
  199. #define T186 30
  200. #define T286C 31
  201. #define T286P 32
  202. #define TLOCAL 33
  203. #define TIF2 34
  204. #define TIFNB 35
  205. #define TIFB 36
  206. #define TENDIF 37
  207. #define TIRP 38
  208. #define TIRPC 39
  209. #define TREPT 40
  210. #define TENDM 41
  211. #define TERR 42
  212. #define TERR1 43
  213. #define TERR2 44
  214. #define TERRB 45
  215. #define TERRDEF 46
  216. #define TERRDIF 47
  217. #define TERRE 48
  218. #define TERRNZ 49
  219. #define TERRIDN 50
  220. #define TERRNB 51
  221. #define TERRNDEF 52
  222. #define T386C 53
  223. #define T386P 54
  224. #define T387 55
  225. #define TALIGN 56
  226. #define TASSUME 57
  227. #define TFPO 99
  228. /* 1st only */
  229. #define TEXITM 60
  230. #define TINCLUDE 61
  231. #define TSUBTTL 62
  232. #define TELSE 63
  233. #define TTITLE 64
  234. #define TCOMMENT 65
  235. #define TOUT 66
  236. /* 1st or 2nd */
  237. /* note that TDW has to be the last in the group */
  238. #define TDB 70
  239. #define TDD 71
  240. #define TDQ 72
  241. #define TDT 73
  242. #define TDF 74
  243. #define TDW 75
  244. /* 2nd only */ /* note--datadsize assumes TDx and TMACRO are adjacent */
  245. #define TMACRO 76
  246. #define TEQU 77
  247. #define TSUBSTR 78
  248. #define TCATSTR 79
  249. #define TSIZESTR 80
  250. #define TINSTR 81
  251. #define TSEGMENT 82
  252. #define TENDS 83
  253. #define TPROC 84
  254. #define TENDP 85
  255. #define TGROUP 86
  256. #define TLABEL 87
  257. #define TSTRUC 88
  258. #define TRECORD 89
  259. /* other directives */
  260. #define TSEQ 90
  261. #define TALPHA 91
  262. #define TMODEL 92
  263. #define TMSEG 93
  264. #define TMSTACK 94
  265. #define TDOSSEG 95
  266. #define TINCLIB 96
  267. #define TCOMM 97
  268. #define TMSFLOAT 98
  269. #ifdef MSDOS
  270. #define ERRFILE stdout
  271. #else
  272. #define ERRFILE stderr
  273. #endif
  274. /* operator list */
  275. #define OPLENGTH 0
  276. #define OPSIZE 1
  277. #define OPWIDTH 2
  278. #define OPMASK 3
  279. #define OPOFFSET 4
  280. #define OPSEG 5
  281. #define OPTYPE 6
  282. #define OPSTYPE 7
  283. #define OPTHIS 8
  284. #define OPHIGH 9
  285. #define OPLOW 10
  286. #define OPNOT 11
  287. #define OPSHORT 12
  288. #define OPAND 13
  289. #define OPEQ 14
  290. #define OPGE 15
  291. #define OPGT 16
  292. #define OPLE 17
  293. #define OPLT 18
  294. #define OPMOD 19
  295. #define OPNE 20
  296. #define OPOR 21
  297. #define OPPTR 22
  298. #define OPSHL 23
  299. #define OPSHR 24
  300. #define OPXOR 25
  301. #define OPNOTHING 26
  302. #define OPDUP 27
  303. #define OPLPAR 28
  304. #define OPRPAR 29
  305. #define OPLANGBR 30
  306. #define OPRANGBR 31
  307. #define OPLBRK 32
  308. #define OPRBRK 33
  309. #define OPDOT 34
  310. #define OPCOLON 35
  311. #define OPMULT 36
  312. #define OPDIV 37
  313. #define OPPLUS 38
  314. #define OPMINUS 39
  315. #define OPUNMINUS 40
  316. #define OPUNPLUS 41
  317. /* processor types */
  318. #define P86 0x01 /* all 8086/8088 instructions */
  319. #define P186 0x02 /* + 186 */
  320. #define P286 0x04 /* + 286 unprotected */
  321. #define FORCEWAIT 0x10 /* keep FWAIT on these 287 instructions */
  322. #define PROT 0x80 /* protected mode instructions */
  323. /* See also F_W, S_W in asmtab.h */
  324. /* For NT the .MSFLOAT keyword has been removed */
  325. /* Therefore PXNONE can't be set (Jeff Spencer 11/2/90) */
  326. #define PXNONE 0x00 /* MSFLOAT, no coprocessor */
  327. #define PX87 0x01 /* 8087 */
  328. #define PX287 0x04 /* 80287 */
  329. #define PX387 0x08 /* 80387 */
  330. #ifdef V386
  331. #define P386 0x08 /* + 386 unprotected */
  332. #endif
  333. /* cross-reference information */
  334. #define CREFEND 0 /* member of enumerated set */
  335. #define REF 1 /* member of enumerated set */
  336. #define DEF 2 /* member of enumerated set */
  337. #define CREFINF 3 /* number of cross reference types */
  338. /* cross-reference selection */
  339. #define CREF_SINGLE 1 /* generate single file cross reference */
  340. #define CREF_MULTI 2 /* generate multiple file cross reference */
  341. /* Symbol reference type */
  342. #define REF_NONE 0 /* symbol reference type is none */
  343. #define REF_READ 1 /* symbol reference type is read */
  344. #define REF_WRITE 2 /* symbol reference type is write */
  345. #define REF_XFER 3 /* symbol reference type is jump */
  346. #define REF_OTHER 4 /* symbol reference type is other */
  347. /* number of arguments for opcodes */
  348. #define NONE 0 /* no arguments */
  349. #define MAYBE 1 /* may have arguments */
  350. #define ONE 2 /* one argument */
  351. #define TWO 3 /* two arguments */
  352. #define VARIES 4 /* variable number */
  353. /* opcode argument class */
  354. #define FIRSTDS 0
  355. #define SECONDDS 1
  356. #define STRINGOPCODE 2
  357. /* symbol attributes */
  358. #define CDECL_ 0
  359. #define XTERN 1
  360. #define DEFINED 2
  361. #define MULTDEFINED 3
  362. #define NOCREF 4
  363. #define BACKREF 5
  364. #define PASSED 6
  365. #define GLOBAL 7
  366. /* masks for attributes */
  367. #define M_GLOBAL (1 << GLOBAL)
  368. #define M_XTERN (1 << XTERN)
  369. #define M_DEFINED (1 << DEFINED)
  370. #define M_MULTDEFINED (1 << MULTDEFINED)
  371. #define M_NOCREF (1 << NOCREF)
  372. #define M_BACKREF (1 << BACKREF)
  373. #define M_PASSED (1 << PASSED)
  374. #define M_CDECL (1 << CDECL_)
  375. /* symbol kinds */
  376. #define SEGMENT 0
  377. #define GROUP 1
  378. #define CLABEL 2
  379. #define PROC 3
  380. #define REC 4
  381. #define STRUC 5
  382. #define EQU 6
  383. #define DVAR 7
  384. #define CLASS 8
  385. #define RECFIELD 9
  386. #define STRUCFIELD 10
  387. #define MACRO 11
  388. #define REGISTER 12
  389. /* masks for symbol kinds */
  390. #define M_SEGMENT (1 << SEGMENT)
  391. #define M_GROUP (1 << GROUP)
  392. #define M_CLABEL (1 << CLABEL)
  393. #define M_PROC (1 << PROC)
  394. #define M_REC (1 << REC)
  395. #define M_STRUC (1 << STRUC)
  396. #define M_EQU (1 << EQU)
  397. #define M_DVAR (1 << DVAR)
  398. #define M_CLASS (1 << CLASS)
  399. #define M_RECFIELD (1 << RECFIELD)
  400. #define M_STRUCFIELD (1 << STRUCFIELD)
  401. #define M_MACRO (1 << MACRO)
  402. #define M_REGISTER (1 << REGISTER)
  403. /* Special values for symtype - which normaly is the size of the type */
  404. #define CSNEAR ((USHORT)(~0)) /* type for near proc/label */
  405. #define CSNEAR_LONG ((long)(~0)) /* For use after CSNEAR has been sign extened */
  406. #define CSFAR ((USHORT)(~1)) /* .. far .. */
  407. #define CSFAR_LONG ((long)(~1)) /* .. far .. */
  408. /* equ types */
  409. #define ALIAS 0
  410. #define TEXTMACRO 1
  411. #define EXPR 2
  412. /* register kinds */
  413. #define BYTREG 0 /* byte register */
  414. #define WRDREG 1 /* word register */
  415. #define SEGREG 2 /* segment register */
  416. #define INDREG 3 /* index register */
  417. #define STKREG 4 /* stack register */
  418. #ifdef V386
  419. #define DWRDREG 5 /* double word register */
  420. #define CREG 6 /* 386 control, debug, or test register */
  421. #endif
  422. /* masks for register kinds */
  423. #define M_BYTREG (1 << BYTREG)
  424. #define M_WRDREG (1 << WRDREG)
  425. #define M_SEGREG (1 << SEGREG)
  426. #define M_INDREG (1 << INDREG)
  427. #define M_STKREG (1 << STKREG)
  428. #ifdef V386
  429. #define M_DWRDREG (1 << DWRDREG)
  430. #define M_CREG (1 << CREG)
  431. #endif
  432. /* source type */
  433. #define RREADSOURCE 0 /* read line from file */
  434. #define RMACRO 1 /* macro expansion */
  435. /* source line handlers */
  436. #define HPARSE 0 /* parse line */
  437. #define HMACRO 1 /* build macro */
  438. #define HIRPX 2 /* build irp/irpx */
  439. #define HCOMMENT 3 /* copy comment lines */
  440. #define HSTRUC 4 /* build struc definition */
  441. /* codeview debugging obj generation */
  442. #define CVNONE 0
  443. #define CVLINE 1
  444. #define CVSYMBOLS 2
  445. /* Predefined type index component parts for codeview*/
  446. #define BT_UNSIGNED 1 /* Basic types */
  447. #define BT_REAL 2
  448. #define BT_ASCII 5
  449. #define BT_DIRECT 0 /* Address type */
  450. #define BT_NEARP 1
  451. #define BT_FARP 2
  452. #define BT_sz1 0 /* Size */
  453. #define BT_sz2 1
  454. #define BT_sz4 2
  455. #define makeType(type, mode, size) (0x0080 | mode << 5 | type << 2 | size)
  456. #define isCodeLabel(pSY) (pSY->symtype >= CSFAR)
  457. /* tags for fProcArgs, controls frame building*/
  458. #define ARGS_NONE 0 /* no arguments */
  459. #define ARGS_REG 1 /* register save list */
  460. #define ARGS_PARMS 2 /* parms present */
  461. #define ARGS_LOCALS 3 /* locals present */
  462. #define CLANG 1 /* langType tag for C */
  463. #define STRUC_INIT -1 /* special mark for clabel.proclen to indicate
  464. * a structure initialization */
  465. /* listing type */
  466. #define SUPPRESS 0
  467. #define LISTGEN 1
  468. #define LIST 2
  469. /* parameter types */
  470. #define CHRTXT 0
  471. #define PLIST 1
  472. #define MACROS 2
  473. /* type of entry on parse stack */
  474. #define OPERATOR 0
  475. #define OPERAND 1
  476. #define ENDEXPR 2
  477. /* okind */
  478. #define ICONST 0
  479. #define ISYM 1
  480. #define IUNKNOWN 2
  481. #define ISIZE 3
  482. #define IRESULT 4
  483. /* ftype */
  484. #define FORREF 1 /* symbol is forward reference */
  485. #define UNDEFINED 2 /* symbol is undefined */
  486. #define KNOWN 4 /* symbol is known */
  487. #define XTERNAL 8 /* symbol is external */
  488. #define INDETER 10 /* symbol value is indeterminate */
  489. /* tset */
  490. #define UNKNOWN 0
  491. #define HIGH 1
  492. #define LOW 2
  493. #define DATA 3
  494. #define CODE 4
  495. #define RCONST 5
  496. #define REGRESULT 6
  497. #define SHRT 7 /* Was SHORT, but that conflicted with the type */
  498. #define SEGRESULT 8
  499. #define GROUPSEG 9
  500. #define FORTYPE 10
  501. #define PTRSIZE 11
  502. #define EXPLOFFSET 12
  503. #define FLTSTACK 13
  504. #define EXPLCOLON 14
  505. #define STRUCTEMPLATE 15
  506. /* masks for above */
  507. #define M_UNKNOWN (1 << UNKNOWN) // 0x0001
  508. #define M_HIGH (1 << HIGH) // 0x0002
  509. #define M_LOW (1 << LOW) // 0x0004
  510. #define M_DATA (1 << DATA) // 0x0008
  511. #define M_CODE (1 << CODE) // 0x0010
  512. #define M_RCONST (1 << RCONST) // 0x0020
  513. #define M_REGRESULT (1 << REGRESULT) // 0x0040
  514. #define M_SHRT (1 << SHRT) // 0x0080
  515. #define M_SEGRESULT (1 << SEGRESULT) // 0x0100
  516. #define M_GROUPSEG (1 << GROUPSEG) // 0x0200
  517. #define M_FORTYPE (1 << FORTYPE) // 0x0400
  518. #define M_PTRSIZE (1 << PTRSIZE) // 0x0800
  519. #define M_EXPLOFFSET (1 << EXPLOFFSET) // 0x1000
  520. #define M_FLTSTACK (1 << FLTSTACK) // 0x2000
  521. #define M_EXPLCOLON (1 << EXPLCOLON) // 0x4000
  522. #define M_STRUCTEMPLATE ((USHORT)(1 << STRUCTEMPLATE)) // 0x8000
  523. /* fixup types */
  524. #define FPOINTER 0 /* four bytes offset and segment */
  525. #define FOFFSET 1 /* two bytes relative to context */
  526. #define FBASESEG 2 /* two bytes segment address */
  527. #define FGROUPSEG 3 /* two bytes segment address of group */
  528. #define FCONSTANT 4 /* one or two bytes of constant data */
  529. #define FHIGH 5 /* one byte high part of offset */
  530. #define FLOW 6 /* one byte low part of offset */
  531. #define FNONE 7 /* no offset */
  532. #ifndef V386
  533. #define FIXLIST 8 /* number of fixup types */
  534. #else
  535. #define F32POINTER 8 /* 6 bytes offset and segment--for 386 */
  536. #define F32OFFSET 9 /* 4 bytes offset--for 386 */
  537. #define DIR32NB 10 /* DIR32NB fixup type for FPO */
  538. #define FIXLIST 11 /* number of fixup types */
  539. #endif
  540. /* masks for fixup types */
  541. #define M_F32POINTER (1 << F32POINTER)
  542. #define M_F32OFFSET (1 << F32OFFSET)
  543. #define M_FPOINTER (1 << FPOINTER)
  544. #define M_FOFFSET (1 << FOFFSET)
  545. #define M_FBASESEG (1 << FBASESEG)
  546. #define M_FGROUPSEG (1 << FGROUPSEG)
  547. #define M_FCONSTANT (1 << FCONSTANT)
  548. #define M_FHIGH (1 << FHIGH)
  549. #define M_FLOW (1 << FLOW)
  550. #define M_FNONE (1 << FNONE)
  551. /* record for DUP lists */
  552. #define NEST 0 /* Dup item is nested */
  553. #define ITEM 1 /* Dup item is regular size */
  554. #define LONG 2 /* Dup item is long size */
  555. /* assembler exit codes */
  556. #define EX_NONE 0 /* no error */
  557. #define EX_ARGE 1 /* argument error */
  558. #define EX_UINP 2 /* unable to open input file */
  559. #define EX_ULST 3 /* unable to open listing file */
  560. #define EX_UOBJ 4 /* unable to open object file */
  561. #define EX_UCRF 5 /* unable to open cross reference file */
  562. #define EX_UINC 6 /* unable to open include file */
  563. #define EX_ASME 7 /* assembly errors */
  564. #define EX_MEME 8 /* memory allocation error */
  565. #define EX_REAL 9 /* real number input not allowed */
  566. #define EX_DSYM 10 /* error defining symbol from command line */
  567. #define EX_INT 11 /* assembler interrupted */
  568. #define TERMINATE(message, exitCode)\
  569. terminate( (SHORT)((exitCode << 12) | message), NULL, NULL, NULL )
  570. #define TERMINATE1(message, exitCode, a1)\
  571. terminate( (SHORT)((exitCode << 12) | message), a1, NULL, NULL )
  572. /* Bit flags or'ed into the error numbers */
  573. #define E_WARN1 ((USHORT)(1 << 12)) /* level 1 warning */
  574. #define E_WARN2 ((USHORT)(2 << 12)) /* level 2 warning */
  575. #define E_PASS1 ((USHORT)(8 << 12)) /* pass 1 error */
  576. #define E_ERRMASK 0x0fff /* low 12 bits contain error code */
  577. /* error code definitions */
  578. #define E_BNE 1 /* block nesting error */
  579. #define E_ECL (2|E_WARN1) /* extra characters on line */
  580. #define E_RAD (3|E_PASS1) /* ?register already defined */
  581. #define E_UST 4 /* unknown type specifier */
  582. #define E_RSY (5|E_PASS1) /* redefinition of symbol */
  583. #define E_SMD 6 /* symbol multiply defined */
  584. #define E_PHE 7 /* phase error */
  585. #define E_ELS 8 /* already had ELSE clause */
  586. #define E_NCB 9 /* not in conditional block */
  587. #define E_SND 10 /* symbol not defined */
  588. #define E_SYN 11 /* syntax error */
  589. #define E_TIL 12 /* type illegal in context */
  590. #define E_NGR 13 /* need group name */
  591. #define E_PS1 (14|E_PASS1) /* must be declared in pass 1 */
  592. #define E_TUL 15 /* symbol type usage illegal */
  593. #define E_SDK 16 /* symbol already different kind */
  594. #define E_RES (17|E_WARN1) /* symbol is reserved word */
  595. #define E_IFR (18|E_PASS1) /* forward reference is illegal */
  596. #define E_MBR 19 /* must be register */
  597. #define E_WRT 20 /* wrong register type */
  598. #define E_MSG 21 /* must be segment or group */
  599. /*#define E_SNS 22 obsolete: symbol has no segment */
  600. #define E_MSY 23 /* must be symbol type */
  601. #define E_ALD 24 /* already locally defined */
  602. #define E_SPC 25 /* segment parameters changed */
  603. #define E_NPA 26 /* not proper align /combine type */
  604. #define E_RMD 27 /* reference to multiply defined */
  605. #define E_OPN 28 /* operand was expected */
  606. #define E_OPR 29 /* operator was expected */
  607. #define E_DVZ 30 /* division by 0 or overflow */
  608. #define E_SCN 31 /* shift count negative */
  609. #define E_OMM (32|E_WARN1) /* operand types must match */
  610. #define E_IUE 33 /* illegal use of external */
  611. /*#define E_RFM 34 obsolete: must be record field name */
  612. #define E_RRF 35 /* must be record or fieldname */
  613. #define E_OHS 36 /* operand must have size */
  614. #define E_NOP (37|E_WARN2) /* nops generated */
  615. #define E_LOS 39 /* left operand must have segmnt */
  616. #define E_OOC 40 /* one operand must be constant */
  617. #define E_OSA 41 /* operands must be same or 1 abs*/
  618. /*#define E_NOE 42 obsolete: normal type operand expected */
  619. #define E_CXP 43 /* constant was expected */
  620. #define E_OSG 44 /* operand must have segment */
  621. #define E_ASD 45 /* must be associated with data */
  622. #define E_ASC 46 /* must be associated with code */
  623. #define E_DBR 47 /* already have base register */
  624. #define E_DIR 48 /* already have index register */
  625. #define E_IBR 49 /* must be index or base register*/
  626. #define E_IUR 50 /* illegal use of register */
  627. #define E_VOR 51 /* value out of range */
  628. #define E_NIP 52 /* operand not in IP segment */
  629. #define E_IOT 53 /* improper operand type */
  630. #define E_JOR 54 /* relative jump out of range */
  631. /*#define E_IDC 55 obsolete: index displ must be constant */
  632. #define E_IRV 56 /* illegal register value */
  633. #define E_NIM 57 /* no immediate mode */
  634. #define E_IIS (58|E_WARN1) /* illegal size for item */
  635. #define E_BRI 59 /* byte register is illegal */
  636. #define E_CSI 60 /* CS register illegal usage */
  637. #define E_AXL 61 /* must be AX or AL */
  638. #define E_ISR 62 /* improper use of segment reg */
  639. #define E_NCS 63 /* no or unreachable CS */
  640. #define E_OCI 64 /* operand combination illegal */
  641. #define E_JCD 65 /* near JMP /CALL to differend CS */
  642. #define E_NSO 66 /* label can't have seg override */
  643. #define E_OAP 67 /* must have opcode after prefix */
  644. #define E_OES 68 /* can't override ES segment */
  645. #define E_CRS 69 /* can't reach with segment reg */
  646. #define E_MSB 70 /* must be in segment block */
  647. #define E_NEB 71 /* can't use EVEN or BYTE seg */
  648. #define E_FOF 72 /* forward needs override or far */
  649. #define E_IDV 73 /* illegal value for DUP count */
  650. #define E_SAE 74 /* symbol already external */
  651. #define E_DTL 75 /* DUP too large for linker */
  652. #define E_UID 76 /* usage of ?(indeterminate) bad */
  653. #define E_MVD 77 /* more values than defined with */
  654. #define E_OIL 78 /* only initialize list legal */
  655. #define E_DIS 79 /* directive illegal in struc */
  656. #define E_ODI 80 /* override with DUP is illegal */
  657. #define E_FCO 81 /* fields cannot be overriden */
  658. /*#define E_RFR 83 obsolete: register can't be forward ref */
  659. #define E_CEA 84 /* circular chain of EQU aliases */
  660. #define E_7OE 85 /* 8087 opcode can't be emulated */
  661. #define E_EOF (86|E_PASS1|E_WARN1) /* end of file, no END directive */
  662. #define E_ENS 87 /* data emitted with no segment */
  663. #define E_EP1 88 /* error if pass1 */
  664. #define E_EP2 89 /* error if pass2 */
  665. #define E_ERR 90 /* error */
  666. #define E_ERE 91 /* error if expr = 0 */
  667. #define E_ENZ 92 /* error if expr != 0 */
  668. #define E_END 93 /* error if symbol not defined */
  669. #define E_ESD 94 /* error if symbol defined */
  670. #define E_EBL 95 /* error if string blank */
  671. #define E_ENB 96 /* error if string not blank */
  672. #define E_EID 97 /* error if strings identical */
  673. #define E_EDF 98 /* error if strings different */
  674. #define E_OWL 99 /* overide is too long */
  675. #define E_LTL (100|E_PASS1)/* line too long */
  676. #define E_IMP (101|E_WARN1)/* impure memory reference */
  677. #define E_MDZ (102|E_WARN1)/* missing data; zero assumed */
  678. #define E_286 (103|E_WARN1)/* segment near (or at) 64K limit*/
  679. #define E_AP2 104 /* Align must be power of 2 */
  680. #define E_JSH (105|E_WARN2)/* shortened jump (warning) */
  681. #define E_EXP 106 /* expected "<what was expected>"*/
  682. #define E_LNL 107 /* line too long */
  683. #define E_NDN 108 /* non-digit in number */
  684. #define E_EMS 109 /* empty string */
  685. #define E_MOP 110 /* missing operand */
  686. #define E_PAR 111 /* open parenthesis or bracket */
  687. #define E_NMC 112 /* not in macro expansion */
  688. #define E_UEL 113 /* unexpected end of line */
  689. #define E_CPU 114 /* can't change cpu type after first segment */
  690. #define E_ONW (115|E_WARN2)/* operand size does not match wordsize (warning) */
  691. #define E_ANW (116|E_WARN2)/* address size does not match wordsize (warning) */
  692. #define E_INC (117|E_PASS1)/* include file not found */
  693. #define E_FPO1 (118|E_PASS1)
  694. #define E_FPO2 (119|E_WARN1)
  695. #define E_MAX 120 /* number of error messages */
  696. /* symbol name entry */
  697. struct idtext {
  698. SHORT hashval; /* value of hash function */
  699. char id[1]; /* name */
  700. };
  701. /* parse stack entry */
  702. struct dscrec {
  703. DSCREC *previtem; /* previous item on stack */
  704. UCHAR prec; /* precedence */
  705. char itype; /* type of entry */
  706. union {
  707. /* OPERAND */
  708. struct psop {
  709. SYMBOL FARSYM *dsegment; /* segment of result */
  710. SYMBOL FARSYM *dcontext; /* context(CS) of label
  711. or current segment register*/
  712. SYMBOL FARSYM *dextptr; /* pointer to external */
  713. USHORT dlength;
  714. USHORT rm; /* register/index mode */
  715. USHORT dtype; /* copy of dtype */
  716. OFFSET doffset; /* offset */
  717. USHORT dsize; /* size */
  718. char mode; /* mode bits */
  719. char w; /* word/byte mode */
  720. char s; /* sign extend */
  721. char sized; /* TRUE if has size */
  722. char seg; /* segment register, etc */
  723. char dflag; /* copy of dflag */
  724. char fixtype; /* fixup type */
  725. char dsign;
  726. } opnd;
  727. /* OPERATOR */
  728. struct {
  729. char oidx;
  730. } opr;
  731. } dsckind;
  732. };
  733. /* record for dup list */
  734. struct duprec {
  735. struct duprec FARSYM *itemlst; /* list of items to dup */
  736. OFFSET rptcnt; /* number of times to repeat */
  737. USHORT itemcnt; /* number of duprecs in itemlist */
  738. USHORT type; /* data type for codeview */
  739. char decltype; /* STRUC data declaration type */
  740. char dupkind; /* dup type */
  741. union {
  742. /* NEXT */
  743. struct {
  744. struct duprec FARSYM *dup;
  745. } dupnext;
  746. /* ITEM */
  747. struct {
  748. DSCREC *ddata;
  749. } dupitem;
  750. /* LONG */
  751. struct {
  752. char *ldata;
  753. UCHAR llen;
  754. } duplong;
  755. } duptype;
  756. };
  757. /* symbol entry */
  758. struct symb {
  759. SYMBOL FARSYM *next; /* pointer to next symbol */
  760. SYMBOL FARSYM *alpha; /* pointer to next symbol alpha ordered */
  761. SYMBOL FARSYM *symsegptr; /* pointer to segment entry for symbol */
  762. NAME FAR *nampnt; /* pointer to name structure */
  763. NAME *lcnamp; /* pointer to lower case name structure */
  764. OFFSET offset;
  765. USHORT length;
  766. USHORT symtype; /* DB .. DT plus NEAR/FAR */
  767. UCHAR attr; /* GLOBAL .. LOCALSYM */
  768. char symkind; /* SEGMENT .. REGISTER */
  769. union {
  770. /* SEGMENT */
  771. struct symbseg {
  772. USHORT segIndex; /* must be first */
  773. SYMBOL FARSYM *segordered;
  774. SYMBOL FARSYM *lastseg;
  775. SYMBOL FARSYM *grouptr;
  776. SYMBOL FARSYM *nxtseg;
  777. SYMBOL FARSYM *classptr;
  778. OFFSET seglen;
  779. OFFSET locate;
  780. USHORT lnameIndex; /* for class aliaes */
  781. char align;
  782. char combine;
  783. char use32;
  784. char hascode;
  785. } segmnt;
  786. /* GROUP */
  787. struct symbgrp {
  788. USHORT groupIndex; /* must be first */
  789. SYMBOL FARSYM *segptr;
  790. } grupe;
  791. /* CLABEL */
  792. struct symbclabel {
  793. USHORT type; /* type index, for codeview */
  794. SYMBOL FARSYM *csassume;
  795. USHORT iProc; /* procedure index belonging to */
  796. } clabel;
  797. /* PROC */
  798. struct symbproc {
  799. USHORT type; /* type index, for codeview */
  800. SYMBOL FARSYM *csassume;
  801. USHORT proclen;
  802. SYMBOL FARSYM *pArgs; /* arguments and locals */
  803. } plabel;
  804. /* extern (code & data), comm & class (known as DVAR) */
  805. struct symbext {
  806. USHORT extIndex; /* must be first */
  807. SYMBOL FARSYM *csassume;
  808. OFFSET length; /* so comms > 64K */
  809. UCHAR commFlag; /* used for comm defs */
  810. } ext;
  811. /* EQU */
  812. struct symbequ {
  813. char equtyp;
  814. USHORT iProc; /* procedure index belonging to */
  815. union {
  816. /* ALIAS */
  817. struct {
  818. SYMBOL FARSYM *equptr;
  819. } alias;
  820. /* TEXTMACRO */
  821. struct {
  822. char *equtext;
  823. USHORT type; /* CV type for parms/locals */
  824. } txtmacro;
  825. /* EXPR */
  826. struct {
  827. SYMBOL FARSYM *eassume;
  828. char esign;
  829. } expr;
  830. } equrec;
  831. } equ;
  832. /* RECFIELD */
  833. struct symbrecf {
  834. SYMBOL FARSYM *recptr;
  835. SYMBOL FARSYM *recnxt;
  836. OFFSET recinit; /* Initial Value */
  837. OFFSET recmsk; /* bit mask */
  838. char recwid; /* with in bits */
  839. } rec;
  840. /* STRUCFIELD */
  841. struct symbstrucf {
  842. SYMBOL FARSYM *strucnxt;
  843. USHORT type;
  844. } struk;
  845. /* REC, STRUC, MACRO */
  846. struct symbrsm {
  847. union {
  848. /* REC */
  849. struct {
  850. SYMBOL FARSYM *reclist;
  851. char recfldnum;
  852. } rsmrec;
  853. /* STRUC */
  854. struct {
  855. SYMBOL FARSYM *struclist;
  856. struct duprec FARSYM *strucbody;
  857. USHORT strucfldnum;
  858. USHORT type;
  859. USHORT typePtrNear;
  860. USHORT typePtrFar;
  861. } rsmstruc;
  862. /* MACRO */
  863. struct {
  864. TEXTSTR FAR *macrotext;
  865. UCHAR active;
  866. UCHAR delete;
  867. UCHAR parmcnt;
  868. UCHAR lclcnt;
  869. } rsmmac;
  870. } rsmtype;
  871. } rsmsym;
  872. /* REGISTER */
  873. struct symbreg {
  874. char regtype;
  875. } regsym;
  876. } symu;
  877. };
  878. /* textstring descriptor */
  879. struct textstr {
  880. TEXTSTR FAR *strnext; /* next string in list */
  881. char size; /* allocated size */
  882. char text[1]; /* text of string */
  883. };
  884. typedef union PV_u {
  885. char *pActual; /* pointer to actual parm value */
  886. char localName[4]; /* or local name cache */
  887. } PV;
  888. typedef struct MC_s { /* Macro parameter build/call struct */
  889. TEXTSTR FAR *pTSHead; /* Head of linked body lines */
  890. TEXTSTR FAR *pTSCur; /* Current body line */
  891. UCHAR flags; /* macro type */
  892. UCHAR iLocal; /* index of first local */
  893. USHORT cbParms; /* byte count of parms string */
  894. USHORT localBase; /* first local # to use */
  895. USHORT count; /* count of excution loops */
  896. char *pParmNames; /* parameter names during build */
  897. char *pParmAct; /* actual parm names during expansion*/
  898. char svcondlevel; /* condlevel at macro call */
  899. char svlastcondon; /* lastcondon at macro call */
  900. char svelseflag; /* elseflag at macro call */
  901. PV rgPV[1]; /* parm index to point to actual */
  902. } MC;
  903. /* data descriptor entry */
  904. struct dsr {
  905. DSCREC *valrec;
  906. struct duprec FARSYM *dupdsc;
  907. char longstr;
  908. char flag;
  909. char initlist;
  910. char floatflag;
  911. char *dirscan;
  912. OFFSET i;
  913. };
  914. struct eqar {
  915. SYMBOL FARSYM *equsym;
  916. DSCREC *dsc;
  917. UCHAR *dirscan;
  918. UCHAR svcref;
  919. };
  920. struct datarec {
  921. OFFSET datalen;
  922. USHORT type;
  923. SYMBOL FARSYM *labelptr;
  924. char buildfield;
  925. };
  926. struct fileptr {
  927. FILE *fil;
  928. struct fileptr *prevfil;
  929. short line;
  930. char *name;
  931. };
  932. struct objfile {
  933. int fh;
  934. char FARIO *pos;
  935. char FARIO *buf;
  936. SHORT cnt;
  937. SHORT siz;
  938. char *name;
  939. };
  940. /* BUFFER CONTROL BLOCK - Information concerning a file buffer */
  941. #ifdef BCBOPT
  942. typedef struct BCB {
  943. struct BCB * pBCBNext; /* next BCB for file */
  944. struct BCB * pBCBPrev; /* last BCB allocated */
  945. char FARIO * pbuf; /* pointer to buffer */
  946. long filepos; /* current position in file */
  947. char fInUse; /* Set during pass 2 if buffer is active */
  948. } BCB;
  949. #endif
  950. /* FCB - Information concerning a particular file */
  951. typedef struct FCB {
  952. int fh; /* file handle */
  953. long savefilepos; /* file position if file closed temporarily */
  954. struct FCB * pFCBParent; /* parent file */
  955. struct FCB * pFCBChild; /* child file (bi-directional linked list */
  956. #ifdef BCBOPT
  957. struct FCB * pFCBNext; /* next file to be opened */
  958. BCB * pBCBFirst; /* first BCB for file */
  959. BCB * pBCBCur; /* current BCB for file */
  960. #endif
  961. char FARIO * pbufCur; /* read/write loc in current buffer */
  962. char FARIO * ptmpbuf; /* current position in temp read buffer */
  963. char FARIO * buf; /* temporary read buffer */
  964. USHORT ctmpbuf; /* count of bytes in temporary buffer */
  965. USHORT cbbuf; /* size of buffer */
  966. USHORT cbufCur; /* count of bytes in current buffer */
  967. USHORT line; /* current line number */
  968. char fname[1]; /* file name */
  969. } FCB;
  970. typedef struct FASTNAME {
  971. UCHAR * pszName; /* text of the name, upper case if appropriate */
  972. UCHAR * pszLowerCase; /* Mixed case version of pszName */
  973. USHORT usHash; /* hash value of string in pszName */
  974. UCHAR ucCount; /* length of the name */
  975. } FASTNAME;
  976. // Used to store real number initializers
  977. struct realrec {
  978. UCHAR num[10];
  979. USHORT i;
  980. };
  981. /* Used to parse and generate CODE for 8086 opcodes */
  982. struct parsrec {
  983. DSCREC *op1;
  984. DSCREC *op2;
  985. UCHAR bytval;
  986. USHORT wordval;
  987. DSCREC *dsc1;
  988. DSCREC *dsc2;
  989. UCHAR defseg;
  990. char *dirscan;
  991. char svxcref;
  992. };
  993. struct evalrec {
  994. struct ar *p;
  995. char parenflag;
  996. char evalop;
  997. char curitem;
  998. char idx;
  999. DSCREC *curoper;
  1000. };
  1001. struct exprec {
  1002. struct evalrec *p;
  1003. DSCREC *valright;
  1004. DSCREC *valleft;
  1005. UCHAR stkoper;
  1006. USHORT t;
  1007. OFFSET left;
  1008. OFFSET right;
  1009. };
  1010. struct fltrec {
  1011. UCHAR fseg;
  1012. char args;
  1013. USHORT stknum;
  1014. USHORT stk1st;
  1015. };
  1016. /* reg initialization data */
  1017. struct mreg {
  1018. char nm[4];
  1019. UCHAR rt;
  1020. UCHAR val;
  1021. };
  1022. typedef struct _FPO_DATA {
  1023. unsigned long ulOffStart; // offset 1st byte of function code
  1024. unsigned long cbProcSize; // # bytes in function
  1025. unsigned long cdwLocals; // # bytes in locals/4
  1026. unsigned short cdwParams; // # bytes in params/4
  1027. unsigned short cbProlog : 8; // # bytes in prolog
  1028. unsigned short cbRegs : 3; // # regs saved
  1029. unsigned short fHasSEH : 1; // TRUE if SEH in func
  1030. unsigned short fUseBP : 1; // TRUE if EBP has been allocated
  1031. unsigned short reserved : 1; // reserved for future use
  1032. unsigned short cbFrame : 2; // frame type
  1033. } FPO_DATA, *PFPO_DATA;
  1034. typedef struct _FPOSTRUCT {
  1035. struct _FPOSTRUCT *next;
  1036. FPO_DATA fpoData;
  1037. SYMBOL *pSym;
  1038. SYMBOL *pSymAlt;
  1039. USHORT extidx;
  1040. } FPOSTRUCT, *PFPOSTRUCT;
  1041. #ifndef ASMGLOBAL
  1042. # if defined M8086OPT
  1043. extern UCHAR *naim;
  1044. extern UCHAR *svname;
  1045. # else
  1046. extern FASTNAME naim;
  1047. extern FASTNAME svname;
  1048. # endif
  1049. extern UCHAR X87type;
  1050. extern char ampersand;
  1051. extern char addplusflagCur;
  1052. extern char baseName[];
  1053. extern char caseflag;
  1054. extern char checkpure;
  1055. extern char condflag;
  1056. extern OFFSET cbProcLocals;
  1057. extern OFFSET cbProcParms;
  1058. extern UCHAR cpu;
  1059. extern UCHAR cputype;
  1060. extern UCHAR crefinc;
  1061. extern char crefing;
  1062. extern char crefnum[];
  1063. extern char crefopt;
  1064. extern UCHAR creftype;
  1065. extern char wordszdefault;
  1066. extern char emittext; /* emit linker test if true */
  1067. extern char debug; /* true if debug set */
  1068. extern USHORT dirsize[];
  1069. extern char displayflag;
  1070. extern char dumpsymbols; /* do symbol table display if true */
  1071. extern char dupflag;
  1072. extern char elseflag;
  1073. extern char emulatethis;
  1074. extern char endbody;
  1075. extern char equdef; /* TRUE if equ already defined */
  1076. extern char equflag;
  1077. extern char equsel;
  1078. extern USHORT errorlineno;
  1079. extern char exitbody;
  1080. extern char expandflag;
  1081. extern char fDosSeg;
  1082. extern char fSimpleSeg;
  1083. extern char fCheckRes;
  1084. extern UCHAR fCrefline;
  1085. extern char fNeedList;
  1086. extern char fProcArgs;
  1087. extern USHORT fPass1Err;
  1088. extern char f386already;
  1089. extern char fArth32;
  1090. extern char fSkipList;
  1091. extern char fSecondArg;
  1092. extern char farData[];
  1093. extern char fltemulate;
  1094. extern UCHAR fKillPass1;
  1095. extern jmp_buf forceContext;
  1096. extern char generate;
  1097. extern UCHAR goodlbufp;
  1098. extern char impure;
  1099. extern USHORT iProcCur;
  1100. extern USHORT iProc;
  1101. extern char inclcnt;
  1102. extern char inclFirst;
  1103. extern SHORT iRegSave;
  1104. extern char *inclpath[];
  1105. extern char initflag;
  1106. extern char labelflag;
  1107. extern SHORT handler;
  1108. extern char lastreader;
  1109. extern char linebuffer[];
  1110. extern char *linebp;
  1111. extern char lbuf[];
  1112. extern char *lbufp;
  1113. extern SHORT langType;
  1114. extern char listbuffer[];
  1115. extern char listblank [];
  1116. extern char listconsole;
  1117. extern char listed;
  1118. extern char listflag;
  1119. extern char listindex;
  1120. extern char listquiet;
  1121. extern char localflag;
  1122. extern char loption;
  1123. extern char lsting;
  1124. extern char moduleflag;
  1125. extern USHORT nestCur;
  1126. extern USHORT nestMax;
  1127. extern char noexp;
  1128. extern char objectascii[];
  1129. extern char objing;
  1130. extern char opctype;
  1131. extern char opertype;
  1132. extern char opkind;
  1133. extern char optyp;
  1134. extern char origcond;
  1135. extern char *pText, *pTextEnd;
  1136. extern SYMBOL FARSYM *pStrucCur;
  1137. extern SYMBOL FARSYM *pStrucFirst;
  1138. extern char pass2; /* true if in pass 2 */
  1139. extern char popcontext;
  1140. extern char radix; /* assumed radix base */
  1141. extern char radixescape;
  1142. extern char resvspace;
  1143. extern char save[];
  1144. extern char segalpha;
  1145. extern char segtyp;
  1146. extern char strucflag;
  1147. extern char subttlbuf[];
  1148. extern char swaphandler;
  1149. extern char titlebuf[];
  1150. extern char titleflag;
  1151. extern char titlefn[];
  1152. extern USHORT tempLabel;
  1153. extern char unaryset[];
  1154. extern char xcreflag;
  1155. extern char xoptoargs[];
  1156. extern char *atime;
  1157. extern long linestot;
  1158. extern long linessrc;
  1159. extern short pagemajor;
  1160. extern short pageminor;
  1161. extern short symbolcnt;
  1162. extern DSCREC emptydsc;
  1163. extern DSCREC *fltdsc;
  1164. extern DSCREC *itemptr;
  1165. extern DSCREC *resptr;
  1166. extern DSCREC *startaddr;
  1167. extern struct duprec FARSYM *strucprev;
  1168. extern struct duprec FARSYM *strclastover;
  1169. extern struct duprec FARSYM *strucoveride;
  1170. extern struct fileptr crf;
  1171. extern struct fileptr lst;
  1172. extern NAME FAR *modulename;
  1173. extern TEXTSTR FAR *rmtline;
  1174. extern SYMBOL FARSYM *curgroup;
  1175. extern SYMBOL FARSYM *firstsegment;
  1176. extern SYMBOL FARSYM *lastsegptr;
  1177. extern SYMBOL FARSYM *macroptr;
  1178. extern SYMBOL FARSYM *macroroot;
  1179. extern SYMBOL FARSYM *procStack[PROCMAX];
  1180. extern SYMBOL FARSYM *pProcCur;
  1181. extern SYMBOL FARSYM *pProcFirst;
  1182. extern SYMBOL FARSYM *pFlatGroup;
  1183. extern short iProcStack;
  1184. extern SYMBOL FARSYM *pcproc;
  1185. extern MC *pMCur;
  1186. extern TEXTSTR FAR *pLib;
  1187. extern SYMBOL FARSYM *pcsegment;
  1188. extern SYMBOL FARSYM *recptr;
  1189. extern char regSave[8][SYMMAX+1];
  1190. extern SYMBOL FARSYM *regsegment[6];
  1191. extern SYMBOL FARSYM *struclabel;
  1192. extern SYMBOL FARSYM *strucroot;
  1193. extern SYMBOL FARSYM *symptr;
  1194. extern SYMBOL FARSYM *symroot[];
  1195. extern UCHAR delim;
  1196. extern SHORT errorcode;
  1197. extern UCHAR fixvalues[];
  1198. extern UCHAR modrm;
  1199. extern UCHAR nilseg;
  1200. extern char opcref;
  1201. extern UCHAR opcbase;
  1202. extern long oEndPass1;
  1203. extern UCHAR xltftypetolen[];
  1204. extern UCHAR xoptoseg[];
  1205. extern char *begatom;
  1206. extern USHORT blocklevel;
  1207. extern OFFSET clausesize;
  1208. extern USHORT condlevel; /* conditional level */
  1209. extern USHORT count;
  1210. extern USHORT codeview;
  1211. extern USHORT crefcount;
  1212. extern USHORT datadsize[];
  1213. extern USHORT duplevel; /* indent for dup listing */
  1214. extern char *endatom;
  1215. extern USHORT errornum; /* error count */
  1216. extern USHORT externnum;
  1217. extern UCHAR fPutFirstOp;
  1218. extern USHORT fltfixmisc[9][2];
  1219. extern USHORT fltselect[4][2];
  1220. extern USHORT groupnum;
  1221. extern USHORT lastcondon;
  1222. extern UCHAR linelength; /* length of line */
  1223. extern USHORT lnameIndex;
  1224. extern USHORT localbase;
  1225. extern USHORT macrolevel;
  1226. extern USHORT operprec;
  1227. extern USHORT pagelength;
  1228. extern USHORT pageline;
  1229. extern USHORT pagewidth;
  1230. extern OFFSET pcmax;
  1231. extern OFFSET pcoffset;
  1232. extern USHORT segidx;
  1233. extern USHORT segmentnum;
  1234. extern USHORT typeIndex;
  1235. extern USHORT temp;
  1236. extern OFFSET val;
  1237. extern USHORT varsize;
  1238. extern USHORT warnnum; /* warning count */
  1239. extern USHORT warnlevel; /* warning level */
  1240. extern USHORT warnCode;
  1241. extern USHORT xltsymtoresult[];
  1242. extern OFFSET CondJmpDist; /* conditional jump distance (for error) */
  1243. extern char segName[];
  1244. extern char procName[];
  1245. # ifdef M8086
  1246. extern char qname[]; /* native coded in asmhelp.asm */
  1247. extern char qlcname[]; /* "" */
  1248. extern char qsvname[]; /* "" */
  1249. extern char qsvlcname[]; /* "" */
  1250. extern SHORT objerr;
  1251. extern char srceof;
  1252. extern char fNotStored;
  1253. extern USHORT obufsiz;
  1254. # endif /* M8086 */
  1255. extern struct objfile obj;
  1256. extern FCB * pFCBCur; /* Current file being read */
  1257. #ifdef BCBOPT
  1258. extern BCB * pBCBAvail; /* List of deallocatable file buffers */
  1259. extern FCB * pFCBInc; /* Next include file */
  1260. extern UCHAR fBuffering; /* TRUE if storing lines for pass 2 */
  1261. #endif
  1262. extern FCB * pFCBMain; /* main file */
  1263. # ifndef XENIX286
  1264. extern char terse;
  1265. # endif
  1266. #ifndef V386
  1267. #define wordsize 2 /* becomes a constant for 16 bit only segments */
  1268. #else
  1269. extern SHORT wordsize;
  1270. #endif
  1271. #endif /* ASMGLOBAL */