home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_06 / tp55.src < prev    next >
Text File  |  1990-11-06  |  53KB  |  2,483 lines

  1. ;=============================================================================
  2. ;=============================================================================
  3. ;
  4. ;                Macro Library for Turbo Pascal v5.5
  5. ;
  6. ;   Writen by Clark A. Calkins,
  7. ;             C. C. Software
  8. ;             1907 Alvarado Ave.
  9. ;             Walnut Creek, CA 94596
  10. ;
  11. ;             circa September 1990
  12. ;
  13. ;   This file may be freely copied and used for non-commercial purposes.
  14. ;   Intended for use with the Masterful Disassembler (MD86) version 2.3 or
  15. ;   later. This file should be compiled with MD86MAC v1.3 or later. No
  16. ;   compiler error or warning messages should be generated.
  17. ;
  18. ;   There are no known coding errors in these macros but no guarantees are
  19. ;   implied.
  20. ;
  21. ;=============================================================================
  22. ;=============================================================================
  23. ;
  24. ;=============================================================================
  25. ;   String processing macros.
  26. ;=============================================================================
  27. ;
  28. ;   =====>>> String write macros.
  29. ;
  30. ;
  31. ;   Macro to write out the first string constant w/o format.
  32. ;
  33. macroname = WrtStrCnstF
  34.   size    = 10
  35.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff
  36.   compare = $bf,$00,$00,$1e,$57,$bf,$00,$00,$0e,$57,$31,$c0,$50,$9a
  37.   flags   = call
  38.   comment = Write first string constant.
  39. ;
  40. ;   Verify call destination.
  41. ;
  42.   argument
  43.     rbyte = 14
  44.     type = faraddress
  45.     name = WrtItem
  46.   endargument
  47. ;
  48. ;   Get address if FCB.
  49. ;
  50.   argument
  51.     rbyte = 1
  52.     type  = address
  53.     segment = ds
  54.   endargument
  55. ;
  56. ;   Get address of string constant.
  57. ;
  58.   argument
  59.     rbyte = 6
  60.     type  = address
  61.     segment = cs
  62.   endargument
  63. endmacro
  64. ;
  65. ;   Macro to write out a string constant w/o format.
  66. ;
  67. macroname = WrtStrCnst
  68.   size    = 7
  69.   mask    = $ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff
  70.   compare = $bf,$00,$00,$0e,$57,$31,$c0,$50,$9a
  71.   flags   = call
  72.   comment = Write string constant.
  73. ;
  74. ;   Verify call destination.
  75. ;
  76.   argument
  77.     rbyte = 9
  78.     type = faraddress
  79.     name = WrtItem
  80.   endargument
  81. ;
  82. ;   Get address of string constant.
  83. ;
  84.   argument
  85.     rbyte = 1
  86.     type  = address
  87.     segment = cs
  88.   endargument
  89. endmacro
  90. ;
  91. ;   Macro to write out the first string variable w/o format.
  92. ;
  93. macroname = WrtStrVarF
  94.   size    = 10
  95.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff
  96.   compare = $bf,$00,$00,$1e,$57,$bf,$00,$00,$1e,$57,$31,$c0,$50,$9a
  97.   flags   = call
  98.   comment = Write first string var.
  99. ;
  100. ;   Verify call destination.
  101. ;
  102.   argument
  103.     rbyte = 14
  104.     type = faraddress
  105.     name = WrtItem
  106.   endargument
  107. ;
  108. ;   Get address if FCB.
  109. ;
  110.   argument
  111.     rbyte = 1
  112.     type  = address
  113.     segment = ds
  114.   endargument
  115. ;
  116. ;   Get address of string constant.
  117. ;
  118.   argument
  119.     rbyte = 6
  120.     type  = address
  121.     segment = ds
  122.   endargument
  123. endmacro
  124. ;
  125. ;   Macro to write out another string variable w/o format.
  126. ;
  127. macroname = WrtStrVar
  128.   size    = 7
  129.   mask    = $ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff
  130.   compare = $bf,$00,$00,$1e,$57,$31,$c0,$50,$9a
  131.   flags   = call
  132.   comment = Write string var.
  133. ;
  134. ;   Verify call destination.
  135. ;
  136.   argument
  137.     rbyte = 9
  138.     type = faraddress
  139.     name = WrtItem
  140.   endargument
  141. ;
  142. ;   Get address of string constant.
  143. ;
  144.   argument
  145.     rbyte = 1
  146.     type  = address
  147.     segment = ds
  148.   endargument
  149. endmacro
  150. ;
  151. ;   Macro to check the results of previous I/O.
  152. ;
  153. macroname = CheckIO_Result
  154.   size    = 2
  155.   mask    = $ff,$00,$00,$00,$00,$ff
  156.   compare = $9a,$00,$00,$00,$00,$9a
  157.   flags   = call
  158.   argument
  159.     rbyte = 1
  160.     type  = faraddress
  161.     name  = IO_end
  162.   endargument
  163.   argument
  164.     rbyte = 6
  165.     type  = faraddress
  166.     name  = Check_IO
  167.   endargument
  168. endmacro
  169. ;
  170. ;   Macro to end a line and check I/O result.
  171. ;
  172. macroname = EndLine_CheckIO
  173.   size    = 2
  174.   mask    = $ff,$00,$00,$00,$00,$ff
  175.   compare = $9a,$00,$00,$00,$00,$9a
  176.   flags   = call
  177.   comment = End line and check IOResult.
  178.   argument
  179.     rbyte = 1
  180.     type  = faraddress
  181.     name  = Line_end
  182.   endargument
  183.   argument
  184.     rbyte = 6
  185.     type  = faraddress
  186.     name  = Check_IO
  187.   endargument
  188. endmacro
  189. ;
  190. ;   =====>>> Macros for reading in string variables.
  191. ;
  192. macroname = ReadLine_CheckIO
  193.   size    = 2
  194.   mask    = $ff,$00,$00,$00,$00,$ff
  195.   compare = $9a,$00,$00,$00,$00,$9a
  196.   flags   = call
  197.   comment = Read to EOL, check IOResult.
  198.   argument
  199.     rbyte = 1
  200.     type  = faraddress
  201.     name  = Get_EOL
  202.   endargument
  203.   argument
  204.     rbyte = 6
  205.     type  = faraddress
  206.     name  = Check_IO
  207.   endargument
  208. endmacro
  209. ;
  210. ;   Read a string as the first item in a list.
  211. ;
  212. macroname = ReadStrF
  213.   size    = 9
  214.   mask    = $ff,$00,$00,$ff,$ff
  215.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff
  216.   compare = $bf,$00,$00,$1e,$57
  217.   compare = $bf,$00,$00,$1e,$57,$b8,$00,$00,$50,$9a
  218.   flags   = call,perm
  219.   comment = "read str (file, var, len)."
  220.   argument
  221.     rbyte = 15
  222.     type  = faraddress
  223.     name  = RdStrItm
  224.   endargument
  225.   argument
  226.     rbyte = 1
  227.     type  = address
  228.     segment = ds
  229.   endargument
  230.   argument
  231.     rbyte = 6
  232.     type  = address
  233.     segment = ds
  234.   endargument
  235.   argument
  236.     rbyte = 11
  237.     type  = word
  238.   endargument
  239. endmacro
  240. ;
  241. ;   Read the next item as a string.
  242. ;
  243. macroname = ReadStr
  244.   size    = 6
  245.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff
  246.   compare = $bf,$00,$00,$1e,$57,$b8,$00,$00,$50,$9a
  247.   flags   = call,perm
  248.   comment = "read string (var, len)."
  249.  argument
  250.     rbyte = 10
  251.     type  = faraddress
  252.     name  = RdStrItm
  253.   endargument
  254.   argument
  255.     rbyte = 1
  256.     type  = address
  257.     segment = ds
  258.   endargument
  259.   argument
  260.     rbyte = 6
  261.     type  = word
  262.   endargument
  263. endmacro
  264. ;
  265. ;=============================================================================
  266. ;   =====>>> String assignment and COPY macros.
  267. ;=============================================================================
  268. ;
  269. ;
  270. ;   Macro to assign a simple string constant to a string variable.
  271. ;
  272. ;     --> StrConstAssign source, destination, max_length
  273. ;
  274. macroname = StrConstAssign
  275.   size    = 9
  276.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff
  277.   mask    = $ff,$00,$00,$ff,$ff
  278.   compare = $bf,$00,$00,$0e,$57,$bf,$00,$00,$1e,$57
  279.   compare = $b8,$00,$00,$50,$9a
  280.   flags   = call,perm
  281. ;
  282. ;   This pseudo argument is used to verify that the call instruction has the
  283. ;   desired destination address. Its name (StrMove) must already be in place.
  284. ;
  285.   argument
  286.     rbyte = 15
  287.     type  = faraddress
  288.     name  = StrMove
  289.   endargument
  290. ;
  291. ;   First real argument is the address of the source string constant. This is a
  292. ;   CS: relative offset too.
  293. ;
  294.   argument
  295.     rbyte = 1
  296.     type  = address
  297.     segment = cs
  298.   endargument
  299. ;
  300. ;   Second argument is the address of the destination string variable. This is
  301. ;   a DS: relative offset (we must declare this or CS {from above} will be
  302. ;   used).
  303. ;
  304.   argument
  305.     rbyte = 6
  306.     type  = address
  307.     segment = ds
  308.   endargument
  309.  ;
  310.  ;   The last argument is the max length of the destination string. This will
  311.  ;   be used to truncate the string if necessary.
  312.  ;
  313.   argument
  314.     rbyte = 11
  315.     type  = word
  316.   endargument
  317. endmacro
  318. ;
  319. ;   Macro to concatinate a string constant to the back of a string variable.
  320. ;
  321. ;     --> ConcatStrConst temp_level,source_str, str_constant
  322. ;
  323. macroname = ConcatStrConst
  324.   size    = 12
  325.   mask    = $ff,$ff,$ff,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff,$00,$00,$00,$00
  326.   compare = $8d,$be,$00,$00,$16,$57,$bf,$00,$00,$1e,$57,$9a,$00,$00,$00,$00
  327.   mask    = $ff,$00,$00,$ff,$ff,$ff
  328.   compare = $bf,$00,$00,$0e,$57,$9a
  329.   flags   = call,perm
  330. ;
  331. ;   Verify destination address of all calls.
  332. ;
  333.   argument
  334.     rbyte = 12
  335.     type  = faraddress
  336.     name  = StrStore
  337.   endargument
  338.   argument
  339.     rbyte = 22
  340.     type  = faraddress
  341.     name  = StrAdd
  342.   endargument
  343. ;
  344. ;   First argument is the level indicator (which temp variable to use).
  345. ;
  346.   argument
  347.     rbyte = 2
  348.     type  = word
  349.   endargument
  350. ;
  351. ;   Next is the address of the source string.
  352. ;
  353.   argument
  354.     rbyte = 7
  355.     type  = address
  356.     segment = ds
  357.   endargument
  358. ;
  359. ;   Now the address of the string constant (CS: relative).
  360. ;
  361.   argument
  362.     rbyte = 17
  363.     type  = address
  364.     segment = cs
  365.   endargument
  366. endmacro
  367. ;
  368. ;   Macro to add a string variable to the back of a string constant.
  369. ;
  370. macroname = ConcatStrVar
  371.   size    = 12
  372.   mask    = $ff,$ff,$ff,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff
  373.   compare = $8d,$be,$00,$00,$16,$57,$bf,$00,$00,$0e,$57,$9a
  374.   mask    = $00,$00,$00,$00,$ff,$00,$00,$ff,$ff,$ff
  375.   compare = $00,$00,$00,$00,$bf,$00,$00,$1e,$57,$9a
  376.   flags   = call,perm
  377. ;
  378. ;   Verify destinations of both calls.
  379. ;
  380.   argument
  381.     rbyte = 12
  382.     type  = faraddress
  383.     name  = StrStore
  384.   endargument
  385.   argument
  386.     rbyte = 22
  387.     type  = faraddress
  388.     name  = StrAdd
  389.   endargument
  390. ;
  391. ;   First argument is the level indicator (which temp variable to use).
  392. ;
  393.   argument
  394.     rbyte = 2
  395.     type  = word
  396.   endargument
  397. ;
  398. ;   Next argument is address of string constant.
  399. ;
  400.   argument
  401.     rbyte = 7
  402.     type  = address
  403.     segment = cs
  404.   endargument
  405. ;
  406. ;   Now the address of the string variable to add.
  407. ;
  408.   argument
  409.     rbyte = 17
  410.     type  = address
  411.     segment = ds
  412.   endargument
  413. endmacro
  414. ;
  415. ;   Macro to use COPY to get a substring from a simple string variable.
  416. ;
  417. ;      --> CopyStrVar Source_string,start_pos,num_chars
  418. ;   where start_pos and num_chars are integer constants.
  419. ;
  420. macroname = CopyStrVar
  421.   size    = 8
  422.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$00,$00,$ff,$ff
  423.   compare = $bf,$00,$00,$1e,$57,$b8,$00,$00,$50,$b8,$00,$00,$50,$9a
  424.   comment = "copy(ARG1,ARG2,ARG3)"
  425.   flags   = call,perm
  426. ;
  427. ;   Verify the proper call address.
  428. ;
  429.   argument
  430.     rbyte = 14
  431.     type  = faraddress
  432.     name  = StrCopy
  433.   endargument
  434. ;
  435. ;   Setup the address of the source string variable.
  436. ;
  437.   argument
  438.     rbyte = 1
  439.     type  = address
  440.   endargument
  441. ;
  442. ;   The next argument represents the first character position.
  443. ;
  444.   argument
  445.     rbyte = 6
  446.     type  = word
  447.   endargument
  448. ;
  449. ;   Lastly, include the number of characters to copy.
  450. ;
  451.   argument
  452.     rbyte = 10
  453.     type  = word
  454.   endargument
  455. endmacro
  456. ;
  457. ;   Similar for a slightly different calling sequence. This has the num_chars
  458. ;   as a variable.
  459. ;
  460. macroname = CopyStrVar
  461.   size    = 8
  462.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff
  463.   compare = $bf,$00,$00,$1e,$57,$b8,$00,$00,$50,$ff,$36,$00,$00,$9a
  464.   comment = "copy(ARG1,ARG2,ARG3)"
  465.   flags   = call,perm
  466. ;
  467.   argument
  468.     rbyte = 14
  469.     type  = faraddress
  470.     name  = StrCopy
  471.   endargument
  472. ;
  473.   argument
  474.     rbyte = 1
  475.     type  = address
  476.   endargument
  477. ;
  478.   argument
  479.     rbyte = 6
  480.     type  = word
  481.   endargument
  482. ;
  483.   argument
  484.     rbyte = 11
  485.     type  = address
  486.   endargument
  487. endmacro
  488. ;
  489. ;   Similar for a slightly different calling sequence. This has the start_pos
  490. ;   as a variable.
  491. ;
  492. macroname = CopyStrVar
  493.   size    = 8
  494.   mask    = $ff,$00,$00,$ff,$ff,$ff,$ff,$00,$00,$ff,$00,$00,$ff,$ff
  495.   compare = $bf,$00,$00,$1e,$57,$ff,$36,$00,$00,$b8,$00,$00,$50,$9a
  496.   comment = "copy(ARG1,ARG2,ARG3)"
  497.   flags   = call,perm
  498. ;
  499.   argument
  500.     rbyte = 14
  501.     type  = faraddress
  502.     name  = StrCopy
  503.   endargument
  504. ;
  505.   argument
  506.     rbyte = 1
  507.     type  = address
  508.   endargument
  509. ;
  510.   argument
  511.     rbyte = 7
  512.     type  = address
  513.   endargument
  514. ;
  515.   argument
  516.     rbyte = 10
  517.     type  = word
  518.   endargument
  519. endmacro
  520. ;
  521. ;   Similar for a slightly different calling sequence. This has the start_pos
  522. ;   and num_chars as variables.
  523. ;
  524. macroname = CopyStrVar
  525.   size    = 8
  526.   mask    = $ff,$00,$00,$ff,$ff,$ff,$ff,$00,$00,$ff,$ff,$00,$00,$ff
  527.   compare = $bf,$00,$00,$1e,$57,$ff,$36,$00,$00,$ff,$36,$00,$00,$9a
  528.   comment = "copy(ARG1,ARG2,ARG3)"
  529.   flags   = call
  530. ;
  531.   argument
  532.     rbyte = 14
  533.     type  = faraddress
  534.     name  = StrCopy
  535.   endargument
  536. ;
  537.   argument
  538.     rbyte = 1
  539.     type  = address
  540.   endargument
  541. ;
  542.   argument
  543.     rbyte = 7
  544.     type  = address
  545.   endargument
  546. ;
  547.   argument
  548.     rbyte = 11
  549.     type  = address
  550.   endargument
  551. endmacro
  552. ;
  553. ;   Macro to get a substring from a string function using COPY.
  554. ;
  555. ;     --> Copy first_char,num_chars
  556. ;
  557. macroname = Copy
  558.   size    = 5
  559.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff,$ff
  560.   compare = $b8,$00,$00,$50,$b8,$00,$00,$50,$9a
  561.   flags   = call,perm
  562. ;
  563. ;   Verify destination of call.
  564. ;
  565.   argument
  566.     rbyte = 9
  567.     type  = faraddress
  568.     name  = StrCopy
  569.   endargument
  570. ;
  571. ;   Get first character position of interest.
  572. ;
  573.   argument
  574.     rbyte = 1
  575.     type  = word
  576.   endargument
  577. ;
  578. ;   Get number of characters to extract.
  579. ;
  580.   argument
  581.     rbyte = 5
  582.     type  = word
  583.   endargument
  584. endmacro
  585. ;
  586. ;   Macro to push the address of a temporary string variable to the stack.
  587. ;   Various other functions will use what ever is on the stack.
  588. ;
  589. ;     --> PushTempStrAddr temp_level
  590. ;
  591. macroname = PushTempStrAddr
  592.   size    = 4
  593.   mask    = $ff,$ff,$ff,$00,$ff,$ff
  594.   compare = $8d,$be,$00,$00,$16,$57
  595.   flags   = perm
  596. ;
  597. ;   First argument is the level indicator (which temp variable to use).
  598. ;
  599.   argument
  600.     rbyte = 2
  601.     type  = word
  602.   endargument
  603. endmacro
  604. ;
  605. ;   Macro to store the temp string into a user variable.
  606. ;
  607. ;     --> StoreTempStr destination, max_length
  608. ;
  609. macroname = StoreTempStr
  610.   size    = 6
  611.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff
  612.   compare = $bf,$00,$00,$1e,$57,$b8,$00,$00,$50,$9a
  613.   flags   = call,perm
  614. ;
  615. ;   Verify proper call address.
  616. ;
  617.   argument
  618.     rbyte = 10
  619.     type  = faraddress
  620.     name  = StrMove
  621.   endargument
  622. ;
  623. ;   The first argument is the address of the string variable to load.
  624. ;
  625.   argument
  626.     rbyte = 1
  627.     type  = address
  628.   endargument
  629. ;
  630. ;   Now describe the max number of characters that the above variable can
  631. ;   accept.
  632. ;
  633.   argument
  634.     rbyte = 6
  635.     type  = word
  636.   endargument
  637. endmacro
  638. ;
  639. ;   Macro to load a string variable from a temporary result.
  640. ;
  641. macroname = LoadStr
  642.   size    = 4
  643.   mask    = $ff,$00,$00,$ff,$ff,$ff
  644.   compare = $bf,$00,$00,$1e,$57,$9a
  645.   flags   = call
  646. ;
  647. ;   Verify proper call destination.
  648. ;
  649.   argument
  650.     rbyte = 6
  651.     type  = faraddress
  652.     name  = StrStore
  653.   endargument
  654. ;
  655. ;  Address of variable to receive the data (DS relative).
  656. ;
  657.   argument
  658.     rbyte = 1
  659.     type  = address
  660.   endargument
  661. endmacro
  662. ;
  663. ;   Macro to store away a string whose address is already on the stack. The
  664. ;   max string length is the one argument here.
  665. ;
  666. macroname = StoreStr
  667.   size    = 3
  668.   mask    = $ff,$00,$00,$ff,$ff
  669.   compare = $b8,$00,$00,$50,$9a
  670.   flags   = perm
  671.   comment = "store string, ARG1=max_len"
  672.   argument
  673.     rbyte = 5
  674.     type  = faraddress
  675.     name  = StrMove
  676.   endargument
  677.   argument
  678.     rbyte = 1
  679.     type  = word
  680.   endargument
  681. endmacro
  682. ;
  683. ;   Macro to add a string constant to a string variable. The address of the
  684. ;   variable is already on the stack.
  685. ;
  686. ;     --> AddStrConst constant
  687. ;
  688. macroname = AddStrConst
  689.   size    = 4
  690.   mask    = $ff,$00,$00,$ff,$ff,$ff
  691.   compare = $bf,$00,$00,$0e,$57,$9a
  692.   flags   = call
  693. ;
  694. ;   Verify proper destination address.
  695. ;
  696.   argument
  697.     rbyte = 6
  698.     type  = faraddress
  699.     name  = StrAdd
  700.   endargument
  701. ;
  702. ;   Get address of string constant (in the CS:).
  703. ;
  704.   argument
  705.     rbyte = 1
  706.     type  = address
  707.     segment = cs
  708.   endargument
  709. endmacro
  710. ;
  711. ;=============================================================================
  712. ;   Long and short integer I/O macros.
  713. ;=============================================================================
  714. ;
  715. ;   Write a short integer (16 bits) without any formatting. With and without
  716. ;   a file id.
  717. ;
  718. macroname = WriteIntF
  719.   size    = 11
  720.   mask    = $ff,$00,$00,$ff,$ff
  721.   mask    = $ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff
  722.   compare = $bf,$00,$00,$1e,$57
  723.   compare = $a1,$00,$00,$99,$52,$50,$31,$c0,$50,$9a
  724.   flags   = call
  725.   comment = "write_int(file, var)."
  726.   argument
  727.     rbyte = 15
  728.     type  = faraddress
  729.     name  = WrtDblWd
  730.   endargument
  731.   argument
  732.     rbyte = 1
  733.     type  = address
  734.     segment = ds
  735.   endargument
  736.   argument
  737.     rbyte = 6
  738.     type  = address
  739.     segment = ds
  740.   endargument
  741. endmacro
  742. ;
  743. macroname = WriteInt
  744.   size    = 8
  745.   mask    = $ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff
  746.   compare = $a1,$00,$00,$99,$52,$50,$31,$c0,$50,$9a
  747.   flags   = call
  748.   comment = "write_int(var)."
  749.   argument
  750.     rbyte = 10
  751.     type  = faraddress
  752.     name  = WrtDblWd
  753.   endargument
  754.   argument
  755.     rbyte = 1
  756.     type  = address
  757.     segment = ds
  758.   endargument
  759. endmacro
  760. ;
  761. ;   Write a short integer (16 bits) with formatting. With and without
  762. ;   a file id.
  763. ;
  764. macroname = WriteIntF
  765.   size    = 10
  766.   mask    = $ff,$00,$00,$ff,$ff
  767.   mask    = $ff,$00,$00,$ff,$ff,$ff,$ff,$00,$00,$ff,$ff
  768.   compare = $bf,$00,$00,$1e,$57
  769.   compare = $a1,$00,$00,$99,$52,$50,$b8,$00,$00,$50,$9a
  770.   flags   = call,perm
  771.   comment = "fwrite_int(file, var, format)."
  772.   argument
  773.     rbyte = 16
  774.     type  = faraddress
  775.     name  = WrtDblWd
  776.   endargument
  777.   argument
  778.     rbyte = 1
  779.     type  = address
  780.     segment = ds
  781.   endargument
  782.   argument
  783.     rbyte = 6
  784.     type  = address
  785.     segment = ds
  786.   endargument
  787.   argument
  788.     rbyte = 12
  789.     type  = word
  790.   endargument
  791. endmacro
  792. ;
  793. macroname = WriteInt
  794.   size    = 7
  795.   mask    = $ff,$00,$00,$ff,$ff,$ff,$ff,$00,$00,$ff,$ff
  796.   compare = $a1,$00,$00,$99,$52,$50,$b8,$00,$00,$50,$9a
  797.   flags   = call,perm
  798.   comment = "fwrite_int(var, format)."
  799.   argument
  800.     rbyte = 11
  801.     type  = faraddress
  802.     name  = WrtDblWd
  803.   endargument
  804.   argument
  805.     rbyte = 1
  806.     type  = address
  807.     segment = ds
  808.   endargument
  809.   argument
  810.     rbyte = 7
  811.     type  = word
  812.   endargument
  813. endmacro
  814. ;
  815. ;   Write a long integer (32 bits) without any formatting. With and without
  816. ;   a file id.
  817. ;
  818. macroname = WriteLongF
  819.   size    = 13
  820.   mask    = $ff,$00,$00,$ff,$ff
  821.   mask    = $ff,$ff,$00,$00,$ff,$ff,$00,$00,$ff,$ff,$ff,$ff
  822.   compare = $bf,$00,$00,$1e,$57
  823.   compare = $ff,$36,$00,$00,$ff,$36,$00,$00,$31,$c0,$50,$9a
  824.   flags   = call
  825.   comment = "write_long(file, var)."
  826.   argument
  827.     rbyte = 17
  828.     type  = faraddress
  829.     name  = WrtDblWd
  830.   endargument
  831.   argument
  832.     rbyte = 1
  833.     type  = address
  834.     segment = ds
  835.   endargument
  836.   argument
  837.     rbyte = 11
  838.     type  = address
  839.     segment = ds
  840.   endargument
  841. endmacro
  842. ;
  843. macroname = WriteLong
  844.   size    = 10
  845.   mask    = $ff,$ff,$00,$00,$ff,$ff,$00,$00,$ff,$ff,$ff,$ff
  846.   compare = $ff,$36,$00,$00,$ff,$36,$00,$00,$31,$c0,$50,$9a
  847.   flags   = call
  848.   comment = "write_long(var)."
  849.   argument
  850.     rbyte = 12
  851.     type  = faraddress
  852.     name  = WrtDblWd
  853.   endargument
  854.   argument
  855.     rbyte = 6
  856.     type  = address
  857.     segment = ds
  858.   endargument
  859. endmacro
  860. ;
  861. ;   Write a long integer (32 bits) with formatting. With and without
  862. ;   a file id.
  863. ;
  864. macroname = WriteLongF
  865.   size    = 12
  866.   mask    = $ff,$00,$00,$ff,$ff
  867.   mask    = $ff,$ff,$00,$00,$ff,$ff,$00,$00,$ff,$00,$00,$ff,$ff
  868.   compare = $bf,$00,$00,$1e,$57
  869.   compare = $ff,$36,$00,$00,$ff,$36,$00,$00,$b8,$00,$00,$50,$9a
  870.   flags   = call,perm
  871.   comment = "write_long(file, var, format)."
  872.   argument
  873.     rbyte = 18
  874.     type  = faraddress
  875.     name  = WrtDblWd
  876.   endargument
  877.   argument
  878.     rbyte = 1
  879.     type  = address
  880.     segment = ds
  881.   endargument
  882.   argument
  883.     rbyte = 11
  884.     type  = address
  885.     segment = ds
  886.   endargument
  887.   argument
  888.     rbyte = 14
  889.     type  = word
  890.   endargument
  891. endmacro
  892. ;
  893. macroname = WriteLong
  894.   size    = 10
  895.   mask    = $ff,$ff,$00,$00,$ff,$ff,$00,$00,$ff,$00,$00,$ff,$ff
  896.   compare = $ff,$36,$00,$00,$ff,$36,$00,$00,$b8,$00,$00,$50,$9a
  897.   flags   = call,perm
  898.   comment = "write_long(var, format)."
  899.   argument
  900.     rbyte = 13
  901.     type  = faraddress
  902.     name  = WrtDblWd
  903.   endargument
  904.   argument
  905.     rbyte = 6
  906.     type  = address
  907.     segment = ds
  908.   endargument
  909.   argument
  910.     rbyte = 9
  911.     type  = word
  912.   endargument
  913. endmacro
  914. ;
  915. ;   Read in a long integer (32 bits) with file id.
  916. ;
  917. macroname = RdLongF
  918.   size    = 9
  919.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$00,$00,$ff,$00,$00
  920.   mask    = $ff,$ff
  921.   compare = $bf,$00,$00,$1e,$57,$9a,$00,$00,$00,$00,$a3,$00,$00
  922.   compare = $89,$16
  923.   flags   = call
  924.   comment = Read_long(file, var).
  925.   argument
  926.     rbyte = 6
  927.     type  = faraddress
  928.     name  = RdDblWrd
  929.   endargument
  930.   argument
  931.     rbyte = 1
  932.     type  = address
  933.     segment = ds
  934.   endargument
  935.   argument
  936.     rbyte = 11
  937.     type  = address
  938.     segment = ds
  939.   endargument
  940. endmacro
  941. ;
  942. macroname = ReadIntF
  943.   size    = 5
  944.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$00,$00,$ff,$00,$00
  945.   compare = $bf,$00,$00,$1e,$57,$9a,$00,$00,$00,$00,$a3,$00,$00
  946.   flags   = call
  947.   comment = Read_integer(file, var).
  948.   argument
  949.     rbyte = 6
  950.     type  = faraddress
  951.     name  = RdDblWrd
  952.   endargument
  953.   argument
  954.     rbyte = 1
  955.     type  = address
  956.     segment = ds
  957.   endargument
  958.   argument
  959.     rbyte = 11
  960.     type  = address
  961.     segment = ds
  962.   endargument
  963. endmacro
  964. ;
  965. ;   Read in a long integer (32 bits) without file id.
  966. ;
  967. macroname = RdLong
  968.   size    = 6
  969.   mask    = $ff,$00,$00,$00,$00,$ff,$00,$00
  970.   mask    = $ff,$ff
  971.   compare = $9a,$00,$00,$00,$00,$a3,$00,$00
  972.   compare = $89,$16
  973.   flags   = call
  974.   comment = Read_long(var).
  975.   argument
  976.     rbyte = 1
  977.     type  = faraddress
  978.     name  = RdDblWrd
  979.   endargument
  980.   argument
  981.     rbyte = 6
  982.     type  = address
  983.     segment = ds
  984.   endargument
  985. endmacro
  986. ;
  987. macroname = ReadInt
  988.   size    = 2
  989.   mask    = $ff,$00,$00,$00,$00,$ff,$00,$00
  990.   compare = $9a,$00,$00,$00,$00,$a3,$00,$00
  991.   flags   = call
  992.   comment = Read_integer(var).
  993.   argument
  994.     rbyte = 1
  995.     type  = faraddress
  996.     name  = RdDblWrd
  997.   endargument
  998.   argument
  999.     rbyte = 6
  1000.     type  = address
  1001.     segment = ds
  1002.   endargument
  1003. endmacro
  1004. ;
  1005. ;=============================================================================
  1006. ;   Macros used to assign file names. This is a string constant as in:
  1007. ;   ASSIGN(MYFILE,'MYNAME');
  1008. ;=============================================================================
  1009. ;
  1010. ;   The following two macros are for text file assignments.
  1011. ;
  1012. macroname = Assign_t
  1013.   size    = 7
  1014.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff
  1015.   compare = $bf,$00,$00,$1e,$57,$bf,$00,$00,$0e,$57,$9a
  1016.   flags   = call
  1017.   comment = "assign text_file, str_const"
  1018.   argument
  1019.     rbyte = 11
  1020.     type  = faraddress
  1021.     name  = Txt_asgn
  1022.   endargument
  1023.   argument
  1024.     rbyte = 1
  1025.     type  = address
  1026.     segment = ds
  1027.   endargument
  1028.   argument
  1029.     rbyte = 6
  1030.     type  = address
  1031.     segment = cs
  1032.   endargument
  1033. endmacro
  1034. ;
  1035. ;   Same as above except that the file name is specified by a variable rather
  1036. ;   than a constant. Variables are in the data segment.
  1037. ;
  1038. macroname = Assign_t
  1039.   size    = 7
  1040.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff
  1041.   compare = $bf,$00,$00,$1e,$57,$bf,$00,$00,$1e,$57,$9a
  1042.   flags   = call
  1043.   comment = "assign text_file, str_var"
  1044.   argument
  1045.     rbyte = 11
  1046.     type  = faraddress
  1047.     name  = Txt_asgn
  1048.   endargument
  1049.   argument
  1050.     rbyte = 1
  1051.     type  = address
  1052.     segment = ds
  1053.   endargument
  1054.   argument
  1055.     rbyte = 6
  1056.     type  = address
  1057.     segment = ds
  1058.   endargument
  1059. endmacro
  1060. ;
  1061. ;   These two are for binary file assignments.
  1062. ;
  1063. macroname = Assign_b
  1064.   size    = 7
  1065.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff
  1066.   compare = $bf,$00,$00,$1e,$57,$bf,$00,$00,$0e,$57,$9a
  1067.   flags   = call
  1068.   comment = "assign binary_file, str_const"
  1069.   argument
  1070.     rbyte = 11
  1071.     type  = faraddress
  1072.     name  = Bin_asgn
  1073.   endargument
  1074.   argument
  1075.     rbyte = 1
  1076.     type  = address
  1077.     segment = ds
  1078.   endargument
  1079.   argument
  1080.     rbyte = 6
  1081.     type  = address
  1082.     segment = cs
  1083.   endargument
  1084. endmacro
  1085. ;
  1086. ;   Same as above except that the file name is specified by a variable rather
  1087. ;   than a constant. Variables are in the data segment.
  1088. ;
  1089. macroname = Assign_b
  1090.   size    = 7
  1091.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff
  1092.   compare = $bf,$00,$00,$1e,$57,$bf,$00,$00,$1e,$57,$9a
  1093.   flags   = call
  1094.   comment = "assign binary_file, str_var"
  1095.   argument
  1096.     rbyte = 11
  1097.     type  = faraddress
  1098.     name  = Bin_asgn
  1099.   endargument
  1100.   argument
  1101.     rbyte = 1
  1102.     type  = address
  1103.     segment = ds
  1104.   endargument
  1105.   argument
  1106.     rbyte = 6
  1107.     type  = address
  1108.     segment = ds
  1109.   endargument
  1110. endmacro
  1111. ;
  1112. ;   Macros to open files. RESET opens them for reading while REWRITE opens
  1113. ;   them for writing. As in:
  1114. ;
  1115. ;   RESET(myfile);
  1116. ;   REWRITE(myfile);
  1117. ;
  1118. ;   The following two macros is used for text files.
  1119. ;
  1120. macroname = Reset_t
  1121.   size    = 4
  1122.   mask    = $ff,$00,$00,$ff,$ff,$ff
  1123.   compare = $bf,$00,$00,$1e,$57,$9a
  1124.   flags   = call
  1125.   comment = reset text_file
  1126.   argument
  1127.     rbyte = 6
  1128.     type  = faraddress
  1129.     name  = TxtReset
  1130.   endargument
  1131.   argument
  1132.     rbyte = 1
  1133.     type  = address
  1134.     segment = ds
  1135.   endargument
  1136. endmacro
  1137. ;
  1138. ;   Same as above for rewrite().
  1139. ;
  1140. macroname = Rewrit_t
  1141.   size    = 4
  1142.   mask    = $ff,$00,$00,$ff,$ff,$ff
  1143.   compare = $bf,$00,$00,$1e,$57,$9a
  1144.   flags   = call
  1145.   comment = rewrite text_file
  1146.   argument
  1147.     rbyte = 6
  1148.     type  = faraddress
  1149.     name  = TxtWrite
  1150.   endargument
  1151.   argument
  1152.     rbyte = 1
  1153.     type  = address
  1154.     segment = ds
  1155.   endargument
  1156. endmacro
  1157. ;
  1158. ;   These two macros are similar to the above except that they are used with
  1159. ;   binary (rather than text) files.
  1160. ;
  1161. macroname = Reset_b
  1162.   size    = 6
  1163.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff
  1164.   compare = $bf,$00,$00,$1e,$57,$b8,$00,$00,$50,$9a
  1165.   flags   = call,perm
  1166.   comment = "reset binary_file, rec_size"
  1167.   argument
  1168.     rbyte = 10
  1169.     type  = faraddress
  1170.     name  = BinReset
  1171.   endargument
  1172.   argument
  1173.     rbyte = 1
  1174.     type  = address
  1175.     segment = ds
  1176.   endargument
  1177.   argument
  1178.     rbyte = 6
  1179.     type  = word
  1180.   endargument
  1181. endmacro
  1182. ;
  1183. macroname = Rewrite_b
  1184.   size    = 6
  1185.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff
  1186.   compare = $bf,$00,$00,$1e,$57,$b8,$00,$00,$50,$9a
  1187.   flags   = call,perm
  1188.   comment = "rewrite binary_file, rec_size"
  1189.   argument
  1190.     rbyte = 10
  1191.     type  = faraddress
  1192.     name  = BinWrite
  1193.   endargument
  1194.   argument
  1195.     rbyte = 1
  1196.     type  = address
  1197.     segment = ds
  1198.   endargument
  1199.   argument
  1200.     rbyte = 6
  1201.     type  = word
  1202.   endargument
  1203. endmacro
  1204. ;
  1205. ;============================================================================
  1206. ;   Macros for the CRT unit.
  1207. ;============================================================================
  1208. ;
  1209. ;   Macros for the GOTOXY(x,y) procedure. Arguments (x and y) can be either
  1210. ;   byte constants or variables.
  1211. ;
  1212. ;   First the form with 2 byte constant arguments.
  1213. ;
  1214. macroname = GotoXY
  1215.   size    = 5
  1216.   mask    = $ff,$00,$ff,$ff,$00,$ff,$ff
  1217.   compare = $b0,$00,$50,$b0,$00,$50,$9a
  1218.   flags   = call
  1219.   comment = "gotoxy(ARG1,ARG2)"
  1220.   argument
  1221.     rbyte = 7
  1222.     type  = faraddress
  1223.     name  = GotoXYp
  1224.   endargument
  1225.   argument
  1226.     rbyte = 1
  1227.     type  = byte
  1228.   endargument
  1229.   argument
  1230.     rbyte = 4
  1231.     type  = byte
  1232.   endargument
  1233. endmacro
  1234. ;
  1235. ;   Now the form with the first argument a variable and the second a constant.
  1236. ;
  1237. macroname = GotoXY
  1238.   size    = 5
  1239.   mask    = $ff,$00,$00,$ff,$ff,$00,$ff,$ff
  1240.   compare = $a0,$00,$00,$50,$b0,$00,$50,$9a
  1241.   flags   = call
  1242.   comment = "gotoxy(ARG1,ARG2)"
  1243.   argument
  1244.     rbyte = 8
  1245.     type  = faraddress
  1246.     name  = GotoXYp
  1247.   endargument
  1248.   argument
  1249.     rbyte = 1
  1250.     type  = address
  1251.     segment = ds
  1252.   endargument
  1253.   argument
  1254.     rbyte = 5
  1255.     type  = byte
  1256.   endargument
  1257. endmacro
  1258. ;
  1259. ;   Now same but second argument is a variable.
  1260. ;
  1261. macroname = GotoXY
  1262.   size    = 5
  1263.   mask    = $ff,$00,$ff,$ff,$00,$00,$ff,$ff
  1264.   compare = $b0,$00,$50,$a0,$00,$00,$50,$9a
  1265.   flags   = call
  1266.   comment = "gotoxy(ARG1,ARG2)"
  1267.   argument
  1268.     rbyte = 8
  1269.     type  = faraddress
  1270.     name  = GotoXYp
  1271.   endargument
  1272.   argument
  1273.     rbyte = 1
  1274.     type  = byte
  1275.   endargument
  1276.   argument
  1277.     rbyte = 4
  1278.     type  = address
  1279.     segment = ds
  1280.   endargument
  1281. endmacro
  1282. ;
  1283. ;   Now with both arguments variables.
  1284. ;
  1285. macroname = GotoXY
  1286.   size    = 5
  1287.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff,$ff
  1288.   compare = $a0,$00,$00,$50,$a0,$00,$00,$50,$9a
  1289.   flags   = call
  1290.   comment = "gotoxy(ARG1,ARG2)"
  1291.   argument
  1292.     rbyte = 9
  1293.     type  = faraddress
  1294.     name  = GotoXYp
  1295.   endargument
  1296.   argument
  1297.     rbyte = 1
  1298.     type  = address
  1299.     segment = ds
  1300.   endargument
  1301.   argument
  1302.     rbyte = 5
  1303.     type  = address
  1304.     segment = ds
  1305.   endargument
  1306. endmacro
  1307. ;
  1308. ;   Macro for the delay procedure. The argument may be either an integer
  1309. ;   constant or variable.
  1310. ;
  1311. macroname = Delay
  1312.   size    = 3
  1313.   mask    = $ff,$00,$00,$ff,$ff
  1314.   compare = $b8,$00,$00,$50,$9a
  1315.   flags   = call,perm
  1316.   comment = "delay(ms)"
  1317.   argument
  1318.     rbyte = 5
  1319.     type  = faraddress
  1320.     name  = Delay_p
  1321.   endargument
  1322.   argument
  1323.     rbyte = 1
  1324.     type  = word
  1325.   endargument
  1326. endmacro
  1327. ;
  1328. macroname = Delay
  1329.   size    = 3
  1330.   mask    = $ff,$ff,$00,$00,$ff
  1331.   compare = $ff,$36,$00,$00,$9a
  1332.   flags   = call
  1333.   comment = "delay(ms)"
  1334.   argument
  1335.     rbyte = 5
  1336.     type  = faraddress
  1337.     name  = Delay_p
  1338.   endargument
  1339.   argument
  1340.     rbyte = 2
  1341.     type  = address
  1342.     segment = ds
  1343.   endargument
  1344. endmacro
  1345. ;
  1346. ;   Macro to get the key pressed status.
  1347. ;
  1348. macroname = KeyPressed
  1349.   size    = 2
  1350.   mask    = $ff,$00,$00,$00,$00,$ff
  1351.   compare = $9a,$00,$00,$00,$00,$a2
  1352.   flags   = call
  1353.   comment = ARG1=keypressed()
  1354.   argument
  1355.     rbyte = 1
  1356.     type  = faraddress
  1357.     name  = KeyPrest
  1358.   endargument
  1359.   argument
  1360.     rbyte = 6
  1361.     type  = address
  1362.     segment = ds
  1363.   endargument
  1364. endmacro
  1365. ;
  1366. ;   Macro to test key pressed status.
  1367. ;
  1368. macroname = IfNoKey
  1369.   size    = 4
  1370.   mask    = $ff,$00,$00,$00,$00,$ff,$ff,$ff
  1371.   compare = $9a,$00,$00,$00,$00,$08,$c0,$74
  1372.   flags   = call
  1373.   comment = "if not KeyPressed then goto ARG"
  1374.   argument
  1375.     rbyte = 1
  1376.     type  = faraddress
  1377.     name  = KeyPrest
  1378.   endargument
  1379.   argument
  1380.     rbyte = 8
  1381.     type  = nearaddress
  1382.   endargument
  1383. endmacro
  1384. ;
  1385. ;   Macro to set the sound at the speeker. The first form uses an integer
  1386. ;   constant as the frequency indicator.
  1387. ;
  1388. macroname = SetSound
  1389.   size    = 3
  1390.   mask    = $ff,$00,$00,$ff,$ff
  1391.   compare = $b8,$00,$00,$50,$9a
  1392.   flags   = call,perm
  1393.   comment = set sound pitch to ARG1.
  1394.   argument
  1395.     rbyte = 5
  1396.     type  = faraddress
  1397.     name  = Sound
  1398.   endargument
  1399.   argument
  1400.     rbyte = 1
  1401.     type  = word
  1402.   endargument
  1403. endmacro
  1404. ;
  1405. ;   Above but using a variable rather than a constant.
  1406. ;
  1407. macroname = SetSound
  1408.   size    = 3
  1409.   mask    = $ff,$ff,$00,$00,$ff
  1410.   compare = $ff,$36,$00,$00,$9a
  1411.   flags   = call
  1412.   comment = set sound pitch to ARG1.
  1413.   argument
  1414.     rbyte = 5
  1415.     type  = faraddress
  1416.     name  = Sound
  1417.   endargument
  1418.   argument
  1419.     rbyte = 2
  1420.     type  = address
  1421.     segment = ds
  1422.   endargument
  1423. endmacro
  1424. ;
  1425. ;   Macros to set the background color. First uses a constant color number.
  1426. ;
  1427. macroname = TextBackground
  1428.   size    = 3
  1429.   mask    = $ff,$00,$ff,$ff
  1430.   compare = $b0,$00,$50,$9a
  1431.   flags   = call
  1432.   comment = set background color to ARG1
  1433.   argument
  1434.     rbyte = 4
  1435.     type  = faraddress
  1436.     name  = TxtBkg
  1437.   endargument
  1438.   argument
  1439.     rbyte = 1
  1440.     type  = byte
  1441.   endargument
  1442. endmacro
  1443. ;
  1444. ;   This one uses a byte variable as the color number.
  1445. ;
  1446. macroname = TextBackground
  1447.   size    = 3
  1448.   mask    = $ff,$00,$00,$ff,$ff
  1449.   compare = $a0,$00,$00,$50,$9a
  1450.   flags   = call
  1451.   comment = set background color to ARG1
  1452.   argument
  1453.     rbyte = 5
  1454.     type  = faraddress
  1455.     name  = TxtBkg
  1456.   endargument
  1457.   argument
  1458.     rbyte = 1
  1459.     type  = address
  1460.     segment = ds
  1461.   endargument
  1462. endmacro
  1463. ;
  1464. ;   Macros to set the foreground color. First uses a constant color number.
  1465. ;
  1466. macroname = TextColor
  1467.   size    = 3
  1468.   mask    = $ff,$00,$ff,$ff
  1469.   compare = $b0,$00,$50,$9a
  1470.   flags   = call
  1471.   comment = set foreground color to ARG1
  1472.   argument
  1473.     rbyte = 4
  1474.     type  = faraddress
  1475.     name  = TxtColor
  1476.   endargument
  1477.   argument
  1478.     rbyte = 1
  1479.     type  = byte
  1480.   endargument
  1481. endmacro
  1482. ;
  1483. ;   This one uses a byte variable as the color number.
  1484. ;
  1485. macroname = TextColor
  1486.   size    = 3
  1487.   mask    = $ff,$00,$00,$ff,$ff
  1488.   compare = $a0,$00,$00,$50,$9a
  1489.   flags   = call
  1490.   comment = set foreground color to ARG1
  1491.   argument
  1492.     rbyte = 5
  1493.     type  = faraddress
  1494.     name  = TxtColor
  1495.   endargument
  1496.   argument
  1497.     rbyte = 1
  1498.     type  = address
  1499.     segment = ds
  1500.   endargument
  1501. endmacro
  1502. ;
  1503. ;   Macro to read a key and store result in a byte variable.
  1504. ;
  1505. macroname = GetKey
  1506.   size    = 2
  1507.   mask    = $ff,$00,$00,$00,$00,$ff
  1508.   compare = $9a,$00,$00,$00,$00,$a2
  1509.   flags   = call
  1510.   comment = ARG:=ReadKey;
  1511.   argument
  1512.     rbyte = 1
  1513.     type  = faraddress
  1514.     name  = ReadKey
  1515.   endargument
  1516.   argument
  1517.     rbyte = 6
  1518.     type  = address
  1519.     segment = ds
  1520.   endargument
  1521. endmacro
  1522. ;
  1523. ;   Macro to test a keystroke against a character constant.
  1524. ;
  1525. macroname = TestKey
  1526.   size    = 3
  1527.   mask    = $ff,$00,$00,$00,$00,$ff,$00,$ff
  1528.   compare = $9a,$00,$00,$00,$00,$3c,$00,$75
  1529.   flags   = call
  1530.   comment = if ReadKey<>ARG1 then goto ARG2
  1531.   argument
  1532.     rbyte = 1
  1533.     type  = faraddress
  1534.     name  = ReadKey
  1535.   endargument
  1536.   argument
  1537.     rbyte = 6
  1538.     type  = character
  1539.   endargument
  1540.   argument
  1541.     rbyte = 8
  1542.     type  = nearaddress
  1543.   endargument
  1544. endmacro
  1545. ;
  1546. ;   Macro to set the text mode using an integer constant.
  1547. ;
  1548. macroname = TextMode
  1549.   size    = 3
  1550.   mask    = $ff,$00,$00,$ff,$ff
  1551.   compare = $b8,$00,$00,$50,$9a
  1552.   flags   = call,perm
  1553.   comment = set text mode to ARG1
  1554.   argument
  1555.     rbyte = 5
  1556.     type  = faraddress
  1557.     name  = TxtMode
  1558.   endargument
  1559.   argument
  1560.     rbyte = 1
  1561.     type  = word
  1562.   endargument
  1563. endmacro
  1564. ;
  1565. ;   Same ass above except using an integer variable as the argument.
  1566. ;
  1567. macroname = TextMode
  1568.   size    = 3
  1569.   mask    = $ff,$ff,$00,$00,$ff
  1570.   compare = $ff,$36,$00,$00,$9a
  1571.   flags   = call
  1572.   comment = set text mode to ARG1
  1573.   argument
  1574.     rbyte = 5
  1575.     type  = faraddress
  1576.     name  = TxtMode
  1577.   endargument
  1578.   argument
  1579.     rbyte = 2
  1580.     type  = address
  1581.     segment = ds
  1582.   endargument
  1583. endmacro
  1584. ;
  1585. ;   Macros to determine the current 'X' location on the screen. The first one
  1586. ;   stuffs the result into an integer variable.
  1587. ;
  1588. macroname = WhereX
  1589.   size    = 4
  1590.   mask    = $ff,$00,$00,$00,$00,$ff,$ff,$ff
  1591.   compare = $9a,$00,$00,$00,$00,$30,$e4,$a3
  1592.   flags   = call
  1593.   comment = int ARG1:=current 'x' pos
  1594.   argument
  1595.     rbyte = 1
  1596.     type  = faraddress
  1597.     name  = Where_X
  1598.   endargument
  1599.   argument
  1600.     rbyte = 8
  1601.     type  = address
  1602.     segment = ds
  1603.   endargument
  1604. endmacro
  1605. ;
  1606. ;   This macro will stuff the result into a byte variable.
  1607. ;
  1608. macroname = WhereX
  1609.   size    = 2
  1610.   mask    = $ff,$00,$00,$00,$00,$ff
  1611.   compare = $9a,$00,$00,$00,$00,$a2
  1612.   flags   = call
  1613.   comment = byte ARG1:=current 'x' pos
  1614.   argument
  1615.     rbyte = 1
  1616.     type  = faraddress
  1617.     name  = Where_X
  1618.   endargument
  1619.   argument
  1620.     rbyte = 6
  1621.     type  = address
  1622.     segment = ds
  1623.   endargument
  1624. endmacro
  1625. ;
  1626. ;   Macros to determine the current 'Y' location on the screen. The first one
  1627. ;   stuffs the result into an integer variable.
  1628. ;
  1629. macroname = WhereY
  1630.   size    = 4
  1631.   mask    = $ff,$00,$00,$00,$00,$ff,$ff,$ff
  1632.   compare = $9a,$00,$00,$00,$00,$30,$e4,$a3
  1633.   flags   = call
  1634.   comment = int ARG1:=current 'y' pos
  1635.   argument
  1636.     rbyte = 1
  1637.     type  = faraddress
  1638.     name  = Where_Y
  1639.   endargument
  1640.   argument
  1641.     rbyte = 8
  1642.     type  = address
  1643.     segment = ds
  1644.   endargument
  1645. endmacro
  1646. ;
  1647. ;   This macro will stuff the result into a byte variable.
  1648. ;
  1649. macroname = WhereY
  1650.   size    = 2
  1651.   mask    = $ff,$00,$00,$00,$00,$ff
  1652.   compare = $9a,$00,$00,$00,$00,$a2
  1653.   flags   = call
  1654.   comment = byte ARG1:=current 'y' pos
  1655.   argument
  1656.     rbyte = 1
  1657.     type  = faraddress
  1658.     name  = Where_Y
  1659.   endargument
  1660.   argument
  1661.     rbyte = 6
  1662.     type  = address
  1663.     segment = ds
  1664.   endargument
  1665. endmacro
  1666. ;
  1667. ;=============================================================================
  1668. ;   These macros must be last. They should be used only if one of the above,
  1669. ;   more general, macros does not fit. These are less dependent on the
  1670. ;   compiler being used.
  1671. ;=============================================================================
  1672. ;
  1673. ;   Macros to test integer variables for zero or not zero and jump if true.
  1674. ;
  1675. macroname = IFZERO
  1676.   size    = 4
  1677.   mask    = $ff,$ff,$00,$00,$ff,$ff,$00
  1678.   compare = $80,$3e,$00,$00,$00,$74,$00
  1679.   comment = if ARG1=0 then goto ARG2
  1680.   argument
  1681.     rbyte = 2
  1682.     type  = address
  1683.     segment = ds
  1684.   endargument
  1685.   argument
  1686.     rbyte = 6
  1687.     type  = nearaddress
  1688.   endargument
  1689. endmacro
  1690. ;
  1691. macroname = IFNZ
  1692.   size    = 4
  1693.   mask    = $ff,$ff,$00,$00,$ff,$ff,$00
  1694.   compare = $80,$3e,$00,$00,$00,$75,$00
  1695.   comment = if ARG1<>0 then goto ARG2
  1696.   argument
  1697.     rbyte = 2
  1698.     type  = address
  1699.     segment = ds
  1700.   endargument
  1701.   argument
  1702.     rbyte = 6
  1703.     type  = nearaddress
  1704.   endargument
  1705. endmacro
  1706. ;
  1707. ;   Macro to test an integer to see if it equals a particular constant or not.
  1708. ;
  1709. macroname = IFEQ
  1710.   size    = 3
  1711.   mask    = $ff,$00,$00,$ff,$00,$00,$ff
  1712.   compare = $a1,$00,$00,$3d,$00,$00,$74
  1713.   flags   = perm
  1714.   comment = if ARG1 = ARG2 then goto ARG3
  1715.   argument
  1716.     rbyte = 1
  1717.     type  = address
  1718.     segment = ds
  1719.   endargument
  1720.   argument
  1721.     rbyte = 4
  1722.     type  = word
  1723.   endargument
  1724.   argument
  1725.     rbyte = 7
  1726.     type  = nearaddress
  1727.   endargument
  1728. endmacro
  1729. ;
  1730. ;   Macro to test an integer to see if it does not equal a particular constant.
  1731. ;
  1732. macroname = IFNEQ
  1733.   size    = 3
  1734.   mask    = $ff,$00,$00,$ff,$00,$00,$ff
  1735.   compare = $a1,$00,$00,$3d,$00,$00,$75
  1736.   flags   = perm
  1737.   comment = if ARG1 <> ARG2 then goto ARG3
  1738.   argument
  1739.     rbyte = 1
  1740.     type  = address
  1741.     segment = ds
  1742.   endargument
  1743.   argument
  1744.     rbyte = 4
  1745.     type  = word
  1746.   endargument
  1747.   argument
  1748.     rbyte = 7
  1749.     type  = nearaddress
  1750.   endargument
  1751. endmacro
  1752. ;
  1753. ;   Macro for an integer function tests.
  1754. ;
  1755. ;   if funct() <= 0 then goto ...
  1756. ;
  1757. macroname = IFLEZ
  1758.   size    = 4
  1759.   mask    = $ff,$00,$00,$00,$00,$ff,$ff,$ff
  1760.   compare = $9a,$00,$00,$00,$00,$09,$c0,$7e
  1761.   comment = if ARG1() <= 0 then goto ARG2
  1762.   argument
  1763.     rbyte = 1
  1764.     type  = faraddress
  1765.   endargument
  1766.   argument
  1767.     rbyte = 8
  1768.     type  = nearaddress
  1769.   endargument
  1770. endmacro
  1771. ;
  1772. ;   if funct() < 0 then goto ...
  1773. ;
  1774. macroname = IFLTZ
  1775.   size    = 4
  1776.   mask    = $ff,$00,$00,$00,$00,$ff,$ff,$ff
  1777.   compare = $9a,$00,$00,$00,$00,$09,$c0,$7c
  1778.   comment = if ARG1() < 0 then goto ARG2
  1779.   argument
  1780.     rbyte = 1
  1781.     type  = faraddress
  1782.   endargument
  1783.   argument
  1784.     rbyte = 8
  1785.     type  = nearaddress
  1786.   endargument
  1787. endmacro
  1788. ;
  1789. ;   if funct() >= 0 then goto ...
  1790. ;
  1791. macroname = IFGEZ
  1792.   size    = 4
  1793.   mask    = $ff,$00,$00,$00,$00,$ff,$ff,$ff
  1794.   compare = $9a,$00,$00,$00,$00,$09,$c0,$7d
  1795.   comment = if ARG1() >= 0 then goto ARG2
  1796.   argument
  1797.     rbyte = 1
  1798.     type  = faraddress
  1799.   endargument
  1800.   argument
  1801.     rbyte = 8
  1802.     type  = nearaddress
  1803.   endargument
  1804. endmacro
  1805. ;
  1806. ;   if funct() > 0 then goto ...
  1807. ;
  1808. macroname = IFGTZ
  1809.   size    = 4
  1810.   mask    = $ff,$00,$00,$00,$00,$ff,$ff,$ff
  1811.   compare = $9a,$00,$00,$00,$00,$09,$c0,$7f
  1812.   comment = if ARG1() > 0 then goto ARG2
  1813.   argument
  1814.     rbyte = 1
  1815.     type  = faraddress
  1816.   endargument
  1817.   argument
  1818.     rbyte = 8
  1819.     type  = nearaddress
  1820.   endargument
  1821. endmacro
  1822. ;
  1823. ;   Test two global integers and jump if condition met.
  1824. ;
  1825. macroname = IFEQ
  1826.   size    = 4
  1827.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  1828.   compare = $a1,$00,$00,$3b,$06,$00,$00,$74
  1829.   comment = if ARG1 = ARG2 goto ARG3
  1830.   argument
  1831.     rbyte = 1
  1832.     type  = address
  1833.     segment = ds
  1834.   endargument
  1835.   argument
  1836.     rbyte = 5
  1837.     type  = address
  1838.     segment = ds
  1839.   endargument
  1840.   argument
  1841.     rbyte = 8
  1842.     type  = nearaddress
  1843.   endargument
  1844. endmacro
  1845. ;
  1846. macroname = IFNEQ
  1847.   size    = 4
  1848.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  1849.   compare = $a1,$00,$00,$3b,$06,$00,$00,$75
  1850.   comment = if ARG1 <> ARG2 goto ARG3
  1851.   argument
  1852.     rbyte = 1
  1853.     type  = address
  1854.     segment = ds
  1855.   endargument
  1856.   argument
  1857.     rbyte = 5
  1858.     type  = address
  1859.     segment = ds
  1860.   endargument
  1861.   argument
  1862.     rbyte = 8
  1863.     type  = nearaddress
  1864.   endargument
  1865. endmacro
  1866. ;
  1867. macroname = IFLE
  1868.   size    = 4
  1869.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  1870.   compare = $a1,$00,$00,$3b,$06,$00,$00,$76
  1871.   comment = if ARG1 <= ARG2 goto ARG3
  1872.   argument
  1873.     rbyte = 1
  1874.     type  = address
  1875.     segment = ds
  1876.   endargument
  1877.   argument
  1878.     rbyte = 5
  1879.     type  = address
  1880.     segment = ds
  1881.   endargument
  1882.   argument
  1883.     rbyte = 8
  1884.     type  = nearaddress
  1885.   endargument
  1886. endmacro
  1887. ;
  1888. macroname = IFLT
  1889.   size    = 4
  1890.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  1891.   compare = $a1,$00,$00,$3b,$06,$00,$00,$72
  1892.   comment = if ARG1 < ARG2 goto ARG3
  1893.   argument
  1894.     rbyte = 1
  1895.     type  = address
  1896.     segment = ds
  1897.   endargument
  1898.   argument
  1899.     rbyte = 5
  1900.     type  = address
  1901.     segment = ds
  1902.   endargument
  1903.   argument
  1904.     rbyte = 8
  1905.     type  = nearaddress
  1906.   endargument
  1907. endmacro
  1908. ;
  1909. macroname = IFGE
  1910.   size    = 4
  1911.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  1912.   compare = $a1,$00,$00,$3b,$06,$00,$00,$73
  1913.   comment = if ARG1 >= ARG2 goto ARG3
  1914.   argument
  1915.     rbyte = 1
  1916.     type  = address
  1917.     segment = ds
  1918.   endargument
  1919.   argument
  1920.     rbyte = 5
  1921.     type  = address
  1922.     segment = ds
  1923.   endargument
  1924.   argument
  1925.     rbyte = 8
  1926.     type  = nearaddress
  1927.   endargument
  1928. endmacro
  1929. ;
  1930. macroname = IFGT
  1931.   size    = 4
  1932.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  1933.   compare = $a1,$00,$00,$3b,$06,$00,$00,$77
  1934.   comment = if ARG1 > ARG2 goto ARG3
  1935.   argument
  1936.     rbyte = 1
  1937.     type  = address
  1938.     segment = ds
  1939.   endargument
  1940.   argument
  1941.     rbyte = 5
  1942.     type  = address
  1943.     segment = ds
  1944.   endargument
  1945.   argument
  1946.     rbyte = 8
  1947.     type  = nearaddress
  1948.   endargument
  1949. endmacro
  1950. ;
  1951. ;   Test two local integers and jump if condition met.
  1952. ;
  1953. macroname = IFEQ
  1954.   size    = 4
  1955.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  1956.   compare = $8b,$00,$00,$3b,$06,$00,$00,$74
  1957.   comment = if ARG1 = ARG2 goto ARG3
  1958.   argument
  1959.     rbyte = 1
  1960.     type  = address
  1961.     segment = ds
  1962.   endargument
  1963.   argument
  1964.     rbyte = 5
  1965.     type  = address
  1966.     segment = ds
  1967.   endargument
  1968.   argument
  1969.     rbyte = 8
  1970.     type  = nearaddress
  1971.   endargument
  1972. endmacro
  1973. ;
  1974. macroname = IFNEQ
  1975.   size    = 4
  1976.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  1977.   compare = $8b,$00,$00,$3b,$06,$00,$00,$75
  1978.   comment = if LARG1 <> LARG2 goto ARG3
  1979.   argument
  1980.     rbyte = 1
  1981.     type  = word
  1982.   endargument
  1983.   argument
  1984.     rbyte = 5
  1985.     type  = word
  1986.   endargument
  1987.   argument
  1988.     rbyte = 8
  1989.     type  = nearaddress
  1990.   endargument
  1991. endmacro
  1992. ;
  1993. macroname = IFLE
  1994.   size    = 4
  1995.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  1996.   compare = $8b,$00,$00,$3b,$06,$00,$00,$76
  1997.   comment = if LARG1 <= LARG2 goto ARG3
  1998.   argument
  1999.     rbyte = 1
  2000.     type  = word
  2001.   endargument
  2002.   argument
  2003.     rbyte = 5
  2004.     type  = word
  2005.   endargument
  2006.   argument
  2007.     rbyte = 8
  2008.     type  = nearaddress
  2009.   endargument
  2010. endmacro
  2011. ;
  2012. macroname = IFLT
  2013.   size    = 4
  2014.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  2015.   compare = $8b,$00,$00,$3b,$06,$00,$00,$72
  2016.   comment = if LARG1 < LARG2 goto ARG3
  2017.   argument
  2018.     rbyte = 1
  2019.     type  = word
  2020.   endargument
  2021.   argument
  2022.     rbyte = 5
  2023.     type  = word
  2024.   endargument
  2025.   argument
  2026.     rbyte = 8
  2027.     type  = nearaddress
  2028.   endargument
  2029. endmacro
  2030. ;
  2031. macroname = IFGE
  2032.   size    = 4
  2033.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  2034.   compare = $8b,$00,$00,$3b,$06,$00,$00,$73
  2035.   comment = if LARG1 >= LARG2 goto ARG3
  2036.   argument
  2037.     rbyte = 1
  2038.     type  = word
  2039.   endargument
  2040.   argument
  2041.     rbyte = 5
  2042.     type  = word
  2043.   endargument
  2044.   argument
  2045.     rbyte = 8
  2046.     type  = nearaddress
  2047.   endargument
  2048. endmacro
  2049. ;
  2050. macroname = IFGT
  2051.   size    = 4
  2052.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  2053.   compare = $8b,$00,$00,$3b,$06,$00,$00,$77
  2054.   comment = if LARG1 > LARG2 goto ARG3
  2055.   argument
  2056.     rbyte = 1
  2057.     type  = word
  2058.   endargument
  2059.   argument
  2060.     rbyte = 5
  2061.     type  = word
  2062.   endargument
  2063.   argument
  2064.     rbyte = 8
  2065.     type  = nearaddress
  2066.   endargument
  2067. endmacro
  2068. ;
  2069. ;   Simple integer assignment. Statement form is "i:=j;".
  2070. ;
  2071. macroname = AsgnInt
  2072.   size    = 2
  2073.   mask    = $ff,$00,$00,$ff
  2074.   compare = $a1,$00,$00,$a3
  2075.   comment = "int assign, ARG2:=ARG1"
  2076.   argument
  2077.     rbyte = 1
  2078.     type  = address
  2079.     segment = ds
  2080.   endargument
  2081.   argument
  2082.     rbyte = 4
  2083.     type = address
  2084.     segment = ds
  2085.   endargument
  2086.  endmacro
  2087. ;
  2088. ;   Macro to set an interupt vector's handler address.
  2089. ;
  2090. macroname = SetVector
  2091.   size    = 5
  2092.   mask    = $ff,$00,$00,$ff,$00,$ff,$ff,$ff
  2093.   compare = $ba,$00,$00,$b8,$00,$25,$cd,$21
  2094.   flags   = call
  2095. ;
  2096. ;   First show the interupt intercepted.
  2097. ;
  2098.   argument
  2099.     rbyte = 4
  2100.     type  = byte
  2101.   endargument
  2102. ;
  2103. ;   Now the handler's address.
  2104. ;
  2105.   argument
  2106.     rbyte = 1
  2107.     type  = address
  2108.     segment = cs
  2109.   endargument
  2110. endmacro
  2111. ;
  2112. ;   Macro to push the long address of a CONSTANT to the stack. Constants are
  2113. ;   stored in the code segment.
  2114. ;
  2115. macroname = PushConstAddr
  2116.   size    = 3
  2117.   mask    = $ff,$00,$00,$ff,$ff
  2118.   compare = $bf,$00,$00,$0e,$57
  2119.   comment = push address of constant
  2120. ;
  2121. ;   Get address of constant to push.
  2122. ;
  2123.   argument
  2124.     rbyte = 1
  2125.     type  = address
  2126.     segment = cs
  2127.   endargument
  2128. endmacro
  2129. ;
  2130. ;   Macro to push the long address of a VARIABLE to the stack. Variables are
  2131. ;   stored in the data segment.
  2132. ;
  2133. macroname = PushVarAddr
  2134.   size    = 3
  2135.   mask    = $ff,$00,$00,$ff,$ff
  2136.   compare = $bf,$00,$00,$1e,$57
  2137.   comment = push address of variable
  2138. ;
  2139. ;   Get address of constant to push.
  2140. ;
  2141.   argument
  2142.     rbyte = 1
  2143.     type  = address
  2144.     segment = ds
  2145.   endargument
  2146. endmacro
  2147. ;
  2148. ;   Macro to push the address of a VAR argument. That is where its address is
  2149. ;   passed on the stack.
  2150. ;
  2151. macroname = PushArgAddr
  2152.   size    = 4
  2153.   mask    = $ff,$ff,$00,$ff,$ff
  2154.   compare = $c4,$7e,$00,$06,$57
  2155.   comment = push address of local variable
  2156.   argument
  2157.     rbyte = 2
  2158.     type  = byte
  2159.   endargument
  2160. endmacro
  2161. ;
  2162. ;   Macro to push the address of a local variable to the stack.
  2163. ;
  2164. macroname = PushLocalAddr
  2165.   size    = 4
  2166.   mask    = $ff,$ff,$00,$00,$ff,$ff
  2167.   compare = $8d,$be,$00,$00,$16,$57
  2168.   comment = push addr of LVAR
  2169.   argument
  2170.     rbyte = 2
  2171.     type  = word
  2172.   endargument
  2173. endmacro
  2174. ;
  2175. ;   Get the address of a global variable.
  2176. ;
  2177. macroname = GetAddr
  2178.   size    = 6
  2179.   mask    = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff
  2180.   compare = $b8,$00,$00,$8c,$da,$a3,$00,$00,$89,$16
  2181.   comment = "ARG2 = address of ARG1"
  2182.   argument
  2183.     rbyte = 1
  2184.     type  = address
  2185.     segment = ds
  2186.   endargument
  2187.   argument
  2188.     rbyte = 6
  2189.     type  = address
  2190.     segment = ds
  2191.   endargument
  2192. endmacro
  2193. ;
  2194. ;   Get the address of a global procedure.
  2195. ;
  2196. macroname = GetAddr
  2197.   size    = 7
  2198.   mask    = $ff,$00,$00,$ff,$ff,$ff,$ff,$00,$00,$ff,$ff
  2199.   compare = $b8,$00,$00,$ba,$00,$00,$a3,$00,$00,$89,$16
  2200.   comment = "ARG2 = address of proc ARG1"
  2201.   argument
  2202.     rbyte = 1
  2203.     type  = address
  2204.     segment = cs
  2205.   endargument
  2206.   argument
  2207.     rbyte = 7
  2208.     type  = address
  2209.     segment = ds
  2210.   endargument
  2211. endmacro
  2212. ;
  2213. ;   Macro to push an immediate value.
  2214. ;
  2215. macroname = _PushWrd   ; push three words in a row.
  2216.   size    = 6
  2217.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff,$ff,$00,$00,$ff
  2218.   compare = $b8,$00,$00,$50,$b8,$00,$00,$50,$b8,$00,$00,$50
  2219.   flags   = perm
  2220.   argument
  2221.     rbyte = 1
  2222.     type  = word
  2223.   endargument
  2224.   argument
  2225.     rbyte = 5
  2226.     type  = word
  2227.   endargument
  2228.   argument
  2229.     rbyte = 9
  2230.     type  = word
  2231.   endargument
  2232. endmacro
  2233. ;
  2234. macroname = _PushWrd   ; push two words in a row.
  2235.   size    = 4
  2236.   mask    = $ff,$00,$00,$ff,$ff,$00,$00,$ff
  2237.   compare = $b8,$00,$00,$50,$b8,$00,$00,$50
  2238.   flags   = perm
  2239.   argument
  2240.     rbyte = 1
  2241.     type  = word
  2242.   endargument
  2243.   argument
  2244.     rbyte = 5
  2245.     type  = word
  2246.   endargument
  2247. endmacro
  2248. ;
  2249. macroname = _PushWrd   ; push 1 word.
  2250.   size    = 2
  2251.   mask    = $ff,$00,$00,$ff
  2252.   compare = $b8,$00,$00,$50
  2253.   argument
  2254.     rbyte = 1
  2255.     type  = word
  2256.   endargument
  2257. endmacro
  2258. ;
  2259. ;   Push a zero word.
  2260. ;
  2261. macroname = _PushZero
  2262.   size    = 3
  2263.   nomask
  2264.   compare = $31,$c0,$50
  2265. endmacro
  2266. ;
  2267. macroname = _PushByte   ; push two bytes in a row.
  2268.   size    = 4
  2269.   mask    = $ff,$00,$ff,$ff,$00,$ff
  2270.   compare = $b0,$00,$50,$b0,$00,$50
  2271.   argument
  2272.     rbyte = 1
  2273.     type  = byte
  2274.   endargument
  2275.   argument
  2276.     rbyte = 4
  2277.     type  = byte
  2278.   endargument
  2279. endmacro
  2280. ;
  2281. macroname = _PushByte   ; push 1 byte.
  2282.   size    = 2
  2283.   mask    = $ff,$00,$ff
  2284.   compare = $b0,$00,$50
  2285.   argument
  2286.     rbyte = 1
  2287.     type  = byte
  2288.   endargument
  2289. endmacro
  2290. ;
  2291. macroname = _PushByte   ; push 1 byte variable.
  2292.   size    = 4
  2293.   mask    = $ff,$00,$00,$ff,$ff,$ff
  2294.   compare = $a0,$00,$00,$30,$e4,$50
  2295.   argument
  2296.     rbyte = 1
  2297.     type  = address
  2298.     segment = ds
  2299.   endargument
  2300. endmacro
  2301. ;
  2302. ;   Macros to test registers and jump on zero or non-zero.
  2303. ;
  2304. macroname = JALZ
  2305.   size    = 3
  2306.   nomask
  2307.   compare = $08,$c0,$74
  2308.   comment = jump if AL = 0 to ARG1
  2309.   argument
  2310.     rbyte = 3
  2311.     type  =nearaddress
  2312.   endargument
  2313. endmacro
  2314. ;
  2315. macroname = JALNZ
  2316.   size    = 3
  2317.   nomask
  2318.   compare = $08,$c0,$75
  2319.   comment = jump if AL <> 0 to ARG1
  2320.   argument
  2321.     rbyte = 3
  2322.     type  =nearaddress
  2323.   endargument
  2324. endmacro
  2325. ;
  2326. macroname = JAXZ
  2327.   size    = 3
  2328.   nomask
  2329.   compare = $09,$c0,$74
  2330.   comment = jump if AX = 0 to ARG1
  2331.   argument
  2332.     rbyte = 3
  2333.     type  =nearaddress
  2334.   endargument
  2335. endmacro
  2336. ;
  2337. macroname = JAXNZ
  2338.   size    = 3
  2339.   nomask
  2340.   compare = $09,$c0,$75
  2341.   comment = jump if AX <> 0 to ARG1
  2342.   argument
  2343.     rbyte = 3
  2344.     type  =nearaddress
  2345.   endargument
  2346. endmacro
  2347. ;
  2348. ;   Macro to convert a byte variable into an integer.
  2349. ;
  2350. macroname = CvrtB2I
  2351.   size    = 3
  2352.   mask    = $ff,$00,$00,$ff,$ff
  2353.   compare = $a0,$00,$00,$30,$e4
  2354.   comment = convert byte var to int (AX)
  2355.   argument
  2356.     rbyte = 1
  2357.     type  = address
  2358.     segment = ds
  2359.   endargument
  2360. endmacro
  2361. ;
  2362. ;   Macros to support subscript computations.
  2363. ;
  2364. macroname = GetSub
  2365.   size    = 5
  2366.   mask    = $ff,$00,$00,$ff,$ff,$ff,$ff
  2367.   compare = $ba,$00,$00,$f7,$e2,$8b,$f8
  2368.   flags   = perm
  2369.   comment = DI = AX * rec_size
  2370.   argument
  2371.     rbyte = 1
  2372.     type  = word
  2373.   endargument
  2374. endmacro
  2375. ;
  2376. ;   Macro to test a byte variable to see if it equals a specific value.
  2377. ;
  2378. macroname = TEST_BVAR
  2379.   size    = 2
  2380.   mask    = $ff,$00,$00,$ff
  2381.   compare = $a0,$00,$00,$3c
  2382.   comment = does byte var at ARG1 = ARG2?
  2383.   argument
  2384.     rbyte = 1
  2385.     type  = address
  2386.     segment = ds
  2387.   endargument
  2388.   argument
  2389.     rbyte = 4
  2390.     type  = character
  2391.   endargument
  2392. endmacro
  2393. ;
  2394. ;   Macro to jump if a byte variable in AL does not equals a value (used in
  2395. ;   CASE statements).
  2396. ;
  2397. macroname = JAL_NEQ
  2398.   size    = 2
  2399.   mask    = $ff,$00,$ff
  2400.   compare = $3c,$00,$75
  2401.   comment = if byte var <> ARG1 goto ARG2
  2402.   argument
  2403.     rbyte = 1
  2404.     type  = character
  2405.   endargument
  2406.   argument
  2407.     rbyte = 3
  2408.     type  = nearaddress
  2409.   endargument
  2410. endmacro
  2411. ;
  2412. ;   Same as above for equals.
  2413. ;
  2414. macroname = JAL_EQ
  2415.   size    = 2
  2416.   mask    = $ff,$00,$ff
  2417.   compare = $3c,$00,$74
  2418.   comment = if AL = ARG1 goto ARG2
  2419.   argument
  2420.     rbyte = 1
  2421.     type  = character
  2422.   endargument
  2423.   argument
  2424.     rbyte = 3
  2425.     type  = nearaddress
  2426.   endargument
  2427. endmacro
  2428. ;
  2429. ;   Macro to test an integer variable to see if it equals a specific value.
  2430. ;
  2431. macroname = TEST_INT
  2432.   size    = 2
  2433.   mask    = $ff,$00,$00,$ff
  2434.   compare = $a1,$00,$00,$3d
  2435.   comment = does int var at ARG1 = ARG2?
  2436.   argument
  2437.     rbyte = 1
  2438.     type  = address
  2439.     segment = ds
  2440.   endargument
  2441.   argument
  2442.     rbyte = 4
  2443.     type  = word
  2444.   endargument
  2445. endmacro
  2446. ;
  2447. ;   Macro to jump if an int in AX does not equals a value (used in CASE
  2448. ;   statements).
  2449. ;
  2450. macroname = JAX_NEQ
  2451.   size    = 2
  2452.   mask    = $ff,$00,$00,$ff
  2453.   compare = $3c,$00,$00,$75
  2454.   comment = if AX <> ARG1 goto ARG2
  2455.   argument
  2456.     rbyte = 1
  2457.     type  = word
  2458.   endargument
  2459.   argument
  2460.     rbyte = 4
  2461.     type  = nearaddress
  2462.   endargument
  2463. endmacro
  2464. ;
  2465. ;   Same as above for equals.
  2466. ;
  2467. macroname = JAX_EQ
  2468.   size    = 2
  2469.   mask    = $ff,$00,$00,$ff
  2470.   compare = $3c,$00,$00,$74
  2471.   comment = if AX = ARG1 goto ARG2
  2472.   argument
  2473.     rbyte = 1
  2474.     type  = word
  2475.   endargument
  2476.   argument
  2477.     rbyte = 4
  2478.     type  = nearaddress
  2479.   endargument
  2480. endmacro
  2481. ;
  2482. ;   End of macro library.
  2483.