home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / inc / cmacros.inc < prev    next >
Text File  |  1999-03-15  |  25KB  |  1,737 lines

  1. ;       SCCSID = @(#)cmacros.inc    6.1 90/11/16
  2. comment $
  3. cmacros - assembly macros for interfacing to hhls
  4. (C)Copyright Microsoft Corp. 1984-1990
  5. $
  6. .xcref
  7. .xcref ??_out
  8. ??_out macro t
  9. ifndef ?QUIET
  10. %out t
  11. endif
  12. endm
  13. outif macro name,defval,onmsg,offmsg
  14. ifndef name
  15. ifb <defval>
  16. name=0
  17. else
  18. name=defval
  19. endif
  20. endif
  21. if name
  22. name=1
  23. ifnb <onmsg>
  24. ??_out <! onmsg>
  25. endif
  26. else
  27. ifnb <offmsg>
  28. ??_out <! offmsg>
  29. endif
  30. endif
  31. endm
  32. .xcref ??error
  33. ??error macro msg
  34. %out e r r o r ----- msg
  35. .err e r r o r ----- msg
  36. endm
  37. .xcref ??error2
  38. ??error2 macro msg
  39. if2
  40. %out e r r o r ----- msg
  41. .err e r r o r ----- msg
  42. endif
  43. endm
  44. .xcref ?sps,?ps,?rps
  45. ?ps=0
  46. ?sps macro
  47. ?ps=@Cpu
  48. endm
  49. ?rps macro
  50. if ?ps and 80h
  51. if ?ps and 08h
  52. .386P
  53. else
  54. if ?ps and 04h
  55. .286P
  56. else
  57. ??error2 <Internal error -- illegal CpuMode>
  58. endif
  59. endif
  60. else
  61. if ?ps and 08h
  62. .386
  63. else
  64. if ?ps and 04h
  65. .286
  66. else
  67. if ?ps and 02h
  68. .186
  69. else
  70. if ?ps and 01h
  71. .8086
  72. else
  73. ??error2 <Internal error -- illegal CpuMode>
  74. endif
  75. endif
  76. endif
  77. endif
  78. endif
  79. if ?ps and 800h
  80. .387
  81. else
  82. if ?ps and 400h
  83. .287
  84. else
  85. if ?ps and 100h
  86. .8087
  87. else
  88. ??error2 <Internal error -- illegal CpuMode>
  89. endif
  90. endif
  91. endif
  92. endm
  93. .xcref ASMpass
  94. .xcref memS,memM,memL,memC,memH,memMOD,sizec,sized
  95. if1
  96. ASMpass=1
  97. ifdef ?SMALL
  98. memS=1
  99. endif
  100. ifdef ?MEDIUM
  101. memM=1
  102. endif
  103. ifdef ?COMPACT
  104. memC=1
  105. endif
  106. ifdef ?LARGE
  107. memL=1
  108. endif
  109. ifdef ?HUGE
  110. memH=1
  111. endif
  112. ??_out <cMacros Version 3.08 - 01/15/90>
  113. ??_out <Copyright (C) Microsoft Corp. 1984-1990. All rights reserved.>
  114. outif memS,0,<Small Model>
  115. outif memM,0,<Medium model>
  116. outif memL,0,<Large Model>
  117. outif memC,0,<Compact Model>
  118. outif memH,0,<Huge Model>
  119. memMOD= memS + memM + memL + memC + memH
  120. if memMOD ne 1
  121. if memMOD eq 0
  122. memS = 1
  123. outif memS,0,<Small model>
  124. else
  125. ??error <must have only 1 memory model selected>
  126. endif
  127. endif
  128. sizec= memM + memL + memH
  129. sized= memL + memC + (memH*2)
  130. outif ?DF,0,<No segments or groups will be defined>
  131. outif ?TF,0,<Epilog sequences assume valid SP>
  132. outif ?WIN,1,<Windows support>
  133. outif ?PLM,1,<PL/M calling convention>
  134. ifndef ?NODATA
  135. ?nodata1=0
  136. else
  137. ?nodata1=1
  138. ??_out <! NODATA module>
  139. endif
  140. ifndef ?CHKSTK
  141. ?chkstk1=0
  142. else
  143. ?chkstk1=1
  144. ifdef ?CHKSTKPROC
  145. ??_out <! Private stack checking enabled>
  146. else
  147. ??_out <! Stack checking enabled>
  148. endif
  149. endif
  150. ifndef DOS5
  151. ?DOS5=0
  152. else
  153. ?DOS5=1
  154. ??_out <! DOS5 module>
  155. endif
  156. ifdef ?PROFILE
  157. ??_out <! Native profiling enabled>
  158. endif
  159. ifdef ATTRPROF
  160. ??_out <! Attributed profiling enabled>
  161. ?aprof1=1
  162. else
  163. ?aprof1=0
  164. endif
  165. ifndef ?NO_BP
  166. ?no_bp1=0
  167. else
  168. ?no_bp1=1
  169. ??_out <! NO_BP is default>
  170. endif
  171. ifndef ?REG32
  172. ?bigreg=0
  173. else
  174. ?bigreg=1
  175. ??_out <! 32-bit registers recognized.>
  176. endif
  177. ifndef ?ENTER
  178. ?enter1=0
  179. else
  180. ?enter1=1
  181. ??_out <! ENTER/LEAVE module>
  182. endif
  183. ifdef ?USE32
  184. ?u32=1
  185. .xcref ?u32
  186. endif
  187. ifdef ?USE16
  188. ?u32=0
  189. .xcref ?u32
  190. endif
  191. else
  192. ASMpass=2
  193. endif
  194. .xcref ?n,?ax,?ah,?al,?bx,?bh
  195. .xcref ?bl,?cx,?ch,?cl,?dx,?dh
  196. .xcref ?dl,?si,?di,?es,?ds,?bp
  197. .xcref ?sp,?ss,?cs
  198. .xcref ?n,?AX,?AH,?AL,?BX,?BH
  199. .xcref ?BL,?CX,?CH,?CL,?DX,?DH
  200. .xcref ?DL,?SI,?DI,?ES,?DS,?BP
  201. .xcref ?SP,?SS,?CS
  202. if ?bigreg
  203. .xcref ?eax,?ebx,?ecx,?edx,?esi,?edi
  204. .xcref ?ebp,?esp,?fs,?gs
  205. .xcref ?EAX,?EBX,?ECX,?EDX,?ESI,?EDI
  206. .xcref ?EBP,?ESP,?FS,?GS
  207. endif
  208. .xcref ?rsl,?cpd,?argl,?argc,?ba
  209. .xcref ?acb,???,?po
  210. .xcref ?pas,?pc
  211. .xcref uconcat,mpush,mpop
  212. .xcref ?ri,?pp,?pp1,?al1
  213. .xcref ?ad,?ap,?atal,?dd,?dd1,?dd2
  214. .xcref ?pg,?pg1,?aloc,?cs1,?cs2
  215. .xcref ?DF,?TF,?ff,?PLM,?WIN,?ia,?pu,?adj
  216. .xcref ?uf,?rp,?nx,?nd,?nodata1,?chkstk1,?aprof1,?aprof2,?DOS5
  217. .xcref ?wfp,arg,cCall,cProc,assumes,?cs3,?cs2,?cs1
  218. .xcref defgrp,addseg,createSeg
  219. .xcref save,outif,errnz,errn$,errnz1
  220. .xcref ?PLMPrevParm,?gcc
  221. .xcref ?cCall1,?pcc,?no_bp1,?no_bp2,?bigreg,?enter1
  222. .xcref ?cbe,?pcbe
  223. ?rsl = 0
  224. ?cpd = 0
  225. ?argl = 0
  226. ?argc = 0
  227. ?ba = 0
  228. ?acb = 0
  229. ??? = 0
  230. ?po = 0
  231. ?pas = 0
  232. ?pc = 0
  233. ?ia = 0
  234. ?pu = 0
  235. ?adj = 0
  236. ?rp = 0
  237. ?uf = 0
  238. ?nd = 0
  239. ?ent = 0
  240. ?nx = 0
  241. ?wfp = 0
  242. ?ff = 0
  243. ?dd2 = 0
  244. ?cCall1 = 0
  245. ?pcc = ?PLM
  246. ?PLMPrevParm = 0
  247. ?no_bp2 = ?no_bp1
  248. ?cbe = 0
  249. ?aprof2 = 0
  250. .xcref ?casen
  251. if1
  252. ?casen = 0
  253. endif
  254. ?n = 0000000000000000b
  255. ?ax = 0000000000000011b
  256. ?ah = 0000000000000001b
  257. ?al = 0000000000000010b
  258. ?bx = 0000000000001100b
  259. ?bh = 0000000000000100b
  260. ?bl = 0000000000001000b
  261. ?cx = 0000000000110000b
  262. ?ch = 0000000000010000b
  263. ?cl = 0000000000100000b
  264. ?dx = 0000000011000000b
  265. ?dh = 0000000001000000b
  266. ?dl = 0000000010000000b
  267. ?si = 0000000100000000b
  268. ?di = 0000001000000000b
  269. ?es = 0000010000000000b
  270. ?ds = 0000100000000000b
  271. ?bp = 0001000000000000b
  272. ?sp = 0010000000000000b
  273. ?ss = 0100000000000000b
  274. ?cs = 1000000000000000b
  275. if ?bigreg
  276. ?sps
  277. .386p
  278. ?eax = 10000000000000000b
  279. ?ebx = 100000000000000000b
  280. ?ecx = 1000000000000000000b
  281. ?edx = 10000000000000000000b
  282. ?esi = 100000000000000000000b
  283. ?edi = 1000000000000000000000b
  284. ?ebp = 10000000000000000000000b
  285. ?esp = 100000000000000000000000b
  286. ?fs = 1000000000000000000000000b
  287. ?gs = 10000000000000000000000000b
  288. ?rps
  289. endif
  290. ?AX = 0000000000000011b
  291. ?AH = 0000000000000001b
  292. ?AL = 0000000000000010b
  293. ?BX = 0000000000001100b
  294. ?BH = 0000000000000100b
  295. ?BL = 0000000000001000b
  296. ?CX = 0000000000110000b
  297. ?CH = 0000000000010000b
  298. ?CL = 0000000000100000b
  299. ?DX = 0000000011000000b
  300. ?DH = 0000000001000000b
  301. ?DL = 0000000010000000b
  302. ?SI = 0000000100000000b
  303. ?DI = 0000001000000000b
  304. ?ES = 0000010000000000b
  305. ?DS = 0000100000000000b
  306. ?BP = 0001000000000000b
  307. ?SP = 0010000000000000b
  308. ?SS = 0100000000000000b
  309. ?CS = 1000000000000000b
  310. if ?bigreg
  311. ?sps
  312. .386p
  313. ?EAX = 10000000000000000b
  314. ?EBX = 100000000000000000b
  315. ?ECX = 1000000000000000000b
  316. ?EDX = 10000000000000000000b
  317. ?ESI = 100000000000000000000b
  318. ?EDI = 1000000000000000000000b
  319. ?EBP = 10000000000000000000000b
  320. ?ESP = 100000000000000000000000b
  321. ?FS = 1000000000000000000000000b
  322. ?GS = 10000000000000000000000000b
  323. ?rps
  324. endif
  325. .cref
  326. uconcat macro a,b,c,d,e,f,g
  327. a&b c&d e&f&g
  328. endm
  329. mpush macro r
  330. if ?bigreg
  331. ?sps
  332. .386p
  333. irp x,<ax,bx,cx,dx,si,di,bp,sp>
  334. if (r and ?e&&x)
  335.     push    e&&x
  336. else
  337. if (r and ?&&x)
  338.     push    x
  339. endif
  340. endif
  341. endm
  342. irp x,<es,ds,ss,cs,fs,gs>
  343. if (r and ?&&x)
  344.     push    x
  345. endif
  346. endm
  347. ?rps
  348. else
  349. irp x,<ax,bx,cx,dx,si,di,es,ds,bp,sp,ss,cs>
  350. if (r and ?&&x)
  351.     push    x
  352. endif
  353. endm
  354. endif
  355. endm
  356. mpop macro r
  357. if ?bigreg
  358. ?sps
  359. .386p
  360. irp x,<gs,fs,cs,ss,ds,es>
  361. if (r and ?&&x)
  362.     pop    x
  363. endif
  364. endm
  365. irp x,<sp,bp,di,si,dx,cx,bx,ax>
  366. if (r and ?e&&x)
  367.     pop    e&&x
  368. else
  369. if (r and ?&&x)
  370.     pop    x
  371. endif
  372. endif
  373. endm
  374. ?rps
  375. else
  376. irp x,<cs,ss,sp,bp,ds,es,di,si,dx,cx,bx,ax>
  377. if (r and ?&&x)
  378.     pop    x
  379. endif
  380. endm
  381. endif
  382. endm
  383. save macro r
  384. ?rsl=0
  385. ?ri ?rsl,<r>
  386. endm
  387. ?ri macro n,r
  388. irp x,<r>
  389. ifdef ?&&x
  390. n=n or ?&&x
  391. else
  392. ??error2 <unknown register x>
  393. .err
  394. endif
  395. endm
  396. endm
  397. .xcref
  398. .xcref parmB,parmW,parmD,parmQ,parmT,parmCP,parmDP,parmH
  399. .cref
  400. parmB macro n
  401. ?pp <n>,<byte>,2,1
  402. endm
  403. parmW macro n
  404. ?pp <n>,<word>,2,2
  405. endm
  406. parmD macro n
  407. ife ?pcc
  408. irp x,<n>
  409. ?pp <&&x>,<dword>,0,4
  410. ?pp <off_&&x>,<word>,2,2
  411. ?pp <seg_&&x>,<word>,2,2
  412. endm
  413. else
  414. irp x,<n>
  415. ?pp <seg_&&x>,<word>,2,2
  416. ?pp <off_&&x>,<word>,2,2
  417. ?pp <&&x>,<dword>,0,4
  418. endm
  419. endif
  420. endm
  421. parmH macro n
  422. ?pp <n>,<word>,4,2
  423. endm
  424. parmQ macro n
  425. ?pp <n>,<qword>,8,8
  426. endm
  427. parmT macro n
  428. ?pp <n>,<tbyte>,10,10
  429. endm
  430. if sizec
  431. parmCP macro n
  432. parmD <n>
  433. endm
  434. else
  435. parmCP macro n
  436. parmW <n>
  437. endm
  438. endif
  439. if sized
  440. parmDP macro n
  441. parmD <n>
  442. endm
  443. else
  444. parmDP macro n
  445. parmW <n>
  446. endm
  447. endif
  448. ?pp macro n,t,l,s
  449. if ?cpd
  450. .xcref
  451. irp x,<n>
  452. .xcref ?t_&&x
  453. ?t_&&x=s
  454. ife ?pcc
  455. ?pp1 x,<t>,,,%(?po+?adj)
  456. ?po=?po+l
  457. else
  458. ?PLMPrevParm=?PLMPrevParm+1
  459. ?po=?po+l
  460. ?pp1 x,<t>,%?po,%?adj,,%?PLMPrevParm,%(?PLMPrevParm-1)
  461. endif
  462. endm
  463. .cref
  464. else
  465. ??error2 <parm(s) "&n" declared outside proc def>
  466. endif
  467. endm
  468. ?pp1 macro n,t,o,a,b,cpc,ppc
  469. ife ?pcc
  470. if ?no_bp2
  471. n equ (t ptr [+b])
  472. else
  473. n equ (t ptr [bp][+b])
  474. endif
  475. else
  476. .xcref
  477. .xcref ?PLMParm&cpc
  478. .cref
  479. if ?no_bp2
  480. ?PLMParm&cpc ¯o po
  481. uconcat <n>,,<equ>,,<(t ptr [+>,%(a+po-o),<])>
  482. ?PLMParm&ppc po
  483. purge ?PLMParm&cpc
  484. &endm
  485. else
  486. ?PLMParm&cpc ¯o po
  487. uconcat <n>,,<equ>,,<(t ptr [bp][+>,%(a+po-o),<])>
  488. ?PLMParm&ppc po
  489. purge ?PLMParm&cpc
  490. &endm
  491. endif
  492. endif
  493. endm
  494. ifndef ?NOPARMR
  495. .xcref
  496. .xcref ?pr,parmR
  497. .cref
  498. parmR macro n,r,r2
  499. ?pr n,r,r2,%?rp,%(?ia+2)
  500. endm
  501. ?pr macro n,r,r2,i,o
  502. .xcref
  503. ifnb <r2>
  504. parmR seg_&n,r
  505. parmR off_&n,r2
  506. if ?no_bp2
  507. n equ (dword ptr [-o-2])
  508. else
  509. n equ (dword ptr [bp][-o-2])
  510. endif
  511. .xcref ?t_&n
  512. ?t_&n=4
  513. else
  514. .xcref ?rp&i
  515. ?rp&i=0
  516. ifdef ?&r
  517. ?rp&i=?&r
  518. endif
  519. if ??? or (?cpd eq 0) or (?rp&i eq 0)
  520. ??error2 <invalid parmR encountered: &n,&r>
  521. exitm
  522. endif
  523. if ?no_bp2
  524. n equ (word ptr [-o])
  525. else
  526. n equ (word ptr [bp][-o])
  527. endif
  528. .xcref ?t_&n
  529. ?t_&n=2
  530. irp x,<bh,ch,dh,bl,cl,dl,ah,al>
  531. if ?&&x eq ?&r
  532. if ?no_bp2
  533. n equ (byte ptr [-o])
  534. else
  535. n equ (byte ptr [bp][-o])
  536. endif
  537. ?t_&n=1
  538. exitm
  539. endif
  540. endm
  541. ?ia=?ia+2
  542. ?rp=?rp+1
  543. endif
  544. .cref
  545. endm
  546. endif
  547. .xcref
  548. .xcref localB,localW,localD,localQ,localT,localCP,localDP,localV
  549. .cref
  550. localB macro n
  551. ?aloc <n>,<byte ptr>,1,1,0
  552. endm
  553. localW macro n
  554. ?aloc <n>,<word ptr>,2,2,1
  555. endm
  556. localD macro n
  557. irp x,<n>
  558. ?aloc <seg_&&x>,<word ptr>,2,2,1
  559. ?aloc <off_&&x>,<word ptr>,2,2,1
  560. ?aloc <&&x>,<dword ptr>,0,4,1
  561. endm
  562. endm
  563. localQ macro n
  564. ?aloc <n>,<qword ptr>,8,8,1
  565. endm
  566. localT macro n
  567. ?aloc <n>,<tbyte ptr>,10,10,1
  568. endm
  569. if sizec
  570. localCP macro n
  571. localD <n>
  572. endm
  573. else
  574. localCP macro n
  575. localW <n>
  576. endm
  577. endif
  578. if sized
  579. localDP macro n
  580. localD <n>
  581. endm
  582. else
  583. localDP macro n
  584. localW <n>
  585. endm
  586. endif
  587. localV macro n,a
  588. ?aloc <n>,,%(a),0,1
  589. endm
  590. ?aloc macro n,t,l,s,a
  591. if ?cpd
  592. .xcref
  593. irp x,<n>
  594. ???=???+l
  595. if a
  596. ???=((??? + 1) and 0fffeh)
  597. endif
  598. ?al1 x,<t>,%(???+?ia)
  599. .xcref ?t_&&x
  600. ?t_&&x=s
  601. endm
  602. .cref
  603. else
  604. ??error2 <locals "&n" declared outside procedure def>
  605. endif
  606. endm
  607. ?al1 macro n,t,o
  608. if ?no_bp2
  609. n equ (t [-o])
  610. else
  611. n equ (t [bp][-o])
  612. endif
  613. endm
  614. ?gcc macro s,i,cc
  615. s = i
  616. ifnb <cc>
  617. ifidn <cc>,<C>
  618. s=0
  619. endif
  620. ifidn <cc>,<PLM>
  621. s=1
  622. endif
  623. ifidn <cc>,<PASCAL>
  624. s=1
  625. endif
  626. endif
  627. endm
  628. ifndef ?NOGLOBAL
  629. .xcref
  630. .xcref globalB,globalW,globalD,globalQ,globalT,globalCP,globalDP
  631. .cref
  632. globalB macro n,i,s,c
  633. ?ad <n>,1
  634. ?dd n,1,<byte>,<db>,<i>,<s>,<c>
  635. endm
  636. globalW macro n,i,s,c
  637. ?ad <n>,2
  638. ?dd n,1,<word>,<dw>,<i>,<s>,<c>
  639. endm
  640. globalD macro n,i,s,c
  641. ?ad <n>,4
  642. ?dd n,1,<dword>,<dd>,<i>,<s>,<c>
  643. off_&n equ word ptr n[0]
  644. seg_&n equ word ptr n[2]
  645. endm
  646. globalQ macro n,i,s,c
  647. ?ad <n>,8
  648. ?dd n,1,<qword>,<dq>,<i>,<s>,<c>
  649. endm
  650. globalT macro n,i,s,c
  651. ?ad <n>,10
  652. ?dd n,1,<tbyte>,<dt>,<i>,<s>,<c>
  653. endm
  654. if sizec
  655. globalCP macro n,i,s,c
  656. globalD n,<i>,<s>,<c>
  657. endm
  658. else
  659. globalCP macro n,i,s,c
  660. globalW n,<i>,<s>,<c>
  661. endm
  662. endif
  663. if sized
  664. globalDP macro n,i,s,c
  665. globalD n,<i>,<s>,<c>
  666. endm
  667. else
  668. globalDP macro n,i,s,c
  669. globalW n,<i>,<s>,<c>
  670. endm
  671. endif
  672. endif
  673. ifndef ?NOSTATIC
  674. .xcref
  675. .xcref staticB,staticW,staticD,staticQ,staticT,staticCP,staticDP
  676. .cref
  677. staticB macro n,i,s
  678. ?ad <n>,1
  679. ?dd n,0,<byte>,<db>,<i>,<s>,<PLM>
  680. endm
  681. staticW macro n,i,s
  682. ?ad <n>,2
  683. ?dd n,0,<word>,<dw>,<i>,<s>,<PLM>
  684. endm
  685. staticD macro n,i,s
  686. ?ad <n>,4
  687. ?dd n,0,<dword>,<dd>,<i>,<s>,<PLM>
  688. endm
  689. staticQ macro n,i,s
  690. ?ad <n>,8
  691. ?dd n,0,<qword>,<dq>,<i>,<s>,<PLM>
  692. endm
  693. staticT macro n,i,s
  694. ?ad <n>,10
  695. ?dd n,0,<tbyte>,<dt>,<i>,<s>,<PLM>
  696. endm
  697. if sizec
  698. staticCP macro n,i,s
  699. staticD n,<i>,<s>
  700. endm
  701. else
  702. staticCP macro n,i,s
  703. staticW n,<i>,<s>
  704. endm
  705. endif
  706. if sized
  707. staticDP macro n,i,s
  708. staticD n,<i>,<s>
  709. endm
  710. else
  711. staticDP macro n,i,s
  712. staticW n,<i>,<s>
  713. endm
  714. endif
  715. endif
  716. ?dd macro n,p,t,d,i,s,c
  717. ?gcc ?dd2,%?PLM,<c>
  718. ife ?dd2
  719. n label t
  720. ?dd1 _&n,p,<d>,<i>,<s>
  721. else
  722. ?dd1 n,p,<d>,<i>,<s>
  723. endif
  724. endm
  725. ?dd1 macro n,p,d,i,s
  726. if p
  727. public n
  728. endif
  729. ifb <s>
  730. n d i
  731. else
  732. ifb <i>
  733. n d s dup (?)
  734. else
  735. n d s dup (i)
  736. endif
  737. endif
  738. endm
  739. ifndef ?NOEXTERN
  740. .xcref
  741. .xcref ?ex1,?ex2,externB,externW,externD,externQ,externT
  742. .xcref externNP,externFP,externP,externCP,externDP,externA
  743. .cref
  744. ?ex2 = 0
  745. externA macro n,c
  746. ?ex1 <n>,40h,<abs>,<c>,<>
  747. endm
  748. externB macro n,c
  749. ?ex1 <n>,1,<byte>,<c>,<>
  750. endm
  751. externW macro n,c
  752. ?ex1 <n>,2,<word>,<c>,<>
  753. endm
  754. externD macro n,c
  755. ?ex1 <n>,4,<dword>,<c>,<>
  756. endm
  757. externQ macro n,c
  758. ?ex1 <n>,8,<qword>,<c>,<>
  759. endm
  760. externT macro n,c
  761. ?ex1 <n>,10,<tbyte>,<c>,<>
  762. endm
  763. externNP macro n,c
  764. ?ex1 <n>,2,<near>,<c>,<cc>
  765. endm
  766. externFP macro n,c
  767. ?ex1 <n>,4,<far>,<c>,<cc>
  768. endm
  769. if sizec
  770. externP macro n,c
  771. ?ex1 <n>,4,<far>,<c>,<cc>
  772. endm
  773. else
  774. externP macro n,c
  775. ?ex1 <n>,2,<near>,<c>,<cc>
  776. endm
  777. endif
  778. if sizec
  779. externCP macro n,c
  780. ?ex1 <n>,4,<dword>,<c>,<>
  781. endm
  782. else
  783. externCP macro n,c
  784. ?ex1 <n>,2,<word>,<c>,<>
  785. endm
  786. endif
  787. if sized
  788. externDP macro n,c
  789. ?ex1 <n>,4,<dword>,<c>,<>
  790. endm
  791. else
  792. externDP macro n,c
  793. ?ex1 <n>,2,<word>,<c>,<>
  794. endm
  795. endif
  796. ?ex1 macro n,s,d,c,scv
  797. ?gcc ?ex2,%?PLM,<c>
  798. irp x,<n>
  799. .xcref
  800. .xcref ?t_&&x
  801. .cref
  802. ?t_&&x=s
  803. ife ?ex2
  804. extrn _&&x:&d
  805. x equ _&&x
  806. else
  807. extrn x:&d
  808. endif
  809. ifidn <scv>,<cc>
  810. .xcref
  811. .xcref ?CC&&x
  812. .cref
  813. ?CC&&x=?ex2
  814. endif
  815. endm
  816. endm
  817. endif
  818. ifndef ?NOLABEL
  819. .xcref
  820. .xcref ?lb1,?lblpu,?lb2
  821. .xcref labelB,labelW,labelD,labelQ,labelT
  822. .xcref labelNP,labelFP,labelP,labelCP,labelDP
  823. .cref
  824. ?lblpu = 0
  825. ?lb2 = 0
  826. labelB macro n,c
  827. ?lb1 <n>,1,<byte>,<c>
  828. endm
  829. labelW macro n,c
  830. ?lb1 <n>,2,<word>,<c>
  831. endm
  832. labelD macro n,c
  833. ?lb1 <n>,4,<dword>,<c>
  834. endm
  835. labelQ macro n,c
  836. ?lb1 <n>,8,<qword>,<c>
  837. endm
  838. labelT macro n,c
  839. ?lb1 <n>,10,<tbyte>,<c>
  840. endm
  841. labelNP macro n,c
  842. ?lb1 <n>,2,<near>,<c>
  843. endm
  844. labelFP macro n,c
  845. ?lb1 <n>,4,<far>,<c>
  846. endm
  847. if sizec
  848. labelP macro n,c
  849. ?lb1 <n>,4,<far>,<c>
  850. endm
  851. else
  852. labelP macro n,c
  853. ?lb1 <n>,2,<near>,<c>
  854. endm
  855. endif
  856. if sizec
  857. labelCP macro n,c
  858. ?lb1 <n>,4,<dword>,<c>
  859. endm
  860. else
  861. labelCP macro n,c
  862. ?lb1 <n>,2,<word>,<c>
  863. endm
  864. endif
  865. if sized
  866. labelDP macro n,c
  867. ?lb1 <n>,4,<dword>,<c>
  868. endm
  869. else
  870. labelDP macro n,c
  871. ?lb1 <n>,2,<word>,<c>
  872. endm
  873. endif
  874. ?lb1 macro n,s,d,c
  875. ?gcc ?lb2,%?PLM,<c>
  876. ?lblpu=0
  877. irp x,<n>
  878. ifidn <x>,<PUBLIC>
  879. ?lblpu=1
  880. else
  881. .xcref
  882. .xcref ?t_&&x
  883. .cref
  884. ?t_&&x=s
  885. ife ?lb2
  886. if ?lblpu
  887. public _&&x
  888. endif
  889. _&&x label &d
  890. x equ _&&x
  891. else
  892. if ?lblpu
  893. public x
  894. endif
  895. x label &d
  896. endif
  897. endif
  898. endm
  899. endm
  900. endif
  901. ifndef ?NODEF
  902. .xcref
  903. .xcref defB,defW,defD,defQ,defT,defCP,defDP
  904. .cref
  905. defB macro n
  906. ?ad <n>,1
  907. endm
  908. defW macro n
  909. ?ad <n>,2
  910. endm
  911. defD macro n
  912. ?ad <n>,4
  913. endm
  914. defQ macro n
  915. ?ad <n>,8
  916. endm
  917. defT macro n
  918. ?ad <n>,10
  919. endm
  920. if sizec
  921. defCP macro n
  922. defD <n>
  923. endm
  924. else
  925. defCP macro n
  926. defW <n>
  927. endm
  928. endif
  929. if sized
  930. defDP macro n
  931. defD <n>
  932. endm
  933. else
  934. defDP macro n
  935. defW <n>
  936. endm
  937. endif
  938. endif
  939. ?ad macro n,s
  940. irp x,<n>
  941. .xcref
  942. .xcref ?t_&&x
  943. .cref
  944. ?t_&&x=s
  945. endm
  946. endm
  947. ifndef ?NOPTR
  948. .xcref
  949. .xcref regPtr,farPtr
  950. .cref
  951. regPtr macro n,s,o
  952. farPtr n,s,o
  953. endm
  954. farPtr macro n,s,o
  955. .xcref
  956. .xcref ?t_&n
  957. .cref
  958. n ¯o
  959.     push    s
  960.     push    o
  961. &endm
  962. ?t_&n=80h
  963. endm
  964. endif
  965. arg macro a
  966. irp x,<a>
  967. ?argc=?argc+1
  968. ?atal <x>,%?argc
  969. endm
  970. endm
  971. ?atal macro n,i
  972. .xcref
  973. .xcref ?ali&i
  974. .cref
  975. ?ali&i ¯o
  976. ?ap <n>
  977. &endm
  978. endm
  979. ?ap macro n
  980. ?argl=?argl+2
  981. ifdef ?t_&n
  982. ife ?t_&n-1
  983.     push    word ptr (n)
  984. exitm
  985. endif
  986. ife ?t_&n-2
  987.     push    n
  988. exitm
  989. endif
  990. ife ?t_&n-4
  991. if ?bigreg
  992. ?sps
  993. .386p
  994.     push    dword ptr (n)
  995. ?rps
  996. else
  997.     push    word ptr (n)[2]
  998.     push    word ptr (n)
  999. endif
  1000. ?argl=?argl+2
  1001. exitm
  1002. endif
  1003. ife ?t_&n-8
  1004. if ?bigreg
  1005. ?sps
  1006. .386p
  1007.     push    dword ptr (n)[4]
  1008.     push    dword ptr (n)
  1009. ?rps
  1010. else
  1011.     push    word ptr (n)[6]
  1012.     push    word ptr (n)[4]
  1013.     push    word ptr (n)[2]
  1014.     push    word ptr (n)
  1015. endif
  1016. ?argl=?argl+6
  1017. exitm
  1018. endif
  1019. if ?t_&n and 80h
  1020. n
  1021. ?argl=?argl+2
  1022. exitm
  1023. endif
  1024. ife ?t_&n
  1025.     push    word ptr (n)
  1026. exitm
  1027. endif
  1028. endif
  1029.     push    n
  1030. endm
  1031. cCall macro n,a,c
  1032. ifnb <a>
  1033. arg <a>
  1034. endif
  1035. mpush %?rsl
  1036. ifdef ?CC&n
  1037. ?cCall1=?CC&n
  1038. else
  1039. ?cCall1=?PLM
  1040. endif
  1041. ifnb <c>
  1042. ?gcc ?cCall1,%?cCall1,<c>
  1043. endif
  1044. ?argl=0
  1045. ife ?cCall1
  1046. ?acb=?argc
  1047. else
  1048. ?acb=1
  1049. endif
  1050. rept ?argc
  1051. uconcat <?ali>,%?acb
  1052. uconcat <purge>,,<?ali>,%?acb
  1053. ife ?cCall1
  1054. ?acb=?acb-1
  1055. else
  1056. ?acb=?acb+1
  1057. endif
  1058. endm
  1059.     call    n
  1060. if ((?cCall1 eq 0) and (?argl ne 0))
  1061.     add    sp,?argl
  1062. endif
  1063. mpop %?rsl
  1064. ?rsl=0
  1065. ?argc= 0
  1066. ?argl= 0
  1067. endm
  1068. cProc macro n,cf,a
  1069. if ?cpd
  1070. ?utpe
  1071. endif
  1072. ?cpd=1
  1073. ???=0
  1074. ?argc=0
  1075. ?ba=0
  1076. ?po=0
  1077. ?pu=0
  1078. ?ia=0
  1079. ?adj=4
  1080. ?rp=0
  1081. ?uf=0
  1082. ?wfp=?WIN
  1083. ?ff=0
  1084. ?pas=0
  1085. ?pcc=?PLM
  1086. ?no_bp2=?no_bp1
  1087. ?aprof2=?aprof1
  1088. ifnb <a>
  1089. ?ri ?pas,<a>
  1090. endif
  1091. ?pc=sizec
  1092. ?nd=?nodata1
  1093. ?ent=?enter1
  1094. ?nx=0
  1095. irp x,<cf>
  1096. ifdef ??_cproc_&&x
  1097. ??_cproc_&&x
  1098. else
  1099. ??error2 <e r r o r - unknown keyword x>
  1100. .err
  1101. endif
  1102. endm
  1103. if ?pcc
  1104. ?PLMPrevParm=0
  1105. .xcref
  1106. .xcref ?PLMParm0
  1107. .cref
  1108. ?PLMParm0 ¯o
  1109. purge ?PLMParm0
  1110. &endm
  1111. endif
  1112. .xcref
  1113. .xcref ?CC&n
  1114. .cref
  1115. ?CC&n=?pcc
  1116. if (?nx eq 1) and (?nd eq 0)
  1117. ?nx = 0
  1118. ??error2 <ATOMIC specified without NODATA - ATOMIC ignored>
  1119. endif
  1120. if ?ent
  1121. if ?wfp
  1122. ?ent = 0
  1123. ??error2 <ENTER specified without NONWIN - ENTER ignored>
  1124. endif
  1125. if ?uf
  1126. ?ent = 0
  1127. ??error2 <ENTER specified with user frame - ENTER ignored>
  1128. endif
  1129. if ?chkstk1
  1130. ?ent = 0
  1131. ??error2 <ENTER specified with stack checking - ENTER ignored>
  1132. endif
  1133. endif
  1134. if ?pc
  1135. if ?wfp
  1136. ife ?nx
  1137. ?ia=2
  1138. ?pas = ?pas and (not ?ds)
  1139. endif
  1140. endif
  1141. ?adj=?adj+2
  1142. else
  1143. ?wfp=0
  1144. endif
  1145. ?pas = ?pas and (not (?sp+?cs+?ss))
  1146. if ?bigreg
  1147. ?pas = ?pas and (not (?esp))
  1148. endif
  1149. if ?uf
  1150. ?pas = ?pas and (not (?bp+?si+?di))
  1151. if ?bigreg
  1152. ?pas = ?pas and (not (?ebp+?esi+?edi))
  1153. endif
  1154. endif
  1155. ife ?pcc
  1156. ?pg <_&n>,%?pu,%?pc,%?pas,%?wfp,<n>,%?pcc
  1157. else
  1158. ?pg <n>,%?pu,%?pc,%?pas,%?wfp,<n>,%?pcc
  1159. endif
  1160. endm
  1161. ?pg macro n,p,c,a,w,nnu,cc
  1162. .xcref
  1163. if ?uf
  1164. if ?nd
  1165. ??error2 <NODATA encountered in &n - user frame ignored>
  1166. ?uf=0
  1167. endif
  1168. endif
  1169. .xcref cBegin
  1170. cBegin ¯o g
  1171. .xcref
  1172. if cc
  1173. uconcat <?PLMParm>,%?PLMPrevParm,%?po
  1174. endif
  1175. if ?rp
  1176. if ?uf
  1177. ??error2 <parmR encountered in &n - user frame ignored>
  1178. ?uf=0
  1179. endif
  1180. if ?ent
  1181. ??error2 <parmR encountered in &n - ENTER ignored>
  1182. ?ent=0
  1183. endif
  1184. endif
  1185. ?pg1 <n>,c,a,%?po,w,%?uf,%?nd,%?rp,cc,<nnu>,%???
  1186. ?cpd=0
  1187. ?argc=0
  1188. ?ba=1
  1189. ???=(???+1) and 0fffeh
  1190. if p
  1191. public n
  1192. endif
  1193. ife c
  1194. n proc near
  1195. else
  1196. n proc far
  1197. endif
  1198. ife cc
  1199. nnu equ n
  1200. endif
  1201. ?cbe = 0
  1202. ifnb <g>
  1203. ?pcbe <g>,<nnu>,<cBegin>
  1204. endif
  1205. if ?cbe eq 1
  1206. if ???+a+?rp
  1207. if2
  1208. ??_out <cBegin - possibly invalid use of nogen>
  1209. endif
  1210. endif
  1211. else
  1212. if ?uf
  1213. ?mf c,%???,%?po
  1214. mpush a
  1215. else
  1216. ife ?cbe
  1217. if w
  1218. ife ?nd
  1219. ife ?DOS5
  1220.     mov    ax,ds
  1221.     nop
  1222. else
  1223.     mov    ax,DataBASE
  1224. endif
  1225. endif
  1226. if ?aprof2
  1227.     call    AProfCall
  1228. endif
  1229. ife ?nx
  1230. ife ?DOS5
  1231.     inc    bp
  1232. endif
  1233.     push    bp
  1234.     mov    bp,sp
  1235.     push    ds
  1236. else
  1237. if ?ff+???+?po+?rp
  1238.     push    bp
  1239.     mov    bp,sp
  1240. endif
  1241. endif
  1242. ife ?nd
  1243.     mov    ds,ax
  1244. endif
  1245. else
  1246. if ?aprof2
  1247.     call    AProfCall
  1248. endif
  1249. if ?ff+???+?po+?rp
  1250. ife ?ent
  1251.     push    bp
  1252.     mov    bp,sp
  1253. endif
  1254. endif
  1255. endif
  1256. if ?rp
  1257. ?uf=0
  1258. rept ?rp
  1259. uconcat mpush,,?rp,%?uf
  1260. ?uf=?uf+1
  1261. endm
  1262. endif
  1263. ife ?ent
  1264. if ???
  1265. if ?chkstk1
  1266. ifdef ?CHKSTKPROC
  1267. ?CHKSTKPROC %???
  1268. else
  1269.     mov    ax,???
  1270. ife cc
  1271.     call    _chkstk
  1272. else
  1273.     call    chkstk
  1274. endif
  1275. endif
  1276. else
  1277.     sub    sp,???
  1278. endif
  1279. endif
  1280. else
  1281. if ???
  1282. enter ???,0
  1283. else
  1284. push bp
  1285. mov bp,sp
  1286. endif
  1287. endif
  1288. else
  1289. if ?aprof2
  1290.     call    AProfRet
  1291.     call    AProfCall
  1292. endif
  1293. if ?rp
  1294. ??error2 <cBegin - parmRs encountered with partial frame>
  1295. else
  1296. if ???
  1297.     lea    sp,[bp][-???-?ia]
  1298. endif
  1299. endif
  1300. endif
  1301. mpush a
  1302. endif
  1303. ifdef ?PROFILE
  1304. if c
  1305.     call    StartNMeas
  1306. endif
  1307. endif
  1308. endif
  1309. .cref
  1310. purge cBegin
  1311. &endm
  1312. .xcref ?utpe
  1313. ?utpe ¯o
  1314. ??error2 <unterminated procedure definition: "&n">
  1315. &endm
  1316. .cref
  1317. endm
  1318. ?pg1 macro n,c,a,o,w,f,d,r,cc,nnu,lc
  1319. .xcref
  1320. .xcref cEnd
  1321. parm_bytes_&nnu = o
  1322. cEnd ¯o g
  1323. .xcref
  1324. ?ba=0
  1325. ?cbe = 0
  1326. ifnb <g>
  1327. ?pcbe <g>,<nnu>,<cEnd>
  1328. endif
  1329. if ?cbe eq 1
  1330. if a+r+lc
  1331. if2
  1332. ??_out <cEnd - possibly invalid use of nogen>
  1333. endif
  1334. endif
  1335. else
  1336. ifdef ?PROFILE
  1337. if c
  1338. call StopNMeas
  1339. endif
  1340. endif
  1341. mpop a
  1342. if f
  1343.     db    0c3h
  1344. else
  1345. if w
  1346. ife ?nx
  1347. if (?TF eq 0) or (???+r)
  1348.     lea    sp,-2[bp]
  1349. endif
  1350.     pop    ds
  1351.     pop    bp
  1352. ife ?DOS5
  1353.     dec    bp
  1354. endif
  1355. else
  1356. if (?TF eq 0) or (???+r)
  1357.     if    ???+?po+r
  1358. if ?ent
  1359. leave
  1360. else
  1361. mov sp,bp
  1362. pop bp
  1363. endif
  1364. else
  1365. mov sp,bp
  1366. endif
  1367. else
  1368. if ???+?po+r
  1369. pop bp
  1370. endif
  1371. endif
  1372. endif
  1373. else
  1374. if ?ff+???+?po+r
  1375. if (?TF eq 0) or (???+r)
  1376.     if    ?ent
  1377. leave
  1378. else
  1379. mov sp,bp
  1380. pop bp
  1381. endif
  1382. else
  1383. pop bp
  1384. endif
  1385. endif
  1386. endif
  1387. if ?aprof2
  1388.     call    AProfRet
  1389. endif
  1390. if ?cbe ne 4
  1391. ife cc
  1392.     ret
  1393. else
  1394.     ret    o
  1395. endif
  1396. endif
  1397. endif
  1398. endif
  1399. if ?cbe ne 4
  1400. n endp
  1401. .cref
  1402. purge cEnd
  1403. else
  1404. .cref
  1405. endif
  1406. &endm
  1407. .cref
  1408. endm
  1409. .xcref
  1410. .xcref cleanframe
  1411. cleanframe macro
  1412. cEnd <??cleanframe??>
  1413. endm
  1414. .cref
  1415. .xcref
  1416. .xcref ??_cproc_FAR,??_cproc_NEAR,??_cproc_PUBLIC,??_cproc_SMALL
  1417. .xcref ??_cproc_DATA,??_cproc_NODATA,??_cproc_ATOMIC,??_cproc_C
  1418. .xcref ??_cproc_PLM,??_cproc_PASCAL,??_cproc_WIN,??_cproc_NONWIN
  1419. .xcref ??_cproc_NO_BP,??_cproc_BP,??_cproc_ENTER,??_cproc_NOENTER
  1420. .xcref ??_cproc_NO_ATTRPROF,??_cproc_ATTRPROF
  1421. .xcref ??_cproc_far,??_cproc_near,??_cproc_public,??_cproc_small
  1422. .xcref ??_cproc_data,??_cproc_nodata,??_cproc_atomic,??_cproc_c
  1423. .xcref ??_cproc_plm,??_cproc_pascal,??_cproc_win,??_cproc_nonwin
  1424. .xcref ??_cproc_no_bp,??_cproc_bp,??_cproc_enter,??_cproc_noenter
  1425. .xcref ??_cproc_no_attrprof,??_cproc_attrprof
  1426. .cref
  1427. ??_cproc_FAR macro
  1428. ?pc=1
  1429. endm
  1430. ??_cproc_NEAR macro
  1431. ?pc=0
  1432. endm
  1433. ??_cproc_PUBLIC macro
  1434. ?pu=1
  1435. endm
  1436. ??_cproc_SMALL macro
  1437. ?uf=1
  1438. endm
  1439. ??_cproc_DATA macro
  1440. ?nd=0
  1441. endm
  1442. ??_cproc_NODATA macro
  1443. ?nd=1
  1444. endm
  1445. ??_cproc_ENTER macro
  1446. ?ent=1
  1447. endm
  1448. ??_cproc_NOENTER macro
  1449. ?ent=0
  1450. endm
  1451. ??_cproc_ATOMIC macro
  1452. ?nx=1
  1453. endm
  1454. ??_cproc_C macro
  1455. ?pcc=0
  1456. endm
  1457. ??_cproc_PLM macro
  1458. ?pcc=1
  1459. endm
  1460. ??_cproc_PASCAL macro
  1461. ?pcc=1
  1462. endm
  1463. ??_cproc_WIN macro
  1464. ?wfp=1
  1465. endm
  1466. ??_cproc_NONWIN macro
  1467. ?wfp=0
  1468. endm
  1469. ??_cproc_NO_BP macro
  1470. ?no_bp2=1
  1471. endm
  1472. ??_cproc_BP macro
  1473. ?no_bp2=0
  1474. endm
  1475. ??_cproc_NO_ATTRPROF macro
  1476. ?aprof2=0
  1477. endm
  1478. ??_cproc_ATTRPROF macro
  1479. ?aprof2=1
  1480. endm
  1481. ??_cproc_far macro
  1482. ?pc=1
  1483. endm
  1484. ??_cproc_near macro
  1485. ?pc=0
  1486. endm
  1487. ??_cproc_public macro
  1488. ?pu=1
  1489. endm
  1490. ??_cproc_small macro
  1491. ?uf=1
  1492. endm
  1493. ??_cproc_data macro
  1494. ?nd=0
  1495. endm
  1496. ??_cproc_nodata macro
  1497. ?nd=1
  1498. endm
  1499. ??_cproc_enter macro
  1500. ?ent=1
  1501. endm
  1502. ??_cproc_noenter macro
  1503. ?ent=0
  1504. endm
  1505. ??_cproc_atomic macro
  1506. ?nx=1
  1507. endm
  1508. ??_cproc_c macro
  1509. ?pcc=0
  1510. endm
  1511. ??_cproc_plm macro
  1512. ?pcc=1
  1513. endm
  1514. ??_cproc_pascal macro
  1515. ?pcc=1
  1516. endm
  1517. ??_cproc_win macro
  1518. ?wfp=1
  1519. endm
  1520. ??_cproc_nonwin macro
  1521. ?wfp=0
  1522. endm
  1523. ??_cproc_no_bp macro
  1524. ?no_bp2=1
  1525. endm
  1526. ??_cproc_bp macro
  1527. ?no_bp2=0
  1528. endm
  1529. ??_cproc_no_attrprof macro
  1530. ?aprof2=0
  1531. endm
  1532. ??_cproc_attrprof macro
  1533. ?aprof2=1
  1534. endm
  1535. ?pcbe macro g,nnu,mt
  1536. ifidn <g>,<NOGEN>
  1537. ?cbe = 1
  1538. else
  1539. ifidn <g>,<nogen>
  1540. ?cbe = 1
  1541. else
  1542. ifidn <mt>,<cBegin>
  1543. ifidn <g>,<PARTIAL>
  1544. ?cbe = 2
  1545. else
  1546. ifidn <g>,<partial>
  1547. ?cbe = 2
  1548. else
  1549. ifdif <g>,<nnu>
  1550. ??error2 <mt - unknown keyword g>
  1551. endif
  1552. endif
  1553. endif
  1554. else
  1555. ifidn <g>,<??cleanframe??>
  1556. ?cbe = 4
  1557. else
  1558. ifdif <g>,<nnu>
  1559. ??error2 <mt - unknown keyword g>
  1560. endif
  1561. endif
  1562. endif
  1563. endif
  1564. endif
  1565. endm
  1566. assumes macro s,ln
  1567. ifndef ln&_assumes
  1568. assume s:ln
  1569. else
  1570. ln&_assumes s
  1571. endif
  1572. endm
  1573. createSeg macro n,ln,a,co,cl,grp,u
  1574. ifnb <u>
  1575. ifnb <cl>
  1576. n segment a co u '&cl'
  1577. else
  1578. n segment a co u
  1579. endif
  1580. else
  1581. ifdef ?u32
  1582. if ?u32
  1583. ?sps
  1584. .386p
  1585. ifnb <cl>
  1586. n segment a co use32 '&cl'
  1587. else
  1588. n segment a co use32
  1589. endif
  1590. ?rps
  1591. else
  1592. ifnb <cl>
  1593. n segment a co use16 '&cl'
  1594. else
  1595. n segment a co use16
  1596. endif
  1597. endif
  1598. else
  1599. ifnb <cl>
  1600. n segment a co '&cl'
  1601. else
  1602. n segment a co
  1603. endif
  1604. endif
  1605. endif
  1606. n ends
  1607. ifnb <grp>
  1608. addseg grp,n
  1609. else
  1610. ln&OFFSET equ offset n:
  1611. ln&BASE equ n
  1612. ?cs3 <ln>,<n>
  1613. endif
  1614. ?cs1 <ln>,<n>
  1615. endm
  1616. addseg macro grp,seg
  1617. .xcref
  1618. .xcref grp&_def
  1619. .cref
  1620. ifndef grp&_def
  1621. grp&_def=0
  1622. endif
  1623. if grp&_def ne ASMpass
  1624. .xcref
  1625. .xcref grp&_add
  1626. .cref
  1627. grp&_add ¯o s
  1628. grp&_in <seg>,s
  1629. &endm
  1630. .xcref
  1631. .xcref grp&_in
  1632. .cref
  1633. grp&_in ¯o sl,s
  1634. ifb <s>
  1635. grp group sl
  1636. else
  1637. grp&_add ¯o ns
  1638. grp&_in <sl,s>,ns
  1639. &endm
  1640. endif
  1641. &endm
  1642. grp&_def=ASMpass
  1643. else
  1644. grp&_add seg
  1645. endif
  1646. endm
  1647. defgrp macro grp,ln
  1648. addseg grp
  1649. ifnb <ln>
  1650. irp x,<ln>
  1651. ?cs3 <&x>,<grp>
  1652. x&&OFFSET equ offset grp:
  1653. x&&BASE equ grp
  1654. endm
  1655. endif
  1656. endm
  1657. ?cs1 macro ln,n
  1658. .xcref
  1659. .xcref ln&_sbegin
  1660. .cref
  1661. ln&_sbegin ¯o
  1662. .xcref
  1663. .xcref ?mf
  1664. .cref
  1665. ?curseg equ <&ln>
  1666. ?mf &¯o c,l,p
  1667. if c
  1668.     extrn    n&_FARFRAME:near
  1669.     call    n&_FARFRAME
  1670. else
  1671.     extrn    n&_NEARFRAME:near
  1672.     call    n&_NEARFRAME
  1673. endif
  1674.     db    l shr 1
  1675.     db    p shr 1
  1676. &&endm
  1677. ?cs2 <ln>,<n>
  1678. n segment
  1679. &endm
  1680. endm
  1681. ?cs2 macro ln,n
  1682. .xcref
  1683. .xcref sEnd
  1684. .cref
  1685. sEnd ¯o
  1686. n ends
  1687. purge ?mf
  1688. purge sEnd
  1689. &endm
  1690. endm
  1691. ?cs3 macro ln,n
  1692. .xcref
  1693. .xcref ln&_assumes
  1694. .cref
  1695. ln&_assumes ¯o s
  1696. assume s:&n
  1697. &endm
  1698. endm
  1699. .xcref
  1700. .xcref sBegin
  1701. .cref
  1702. sBegin macro ln
  1703. ln&_sbegin
  1704. endm
  1705. ife ?DF
  1706. createSeg _TEXT,Code,word,public,CODE
  1707. ife ?nodata1
  1708. createSeg _DATA,Data,word,public,DATA,DGROUP
  1709. defgrp DGROUP,Data
  1710. endif
  1711. if ?chkstk1
  1712. ifndef ?CHKSTKPROC
  1713. externp <chkstk>
  1714. endif
  1715. endif
  1716. endif
  1717. errnz macro x
  1718. if2
  1719. if x
  1720. errnz1 <x>,%(x)
  1721. endif
  1722. endif
  1723. endm
  1724. errnz1 macro x1,x2
  1725. = *errnz* x1 = x2
  1726. .err
  1727. endm
  1728. errn$ macro l,x
  1729. errnz <offset $ - offset l x>
  1730. endm
  1731. ifdef ?PROFILE
  1732. externFP <StartNMeas,StopNMeas>
  1733. endif
  1734. if ?aprof1
  1735. externFP <AProfCall,AProfRet>,<PLM>
  1736. endif
  1737.