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.

932 lines
13 KiB

  1. comment $
  2. cmacros - assembly macros for interfacing to HHLs
  3. (C)Copyright 1984, 1988 Microsoft Corporation
  4. $
  5. if1
  6. outif MACRO name,defval,onmsg,offmsg
  7. ifndef name
  8. ifb <defval>
  9. name=0
  10. else
  11. name=defval
  12. endif
  13. endif
  14. if name
  15. name=1
  16. ifnb <onmsg>
  17. %out ! onmsg
  18. endif
  19. else
  20. ifnb <offmsg>
  21. %out ! offmsg
  22. endif
  23. endif
  24. endm
  25. error MACRO msg
  26. bug
  27. %out E r r o r ----- msg
  28. ENDM
  29. %out cMacros Version 1.04
  30. outif memS,0,<Small Model>
  31. outif memM,0,<Medium Model>
  32. outif memL,0,<Large Model>
  33. outif memC,0,<Compact Model>
  34. outif memH,0,<Huge Model>
  35. memMOD= memS + memM + memL + memC + memH
  36. if memMOD ne 1
  37. if memMOD eq 0
  38. memS= 1
  39. outif memS,0,<Small Model>
  40. else
  41. error <Must have only 1 memory model selected>
  42. endif
  43. endif
  44. sizeC= memM + memL + memH
  45. sizeD= memL + memC + (memH*2)
  46. outif ?DF,0,<No segments or groups will be defined>
  47. outif ?WIN,0,<Windows Support>
  48. outif ?PLM,0,<PLM calling convention>
  49. endif
  50. .XCREF
  51. .XCREF ?N,?AX,?AH,?AL,?BX,?BH
  52. .XCREF ?BL,?CX,?CH,?CL,?DX,?DH
  53. .XCREF ?DL,?SI,?DI,?ES,?DS,?BP
  54. .XCREF ?SP,?SS,?CS
  55. .XCREF ?RSL,?CPD,?argl,?argc,?BA
  56. .XCREF ?ACB,???,?PO
  57. .XCREF ?PAS,?PC
  58. .XCREF Uconcat,mPush,mPop
  59. .XCREF ?RI,?pp,?pp1,?al1
  60. .XCREF ?aD,?AP,?Atal,?pd,?dd,?dd1,?ex1,?cas
  61. .XCREF ?pg,?pg1,?aloc,?cs1,?cs2
  62. .XCREF ?lb1,?lblpu
  63. .XCREF ?DF,?PLM,?WIN,?IA,?PU,?ADJ
  64. .CREF
  65. ?RSL = 0
  66. ?CPD = 0
  67. ?ArgL = 0
  68. ?ArgC = 0
  69. ?BA = 0
  70. ?ACB = 0
  71. ??? = 0
  72. ?PO = 0
  73. ?PAS = 0
  74. ?PC = 0
  75. ?IA = 0
  76. ?PU = 0
  77. ?ADJ = 0
  78. ?lblpu = 0
  79. ?N = 0000000000000000B
  80. ?AX = 0000000000000011B
  81. ?AH = 0000000000000001B
  82. ?AL = 0000000000000010B
  83. ?BX = 0000000000001100B
  84. ?BH = 0000000000000100B
  85. ?BL = 0000000000001000B
  86. ?CX = 0000000000110000B
  87. ?CH = 0000000000010000B
  88. ?CL = 0000000000100000B
  89. ?DX = 0000000011000000B
  90. ?DH = 0000000001000000B
  91. ?DL = 0000000010000000B
  92. ?SI = 0000000100000000B
  93. ?DI = 0000001000000000B
  94. ?ES = 0000010000000000B
  95. ?DS = 0000100000000000B
  96. ?BP = 0001000000000000B
  97. ?SP = 0010000000000000B
  98. ?SS = 0100000000000000B
  99. ?CS = 1000000000000000B
  100. uconcat macro n1,n2,o1,o2,p1,p2
  101. n1&n2 o1&o2 p1&p2
  102. endm
  103. mpush macro rV
  104. irp x,<ax,bx,cx,dx,si,di,es,ds,bp,sp,ss,cs>
  105. if rV AND ?&&x
  106. push x
  107. endif
  108. endm
  109. endm
  110. mpop macro rV
  111. irp x,<cs,ss,sp,bp,ds,es,di,si,dx,cx,bx,ax>
  112. if rV AND ?&&x
  113. pop x
  114. endif
  115. endm
  116. endm
  117. SAVE macro rL
  118. ?RSL = 0
  119. ?RI ?RSL,<rL>
  120. endm
  121. smashes macro n,rL
  122. .xcref
  123. .xcref ?SM&n
  124. .cref
  125. ?SM&n = 0
  126. ?RI ?SM&n,<rL>
  127. endm
  128. ?RI macro n,rL
  129. irp x,<rL>
  130. ifdef ?&&x
  131. n = n or ?&&x
  132. endif
  133. endm
  134. endm
  135. parmB macro nl
  136. ?pp <&nL>,<byte>,2,1
  137. endm
  138. parmW macro nl
  139. ?pp <&nL>,<word>,2,2
  140. endm
  141. parmD macro nl
  142. ife ?PLM
  143. irp x,<nL>
  144. ?pp <&&x>,<DWORD>,0,4
  145. ?pp <Off_&&x>,<WORD>,2,2
  146. ?pp <Seg_&&x>,<WORD>,2,2
  147. endm
  148. else
  149. irp x,<nL>
  150. ?pp <Seg_&&x>,<WORD>,2,2
  151. ?pp <Off_&&x>,<WORD>,2,2
  152. ?pp <&&x>,<DWORD>,0,4
  153. endm
  154. endif
  155. endm
  156. parmQ macro nl
  157. ?pp <&nL>,<QWORD>,8,8
  158. endm
  159. parmT macro nl
  160. ?pp <&nL>,<TBYTE>,10,10
  161. endm
  162. if sizeC
  163. parmCP macro nl
  164. parmD <nl>
  165. endm
  166. else
  167. parmCP macro nl
  168. parmW <nl>
  169. endm
  170. endif
  171. if sizeD
  172. parmDP macro nl
  173. parmD <nl>
  174. endm
  175. else
  176. parmDP macro nl
  177. parmW <nl>
  178. endm
  179. endif
  180. ?pp macro nL,t,l,s
  181. if ?CPD
  182. .xcref
  183. ife ?PLM
  184. irp x,<nL>
  185. ?pp1 x,<t>,%?PO,%?adj,%(?PO+?adj)
  186. ?PO = ?PO + l
  187. .xcref ?T&&x
  188. ?T&&x = s
  189. endm
  190. else
  191. irp x,<nL>
  192. ?PO = ?PO + l
  193. ?pp1 x,<t>,%?PO,%?adj,%(?PO+?adj)
  194. .xcref ?T&&x
  195. ?T&&x = s
  196. endm
  197. endif
  198. .cref
  199. else
  200. %out Parm(s) "&nl" declared outside proc def.
  201. endif
  202. endm
  203. ?pp1 macro n,t,o,a,b
  204. ife ?PLM
  205. n equ t ptr [bp+b]
  206. else
  207. n equ t ptr [bp+a+?PO-o]
  208. endif
  209. endm
  210. localB macro nL
  211. ?aLoc <&nL>,<BYTE ptr>,1,1,0
  212. endm
  213. localW macro nL
  214. ?aLoc <&nL>,<WORD PTR>,2,2,1
  215. endm
  216. localD macro nL
  217. irp x,<nL>
  218. ?aLoc <Seg_&&x>,<WORD PTR>,2,2,1
  219. ?aLoc <Off_&&x>,<WORD PTR>,2,2,1
  220. ?aLoc <&&x>,<DWORD PTR>,0,4,1
  221. endm
  222. endm
  223. localQ macro nL
  224. ?aLoc <&nL>,<QWORD PTR>,8,8,1
  225. endm
  226. localT macro nL
  227. ?aLoc <&nL>,<TBYTE PTR>,10,10,1
  228. endm
  229. if sizeC
  230. localCP macro nL
  231. localD <nL>
  232. endm
  233. else
  234. localCP macro nL
  235. localW <nL>
  236. endm
  237. endif
  238. if sizeD
  239. localDP macro nL
  240. localD <nL>
  241. endm
  242. else
  243. localDP macro nL
  244. localW <nL>
  245. endm
  246. endif
  247. localV macro n,a
  248. ?aLoc <&n>,,%(&a),0,1
  249. endm
  250. ?aLoc macro nL,t,l,s,a
  251. if ?CPD
  252. .xcref
  253. ??? = ??? + l
  254. if a
  255. ??? = ((??? + 1) AND 0FFFEH)
  256. endif
  257. irp x,<nL>
  258. ?aL1 x,<t>,%???
  259. .xcref ?T&&x
  260. ?T&&x = s
  261. endm
  262. .cref
  263. else
  264. %out Locals "&nl" declared outside procedure def.
  265. endif
  266. endm
  267. ?aL1 macro n,t,o
  268. if ?IA
  269. n equ t [bp-?IA-o]
  270. else
  271. n equ t [bp-o]
  272. endif
  273. endm
  274. globalB macro n,i,s
  275. ?aD <n>,1
  276. ?dd n,1,<BYTE>,<DB>,<i>,<s>
  277. endm
  278. globalW macro n,i,s
  279. ?aD <n>,2
  280. ?dd n,1,<WORD>,<DW>,<i>,<s>
  281. endm
  282. globalD macro n,i,s
  283. ?aD <n>,4
  284. ?dd n,1,<DWORD>,<DD>,<i>,<s>
  285. endm
  286. globalQ macro n,i,s
  287. ?aD <n>,8
  288. ?dd n,1,<QWORD>,<DQ>,<i>,<s>
  289. endm
  290. globalT macro n,i,s
  291. ?aD <n>,10
  292. ?dd n,1,<TBYTE>,<DT>,<i>,<s>
  293. endm
  294. if sizeC
  295. globalCP macro n,i,s
  296. globalD n,<i>,<s>
  297. endm
  298. else
  299. globalCP macro n,i,s
  300. globalW n,<i>,<s>
  301. endm
  302. endif
  303. if sizeD
  304. globalDP macro n,i,s
  305. globalD n,<i>,<s>
  306. endm
  307. else
  308. globalDP macro n,i,s
  309. globalW n,<i>,<s>
  310. endm
  311. endif
  312. staticB macro n,i,s
  313. ?aD <n>,1
  314. ?dd n,0,<BYTE>,<DB>,<i>,<s>
  315. endm
  316. staticW macro n,i,s
  317. ?aD <n>,2
  318. ?dd n,0,<WORD>,<DW>,<i>,<s>
  319. endm
  320. staticD macro n,i,s
  321. ?aD <n>,4
  322. ?dd n,0,<DWORD>,<DD>,<i>,<s>
  323. endm
  324. staticQ macro n,i,s
  325. ?aD <n>,8
  326. ?dd n,0,<QWORD>,<DQ>,<i>,<s>
  327. endm
  328. staticT macro n,i,s
  329. ?aD <n>,10
  330. ?dd n,0,<TBYTE>,<DT>,<i>,<s>
  331. endm
  332. if sizeC
  333. staticCP macro n,i,s
  334. staticD n,<i>,<s>
  335. endm
  336. else
  337. staticCP macro n,i,s
  338. staticW n,<i>,<s>
  339. endm
  340. endif
  341. if sizeD
  342. staticDP macro n,i,s
  343. staticD n,<i>,<s>
  344. endm
  345. else
  346. staticDP macro n,i,s
  347. staticW n,<i>,<s>
  348. endm
  349. endif
  350. ?dd macro n,p,t,d,i,s
  351. ife ?PLM
  352. n label t
  353. ?dd1 _&n,p,<d>,<i>,<s>
  354. else
  355. ?dd1 n,p,<d>,<i>,<s>
  356. endif
  357. endm
  358. ?dd1 macro n,p,d,i,s
  359. if p
  360. PUBLIC n
  361. endif
  362. ifb <s>
  363. n d i
  364. else
  365. ifb <i>
  366. n d s DUP (?)
  367. else
  368. n d s DUP (i)
  369. endif
  370. endif
  371. endm
  372. externB macro nL
  373. ?ex1 <&nL>,1,<BYTE>
  374. endm
  375. externW macro nL
  376. ?ex1 <&nL>,2,<WORD>
  377. endm
  378. externD macro nL
  379. ?ex1 <&nL>,4,<DWORD>
  380. endm
  381. externQ macro nL
  382. ?ex1 <&nL>,8,<QWORD>
  383. endm
  384. externT macro nL
  385. ?ex1 <&nL>,10,<TBYTE>
  386. endm
  387. externNP macro nL
  388. ?ex1 <&nL>,2,<NEAR>
  389. endm
  390. externFP macro nL
  391. ?ex1 <&nL>,4,<FAR>
  392. endm
  393. if sizeC
  394. externP macro nL
  395. ?ex1 <&nL>,4,<FAR>
  396. endm
  397. else
  398. externP macro nL
  399. ?ex1 <&nL>,2,<NEAR>
  400. endm
  401. endif
  402. if sizeC
  403. externCP macro nL
  404. ?ex1 <&nL>,4,<DWORD>
  405. endm
  406. else
  407. externCP macro nL
  408. ?ex1 <&nL>,2,<WORD>
  409. endm
  410. endif
  411. if sizeD
  412. externDP macro nL
  413. ?ex1 <&nL>,4,<DWORD>
  414. endm
  415. else
  416. externDP macro nL
  417. ?ex1 <&nL>,2,<WORD>
  418. endm
  419. endif
  420. ?ex1 macro nL,s,d
  421. irp x,<nL>
  422. .xcref
  423. .xcref ?T&&x
  424. .cref
  425. ?T&&x = s
  426. ife ?PLM
  427. extrn _&&x:&d
  428. x equ _&&x
  429. else
  430. extrn x:&d
  431. endif
  432. endm
  433. endm
  434. labelB macro nL
  435. ?lb1 <&nL>,1,<BYTE>
  436. endm
  437. labelW macro nL
  438. ?lb1 <&nL>,2,<WORD>
  439. endm
  440. labelD macro nL
  441. ?lb1 <&nL>,4,<DWORD>
  442. endm
  443. labelQ macro nL
  444. ?lb1 <&nL>,8,<QWORD>
  445. endm
  446. labelT macro nL
  447. ?lb1 <&nL>,10,<TBYTE>
  448. endm
  449. labelNP macro nL
  450. ?lb1 <&nL>,2,<NEAR>
  451. endm
  452. labelFP macro nL
  453. ?lb1 <&nL>,4,<FAR>
  454. endm
  455. if sizeC
  456. labelP macro nL
  457. ?lb1 <&nL>,4,<FAR>
  458. endm
  459. else
  460. labelP macro nL
  461. ?lb1 <&nL>,2,<NEAR>
  462. endm
  463. endif
  464. if sizeC
  465. labelCP macro nL
  466. ?lb1 <&nL>,4,<DWORD>
  467. endm
  468. else
  469. labelCP macro nL
  470. ?lb1 <&nL>,2,<WORD>
  471. endm
  472. endif
  473. if sizeD
  474. labelDP macro nL
  475. ?lb1 <&nL>,4,<DWORD>
  476. endm
  477. else
  478. labelDP macro nL
  479. ?lb1 <&nL>,2,<WORD>
  480. endm
  481. endif
  482. ?lb1 macro nL,s,d
  483. ?lblpu = 0
  484. irp x,<nL>
  485. ifidn <x>,<PUBLIC>
  486. ?lblpu = 1
  487. else
  488. .xcref
  489. .xcref ?T&&x
  490. .cref
  491. ?T&&x = s
  492. ife ?PLM
  493. if ?lblpu
  494. public _&&x
  495. endif
  496. _&&x label &d
  497. x equ _&&x
  498. else
  499. if ?lblpu
  500. public x
  501. endif
  502. x label &d
  503. endif
  504. endif
  505. endm
  506. endm
  507. defB macro nL
  508. ?aD <&nL>,1
  509. endm
  510. defW macro nL
  511. ?aD <&nL>,2
  512. endm
  513. defD macro nL
  514. ?aD <&nL>,4
  515. endm
  516. defQ macro nL
  517. ?aD <&nL>,8
  518. endm
  519. defT macro nL
  520. ?aD <&nL>,10
  521. endm
  522. if sizeC
  523. defCP macro nL
  524. defD <nL>
  525. endm
  526. else
  527. defCP macro nL
  528. defW <nL>
  529. endm
  530. endif
  531. if sizeD
  532. defDP macro nL
  533. defD <nL>
  534. endm
  535. else
  536. defDP macro nL
  537. defW <nL>
  538. endm
  539. endif
  540. ?aD macro nL,s
  541. irp x,<nL>
  542. .xcref
  543. .xcref ?T&&x
  544. .cref
  545. ?T&&x = s
  546. endm
  547. endm
  548. regPtr macro n,S,O
  549. .xcref
  550. .xcref ?T&n,?SR&n,?OR&n
  551. .cref
  552. ?T&n = 0FFFFH
  553. ?SR&n = 0
  554. ?RI ?SR&n,<&S>
  555. ?OR&n = 0
  556. ?RI ?OR&n,<&O>
  557. endm
  558. arg macro aL
  559. irp x,<aL>
  560. ?argc = ?argc + 1
  561. ?Atal <x>,%?argc
  562. endm
  563. endm
  564. ?Atal macro n,i
  565. .xcref
  566. .xcref ?ALI&i
  567. .cref
  568. ?ALI&i &macro
  569. ?AP n
  570. &endm
  571. endm
  572. ?AP macro n
  573. ?argl = ?argl + 2
  574. ifdef ?T&n
  575. ife ?T&n-1
  576. push word ptr (n)
  577. exitm
  578. endif
  579. ife ?T&n-2
  580. push n
  581. exitm
  582. endif
  583. ife ?T&n-4
  584. push word ptr (n)+2
  585. push word ptr (n)
  586. ?argl = ?argl + 2
  587. exitm
  588. endif
  589. ife ?T&n-8
  590. push word ptr (n)+6
  591. push word ptr (n)+4
  592. push word ptr (n)+2
  593. push word ptr (n)
  594. ?argl = ?argl + 6
  595. exitm
  596. endif
  597. ife ?T&n-0FFFFH
  598. mpush %(?SR&n),1
  599. mpush %(?OR&n),1
  600. ?argl = ?argl + 2
  601. exitm
  602. endif
  603. ife ?T&n
  604. push word ptr (n)
  605. exitm
  606. endif
  607. endif
  608. push n
  609. endm
  610. ife ?PLM
  611. ccall macro n,a,sleaze
  612. ifnb <a>
  613. Arg <a>
  614. endif
  615. ifdef ?SM&n
  616. ?RSL = ?RSL AND ?SM&n
  617. endif
  618. mpush %?RSL
  619. ?argl = 0
  620. ?ACB = ?argc
  621. rept ?argc
  622. uconcat <?ALI>,%?ACB
  623. uconcat <purge>,,<?ALI>,%?ACB
  624. ?ACB = ?ACB - 1
  625. endm
  626. ife ?PLM
  627. ifb <sleaze>
  628. call _&n
  629. else
  630. call n
  631. endif
  632. else
  633. call n
  634. endif
  635. if ?argl
  636. add sp,?argl
  637. endif
  638. mpop %?RSL
  639. ?RSL = 0
  640. ?argc = 0
  641. ?argl = 0
  642. endm
  643. else
  644. ccall macro n,a
  645. ifnb <a>
  646. Arg <a>
  647. endif
  648. ifdef ?SM&n
  649. ?RSL = ?RSL AND ?SM&n
  650. endif
  651. mpush %?RSL
  652. ?argl = 0
  653. ?ACB = 1
  654. rept ?argc
  655. uconcat <?ALI>,%?ACB
  656. uconcat <purge>,,<?ALI>,%?ACB
  657. ?ACB = ?ACB + 1
  658. endm
  659. ife ?PLM
  660. call _&n
  661. else
  662. call n
  663. endif
  664. mpop %?RSL
  665. ?RSL = 0
  666. ?argc = 0
  667. ?argl = 0
  668. endm
  669. endif
  670. cProc macro n,cl,s
  671. ?pd n,<cl>,<s>,4
  672. endm
  673. ?pd macro n,c,a,i
  674. if ?CPD
  675. ?UTPE
  676. endif
  677. ?CPD = 1
  678. ??? = 0
  679. ?argc = 0
  680. ?BA = 0
  681. ?PO = 0
  682. ?PU = 0
  683. ?IA = 0
  684. ?adj = i
  685. ?PAS = 0
  686. ifnb <a>
  687. ?RI ?PAS,<a>
  688. endif
  689. ?PC = sizeC
  690. irp x,<c>
  691. ifidn <x>,<FAR>
  692. ?PC = 1
  693. endif
  694. ifidn <x>,<NEAR>
  695. ?PC = 0
  696. endif
  697. ifidn <x>,<PUBLIC>
  698. ?PU = 1
  699. endif
  700. endm
  701. if ?PC
  702. if ?WIN
  703. ?IA = 2
  704. endif
  705. ?adj = ?adj + 2
  706. endif
  707. ife ?PLM
  708. ife ?PC
  709. n label near
  710. else
  711. n label far
  712. endif
  713. ?pg <_&n>,%?PU,%?PC,%?PAS
  714. else
  715. ?pg <n>,%?PU,%?PC,%?PAS
  716. endif
  717. endm
  718. ?pg macro n,p,c,a
  719. .xcref
  720. cBegin &macro g
  721. .xcref
  722. ?pg1 <n>,c,a,%?PO
  723. ?CPD = 0
  724. ?argc = 0
  725. ?BA = 1
  726. ??? = (???+1) AND 0FFFEH
  727. if p
  728. PUBLIC n
  729. endif
  730. ife c
  731. n proc NEAR
  732. else
  733. n proc FAR
  734. endif
  735. ifidn <g>,<nogen>
  736. if ???+?PO+a
  737. %out <cBegin - possible invalid use of nogen>
  738. endif
  739. else
  740. if ?IA
  741. mov ax,ds
  742. nop
  743. inc bp
  744. push bp
  745. mov bp,sp
  746. push ds
  747. mov ds,ax
  748. else
  749. push bp
  750. mov bp,sp
  751. endif
  752. if ???
  753. sub sp,???
  754. endif
  755. mPush a,1
  756. endif
  757. .cref
  758. purge cBegin
  759. &endm
  760. ?UTPE &macro
  761. %out Unterminated Procedure Definition: "&n"
  762. &endm
  763. endm
  764. ?pg1 macro n,c,a,o
  765. .xcref
  766. cEnd &macro g
  767. .xcref
  768. ?BA = 0
  769. ifidn <g>,<nogen>
  770. if o+a
  771. %out <cEnd - possible invalid use of nogen>
  772. endif
  773. else
  774. mPop a,1
  775. if ?IA
  776. sub bp,2
  777. mov sp,bp
  778. pop ds
  779. pop bp
  780. dec bp
  781. else
  782. mov sp,bp
  783. pop bp
  784. endif
  785. ife ?PLM
  786. ret
  787. else
  788. ret o
  789. endif
  790. endif
  791. n endp
  792. .cref
  793. purge cEnd
  794. &endm
  795. .cref
  796. endm
  797. assumes macro s,g
  798. local assumed
  799. assumed = 0
  800. ifidn <code>,<g>
  801. ?cas <s>
  802. assumed = 1
  803. endif
  804. ifidn <CODE>,<g>
  805. ?cas <s>
  806. assumed = 1
  807. endif
  808. ifidn <data>,<g>
  809. assume s&:dgroup
  810. assumed = 1
  811. endif
  812. ifidn <DATA>,<g>
  813. assume s&:dgroup
  814. assumed = 1
  815. endif
  816. ife assumed
  817. assume s&:&g
  818. endif
  819. endm
  820. if sizeC
  821. ?cas macro s
  822. assume s&:_TEXT
  823. endm
  824. else
  825. ?cas macro s
  826. assume s&:IGROUP
  827. endm
  828. endif
  829. createSeg macro n,ln,a,co,cl,grp
  830. ifnb <grp>
  831. ifidn <grp>,<IGROUP>
  832. ife sizeC
  833. addSeg IGROUP,n
  834. endif
  835. else
  836. addSeg grp,n
  837. endif
  838. endif
  839. ifnb <cl>
  840. n segment a co '&cl'
  841. else
  842. n segment a co
  843. endif
  844. n ends
  845. ?cs1 <n>,<ln>
  846. endm
  847. if1
  848. ASMpass=1
  849. else
  850. ASMpass=2
  851. endif
  852. addSeg macro grp,seg
  853. ifndef def_&grp
  854. def_&grp= 0
  855. endif
  856. if def_&grp ne ASMpass
  857. add_&grp &macro s
  858. in_&grp <seg>,s
  859. &endm
  860. in_&grp &macro sl,s
  861. ifb <s>
  862. grp group sl
  863. else
  864. add_&grp &macro ns
  865. in_&grp <sl,s>,ns
  866. &endm
  867. endif
  868. &endm
  869. def_&grp=ASMpass
  870. else
  871. add_&grp seg
  872. endif
  873. endm
  874. defGrp macro nam
  875. addSeg nam
  876. endm
  877. ?cs1 macro n,ln
  878. begin&ln &macro
  879. ?cs2 <n>
  880. n segment
  881. &endm
  882. endm
  883. ?cs2 macro n
  884. sEnd &macro
  885. n ends
  886. &endm
  887. endm
  888. sBegin macro ln
  889. begin&ln
  890. endm
  891. ife ?DF
  892. createSeg _TEXT,code,byte,public,CODE,IGROUP
  893. createSeg _DATA,data,word,public,DATA,DGROUP
  894. if ?WIN
  895. ife sizeC
  896. createSeg _INITTEXT,initcode,byte,public,CODE,IGROUP
  897. createSeg _INITDATA,initdata,word,public,DATA,DGROUP
  898. endif
  899. endif
  900. ife sizeC
  901. defGrp IGROUP
  902. endif
  903. defGrp DGROUP
  904. if sizeC
  905. codeOFFSET equ OFFSET _TEXT:
  906. else
  907. codeOFFSET equ OFFSET IGROUP:
  908. endif
  909. dataOFFSET equ OFFSET DGROUP:
  910. endif
  911. errnz macro x
  912. if2
  913. if x
  914. errnz1 <x>,%(x)
  915. endif
  916. endif
  917. endm
  918. errnz1 macro x1,x2
  919. = *ERRNZ* x1 = x2
  920. endm
  921. errn$ macro l,x
  922. errnz <OFFSET $ - OFFSET l x>
  923. endm