home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / JSAGE / ZSUS / PROGPACK / V42-DOCS.LBR / VLIB42.DZC / VLIB42.DOC
Text File  |  1990-06-08  |  69KB  |  1,345 lines

  1. .hm1
  2. .fm1
  3. .sr0
  4. .he                                  ZCPR3: THE LIBRARIES 4.2 -- VLIB
  5. .fo                                                            Page #
  6. .pn 135
  7.  
  8.              III«  VLIB -- Video Terminal Interface
  9.  
  10.      Introductioε « « « « « « « « « « « « « « « « « « « « « « 136
  11.           Usinτ VLI┬  « « « « « « « « « « « « « « « « « « « « 136
  12.           Termina∞ Ca≡abilities (TCAP⌐ ExtendeΣ Definitioε  « 137
  13.      Basiπ VLI┬ Routine≤  « « « « « « « « « « « « « « « « « « 143
  14.           Screeε, Curso≥, anΣ Miscellaneou≤ Routine≤  « « « « 143
  15.                CLS¼ CLREOS¼ EREOL¼ AT¼ GOTOXY¼ DELLIN¼
  16.                INSLIN¼ ISCUR¼ VVERS
  17.           Initializatioε  . « « « « « « « « « « « « « « « « « 146
  18.                VIDINIT¼ Z3VINIT¼ VIDPT╥ (global)
  19.           Prin⌠ Routine≤  « « « « « « « « « « « « « « « « « « 146
  20.                GXYMSG¼ VPRINT¼ VPSTR
  21.           Standou⌠ Modσ « « « « « « « « « « « « « « « « « « « 147
  22.                STNDOUT¼ STNDEND
  23.           Terφinal Ini⌠ializatioε anΣ De-Initializatioε « « « 148
  24.                TINIT¼ DINIT
  25.      Graphic≤ . « « « « « « « « « « « « « « « « « « « « « « « 149
  26.           Ini⌠ializatioε  « « « « « « « « « « « « « « « « « « 149
  27.                GZ3INIT¼ GRXON¼ GRXOFF
  28.           Blocδ Graphic≤  « « « « « « « « « « « « « « « « « « 150
  29.                DRFULL¼ DRHASH
  30.           Corne≥s anΣ Intersection≤ « « « « « « « « « « « « « 150
  31.                ULEFT¼ URIGHT¼ LLEFT¼ LRIGHT¼ LTISEC¼
  32.                RTISEC¼ UISEC¼ LISEC¼ ISEC
  33.           Horizonta∞ anΣ Vertica∞ Bar≤  « « « « « « « « « « « 151
  34.                DRHBAR¼ DRHORZ¼ ERAHORZ¼ GHBAR¼ ERAHBAR,
  35.                DRVBAR¼ DRVERT¼ ERAVERT¼ GVBAR¼ ERAVBAR
  36.           Bo° Dra≈ing Routine≤  « « « « « « « « « « « « « « « 155
  37.                DRFBOX¼ DRBOX¼ ERABOX¼ GFBOX¼ GBOX¼
  38.                GERBOX¼ CHKBOX
  39.           Pull-Dowε Menu≤ « « « « « « « « « « « « « « « « « « 156
  40.                SETPDM¼ CLRPDM¼ SELPDM¼ MCLS¼ PDMINI¼
  41.                ISPDM¼ SPDMCHR
  42.           Readinτ thσ Termina∞ Screeε « « « « « « « « « « « « 159
  43.                GETCUR¼ GETLIN
  44. .paè
  45.                 VLIB -- Video Terminal Interface
  46.  
  47.  
  48. INTRODUCTION:é  VLI┬ i≤ ß librar∙ oµ routine≤ originall∙ ádesigneΣ ì
  49. b∙ RicharΣ Conε t∩ suppor⌠ ZCPR3«  Man∙ change≤ havσ beeε áincorì
  50. porateΣ áiε áthi≤ version¼ includinτ optimizeΣ codσ fo≥ áthσ áZ8░ ì
  51. processo≥ family¼ conversioε t∩ ß tablσ-driveε modσ fo≥ increaseΣ ì
  52. speed¼ áanΣ thσ additioε oµ severa∞ ne≈ routine≤ compa⌠iblσ áwitΦ ì
  53. somσ áoµ thσ GRWLI┬ anΣ GRXLI┬ routine≤ whicΦ werσ áneve≥ áwidel∙ ì
  54. adopted.
  55.  
  56. Program≤ áusinτ ároutine≤ froφ thi≤ librar∙ arσ ablσ át∩ áenhancσ ì
  57. vide∩ ádisplay≤ witΦ direc⌠ curso≥ addressing¼ vide∩ áattributes¼ ì
  58. anΣ ne≈ mode≤ oµ operatioε sucΦ a≤ pul∞-dowε menu≤ iε ß áportablσ ì
  59. manne≥ amonτ othe≥ ┌-System≤ withou⌠ rσ-installation.
  60.  
  61. Portabilit∙ ái≤ achieveΣ b∙ accessinτ termina∞ description≤ áconì
  62. taineΣ iε thσ ZCPR│ TCAP¼ o≥ compatiblσ record«  Iε mos⌠ systems¼ ì
  63. thσ áTCA╨ i≤ storeΣ iε thσ seconΣ halµ oµ thσ áZCPR│ áEnvironmen⌠ ì
  64. Descriptor.
  65.  
  66. USIN╟ áVLIB:é á Wheε writinτ program≤ t∩ usσ áVLIB¼ áfollo≈ áthesσ ì
  67. steps:
  68.      Z3EAD╥    EQ╒       109H
  69.                L─        HL,(Z3EADR⌐    ╗ ge⌠ Environmen⌠ address
  70.                CAL╠      Z3VINI╘        ╗ initializσ ENVPT╥ anΣ VIDPTR
  71.                CAL╠      GZ3INI╘        ╗ iµ yo⌡ wou∞Σ usσ graphics
  72.                CAL╠      TINI╘          ╗ initializσ thσ terminal
  73.                ...«                     ╗ you≥ program
  74.                CAL╠      DINI╘          ╗ dσ-initializσ thσ terminal
  75.                ...«                     ╗ housekeeping
  76.                RE╘                      ╗ quit
  77.  
  78.      1.Initializσ ápointer≤ áanΣ routines« á Thσ átw∩ ápointer≤ ì
  79. áááááneedeΣ are:
  80.         - ENVPTR is the ZCPR3 Environment Descriptor address.
  81.         - VIDPTR sets the Z3TCAP entry address.
  82.         - Iµ áusinτ graphic≤ o≥ pul∞-dowε menus¼ initializσ átha⌠ ì
  83. áááááááááásybsysteφ áa≤ áwell«  Thi≤ routinσ return≤ áflag≤ átha⌠ ì
  84. áááááááááátel∞ wha⌠ ne≈ capabilitie≤ exist.
  85.  
  86.      2.Cal∞ átermina∞ initializatioε routine¼ TINIT« á Iµ áyou≥ ì
  87. ááááátermina∞ áuse≤ DI═ o≥ reduceΣ-intensit∙ insteaΣ áoµ áreversσ ì
  88. ááááávideo¼ áTINI╘ áshoulΣ se⌠ thσ defaul⌠ t∩ thσ ádiφ áleve∞ áa≤ ì
  89. ááááádefault¼ anΣ usσ norma∞ intensit∙ fo≥ STNDOUT¼ witΦ áSTNDEN─ ì
  90. áááááreturninτ t∩ Dim.
  91.  
  92.      3.Call VLIB routines within the program as desired.
  93.  
  94.      4.Cal∞ termina∞ dσ-initializatioε routine¼ DINIT«  Iµ you≥ ì
  95. ááááátermina∞ use≤ DI═ o≥ reduceΣ-intensit∙ attibute≤ insteaΣ áoµ ì
  96. áááááreversσ o≥ intensifieΣ vide∩ fo≥ Highlighting¼ DINI╘ áshoulΣ ì
  97. ááááárestorσ thσ termina∞ t∩ norma∞ intensit∙ a⌠ exit.
  98. èTERMINA╠ CAPABILITIE╙ (TCAP⌐ EXTENDE─ DEFINITIONô (a≤ oµ áFebruar∙ ì
  99. 3¼ á1990):é  Thσ ZCPR│ TCA╨ i≤ ß 12╕-bytσ areß positioneΣ áimmσdiì
  100. atel∙ áafte≥ thσ Environmen⌠ Descriptor«  Thσ áconfiguratioε áha≤ ì
  101. beeε changeΣ froφ thσ origina∞ description≤ containeΣ iε áRicharΣ ì
  102. Conn'≤ book¼ ZCPR3║ Thσ Manual«  Thσ layou⌠ herσ i≤ designeΣ áfo≥ ì
  103. backwarΣ ácompatibilit∙ áwitΦ thσ origina∞ áschemσ áwhilσ áaddinτ ì
  104. extension≤ t∩ accomodatσ rudamentar∙ busines≤ graphic≤ anΣ ápul∞-ì
  105. dowε ámenu≤ describeΣ iε Denni≤ Wright'≤ GRXLI┬ anΣ áportion≤ áoµ ì
  106. GRWLIB«  Offset≤ mentioneΣ iε thi≤ descriptioε arσ froφ thσ ábasσ ì
  107. oµ thσ TCAP.
  108.  
  109.   offset  item           description
  110.      0    Terminal Name
  111.                          1│ characters¼ alphanumeric«  Thσ áfirs⌠ ì
  112. ááááááááááááááááááááááááácharacte≥ mus⌠ no⌠ bσ ß space«  ┴ áleaΣì
  113. áááááááááááááááááááááááááinτ áspacσ mean≤ uninstalleΣ áTCAP« á B∙ ì
  114. áááááááááááááááááááááááááconvention¼ ß termina∞ namσ i≤ uniquσ iε ì
  115. áááááááááááááááááááááááááit≤ firs⌠ eigh⌠ character≤ anΣ thσ ánamσ ì
  116. ááááááááááááááááááááááááái≤ terminateΣ witΦ ß space.
  117.  
  118.     1│    Offse⌠ t∩ GOEL─ entry
  119.  
  120.     1┤    HigΦ Termina∞ Characteristics
  121.                          Bi⌠ ╖ i≤ se⌠ (80h⌐ t∩ indentif∙ extendeΣ ì
  122. áááááááááááááááááááááááááTCAP.
  123.  
  124.     15    Lo≈ Termina∞ Characteristic≤
  125.                          Onσ bytσ indicatinτ termina∞ dσtails:
  126.                          b0 - typσ oµ standou⌠ modσ (░ ╜ dim╗ ▒ ╜ ì
  127. ááááááááááááááááááááááááááááááreverse).
  128.                          b1 - termina∞ ádela∙ a⌠ poweru≡ (░ ╜ án∩ ì
  129. áááááááááááááááááááááááááááááádelay╗ ▒ ╜ 1░ seconds).
  130.                          b2 - screeε wrap≤ oε writσ iε las⌠ áco∞ì
  131. ááááááááááááááááááááááááááááááumε (░ ╜ no╗ ▒ ╜ yes).
  132.                          b3 - screeε áscroll≤ áiµ álas⌠ áro≈ áanΣ ì
  133. áááááááááááááááááááááááááááááácolumε áarσ writteε (░ ╜ yes╗ á▒ á╜ ì
  134. ááááááááááááááááááááááááááááááno).
  135.                          b4 - ANS╔ átermina∞ (░ ╜ no¼ ASCII╗ ▒ á╜ ì
  136. ááááááááááááááááááááááááááááááyes¼ ANSI).
  137.  
  138. Thσ áfollowinτ áfou≥ byte≤ arσ fo≥ ásinglσ-bytσ ácurso≥ ámovemen⌠ ì
  139. code≤ áfroφ áthσ terminal«  Iµ you≥ termina∞ ha≤ án∩ áindependan⌠ ì
  140. curso≥ ámovemen⌠ keys¼ o≥ implement≤ curso≥ movemen⌠ witΦ ámultΘ-ì
  141. bytσ ásequences¼ usσ an∙ convenien⌠ singlσ-ke∙ sequencσ áyo⌡ ádeì
  142. sire« á Thσ familia≥ WordSta≥ "diamondó compriseΣ oµ ^┼ (up)¼ á^╪ ì
  143. (down)¼ ^─ (right⌐ anΣ ^╙ (left⌐ i≤ commonl∙ used.
  144.  
  145.     16    Cursor Up
  146.                          Curso≥ u≡ codσ froφ termina∞ (^E).
  147.  
  148.     17    Cursor Down
  149.                          Curso≥ dowε codσ froφ termina∞ (^X).
  150.  
  151.     18    Cursor Right
  152.                          Curso≥ righ⌠ codσ froφ termina∞ (^D).è
  153.     19    Cursor Left
  154.                          Curso≥ lef⌠ codσ froφ termina∞ (^S).
  155.  
  156. Somσ áterminal≤ neeΣ delay≤ t∩ perforφ certaiε áfunctions« á Thi≤ ì
  157. ma∙ ábσ morσ importan⌠ a≤ interfacσ speed≤ increase«  Delay≤ áarσ ì
  158. iε ámilliseconds«  Consul⌠ you≥ termina∞ manua∞ fo≥ áthσ ácorrec⌠ ì
  159. value≤ t∩ insert.
  160.  
  161.     20    Clear Screen
  162.                          Delay in milliseconds (0 to 255).
  163.  
  164.     21    Move Cursor
  165.                          Delay in milliseconds (0 to 255).
  166.  
  167.     22    Clear to End-of-Line
  168.                          Delay in milliseconds (0 to 255).
  169.  
  170. Beginninτ a⌠ offse⌠ 2│ froφ thσ beginninτ oµ thσ TCAP¼ ß sequencσ ì
  171. oµ áNU╠-terminateΣ string≤ definσ thσ commanΣ string≤ áneedeΣ át∩ ì
  172. makσ thσ termina∞ responΣ a≤ desired«  Iµ particula≥ feature≤ arσ ì
  173. no⌠ áimplementeΣ áo≥ no⌠ needeΣ b∙ you≥ terminal¼ áß ásinglσ áNU╠ ì
  174. (binar∙ 0⌐ disable≤ tha⌠ feature.
  175.  
  176.     23    Clear Screen (CL⌐
  177.                          Clear screen and home cursor.
  178.  
  179.           Cursor Movement (CM)
  180.                          ParseΣ ástrinτ fo≥ ácurso≥ ápositioning«  ì
  181. áááááááááááááááááááááááááSeσ ZCPR3║ Thσ ManualÖ fo≥ details«  "%Nó ì
  182. ááááááááááááááááááááááááástrinτ addeΣ t∩ senΣ binar∙ ░ t∩ átermiì
  183. ááááááááááááááááááááááááánal.
  184.  
  185.           Clear to End-of-Line (CE⌐
  186.                          Clea≥ froφ curso≥ positioε t∩ thσ enΣ oµ ì
  187. áááááááááááááááááááááááááthσ curren⌠ line«  Curso≥ stay≤ iε ácurì
  188. áááááááááááááááááááááááááren⌠ placσ.
  189.  
  190.           Standout Begin (SO)
  191.                          Ente≥ ástandou⌠ mode«  Iµ termina∞ áuse≤ ì
  192. ááááááááááááááááááááááááádiφ o≥ reduceΣ intensity¼ thσ áinitialiì
  193. ááááááááááááááááááááááááázatioε ástrinτ (T╔ below⌐ shoulΣ se⌠ át∩ ì
  194. áááááááááááááááááááááááááreduceΣ áintensity¼ áanΣ áthi≤ áfunctioε ì
  195. áááááááááááááááááááááááááset≤ norma∞ intensity.
  196.  
  197.           Standout End (SE)
  198.                          EnΣ áStandou⌠ mode«  Iµ yo⌡ usσ ádiφ áo≥ ì
  199. áááááááááááááááááááááááááreduceΣ ááintensit∙ áwitΦ áánorma∞ ááfo≥ ì
  200. ááááááááááááááááááááááááá"Standout"¼ thi≤ restore≤ thσ diφ mode.
  201.  
  202.           Initialize Terminal (TI⌐
  203.                          Initializσ thσ terminal«  Seσ note≤ áfo≥ ì
  204. ááááááááááááááááááááááááásuggestion≤ oε diφ anΣ reduceΣ intensit∙ ì
  205. áááááááááááááááááááááááááabove.
  206. è          De-initialize Termina∞ (TE⌐
  207.                          Restorσ átermina∞ t∩ norma∞ ámode« á Seσ ì
  208. áááááááááááááááááááááááááabovσ notes.
  209.  
  210.           Delete Line (LD)
  211.                          Deletσ linσ oε whicΦ thσ curso≥ áreside≤ ì
  212. áááááááááááááááááááááááááanΣ ámovσ áline≤ ábelo≈ i⌠ áu≡ áb∙ áone«  ì
  213. áááááááááááááááááááááááááBottoφ linσ i≤ blank.
  214.  
  215.           Insert Line (LI)
  216.                          Inser⌠ áblanδ álinσ beforσ áthσ áonσ áoε ì
  217. áááááááááááááááááááááááááwhicΦ thσ curso≥ i≤ positioned¼ anΣ movσ ì
  218. áááááááááááááááááááááááááline≤ ábelo≈ dowε one«  Curso≥ move≤ át∩ ì
  219. ááááááááááááááááááááááááábeginninτ oµ thσ ne≈ blanδ line.
  220.  
  221.           Clear to End-of-Screen (CD)
  222.                          Clea≥ áscreeε froφ curren⌠ curso≥ áposiì
  223. ááááááááááááááááááááááááátioε t∩ thσ enΣ-oµ-screen.
  224.  
  225.           Se⌠ Attribute≤ (SA)
  226.                          Se⌠ ácharacte≥ attribute≤ baseΣ áoε áAT¼ ì
  227. ááááááááááááááááááááááááábelow.
  228.  
  229.           Attribute≤ (AT)
  230.                          Attributσ character≤ fo≥ thi≤ áterminal╗ ì
  231. áááááááááááááááááááááááááusuall∙ ánormal¼ áblink¼ áreverse¼ ááanΣ ì
  232. áááááááááááááááááááááááááunderscore.
  233.  
  234.           ReaΣ Curso≥ Positioε (RC)
  235.                          Returε curren⌠ curso≥ position.
  236.  
  237.           ReaΣ Termina∞ Linσ (RL)
  238.                          ReaΣ curren⌠ linσ u≡ t∩ curso≥.
  239.  
  240. Thσ áfollowinτ definition≤ implemen⌠ portion≤ oµ thσ áGRXLI┬ áanΣ ì
  241. GRWLI┬ functionality¼ bu⌠ iε differen⌠ TCA╨ locations.
  242.  
  243.           Graphics Dela∙ (GOELD)
  244.                          Dela∙ fo≥ graphic≤ on/off«  Usσ ágreate≥ ì
  245. áááááááááááááááááááááááááoµ thσ tw∩ dela∙ time≤ iε ámilliseconds«  ì
  246. áááááááááááááááááááááááááValue≤ oµ ░ t∩ 25╡ arσ acceptable.
  247.  
  248.           Graphics Mode On (GO)
  249.                          Set terminal to graphics mode.
  250.  
  251.           End Graphics Mode (GE⌐
  252.                          Restorσ termina∞ t∩ norma∞ áalphanumeriπ ì
  253. ááááááááááááááááááááááááámode.
  254.  
  255.           Curso≥ Ofµ (CDO⌐
  256.                          Disablσ ácurso≥ ádisplay« á NeedeΣ ááfo≥ ì
  257. ááááááááááááááááááááááááápul∞-dowε menus.
  258.  
  259.           Cursor On (CDE⌐
  260.                          Enablσ curso≥ display«  NeedeΣ fo≥ pul∞-ìèááááááááááááááááááááááááádowε menus.
  261.  
  262. Severa∞ ágraphic≤ ástring≤ arσ needeΣ t∩ áimplemen⌠ áthσ ádesireΣ ì
  263. leve∞ oµ functionality«  EacΦ oµ thesσ i≤ needeΣ iε thσ specifieΣ ì
  264. order«  Thσ termina∞ shoulΣ firs⌠ bσ placeΣ iε thσ graphic≤ mode¼ ì
  265. theε áthσ desireΣ strinτ sent«  Iµ string≤ fo≥ al∞ terminal≤ áarσ ì
  266. onl∙ ß singlσ character¼ thi≤ ma∙ bσ reduceΣ t∩ ß characte≥ arra∙ ì
  267. iε thσ future.
  268.  
  269.           Upper-Left Corner (GULC)
  270.           Upper-Right Corner (GURC⌐
  271.           Lower-Left Corner (GLLC⌐
  272.           Lower-Right Corner (GLRC⌐
  273.           Horizontal Line (GHL⌐
  274.           Vertical Line (GVL⌐
  275.           Solid (Full) Block (GFB⌐
  276.           Hashed Block (GHB⌐
  277.           Upper Intersect (GUI⌐
  278.           Lower Intersect (GLI⌐
  279.           Intersection (GIS⌐
  280.           Right Intersect (GRTI⌐
  281.           Left Intersect (GLTI⌐
  282.  
  283. Thσ áremainde≥ oµ thσ TCA╨ shoulΣ bσ filleΣ witΦ binar∙ zero≤ át∩ ì
  284. properl∙ handlσ futurσ additions.
  285.  
  286. Example:
  287. 
  288.      ; Z3TCAP:  NZWYS60.Z80
  289.      ; Author:  Joσ Wright
  290.      ╗ Date║    1▓ Octobe≥ 87
  291.      ╗ Version║ 1.0
  292.  
  293.      ╗ VERSION║ 2.▓   │ Februar∙ 90
  294.      ;
  295.      ╗ MoveΣ thσ C─ (clea≥ t∩ enΣ oµ screen⌐ strinτ bacδ afte≥ LI string.
  296.      ╗ Definσ B1│ a≤ offse⌠ froφ NZTCA╨ t∩ GOELD.
  297.  
  298.      ╗ VERSION║ 2.▒  1╣ Januar∙ 90
  299.  
  300.      ╗ AddeΣ ReaΣ Curso≥ anΣ ReaΣ Linσ functions.
  301.      ╗ Graphic≤ character≤ no≈ iε ß tablσ insteaΣ oµ individua∞ strings.
  302.  
  303.      ╗ VERSION║ 2.░  1▓ Decembe≥ 89
  304.  
  305.      ╗ ModifieΣ fo≥ ne≈ VLIB┤ graphic≤ anΣ fo≥ ne≈ SETAT╘ anΣ SETATR routines.
  306.      ╗ Thσ SA║ macr∩ strinτ i≤ modifieΣ fo≥ thσ routine≤ anΣ ß new string,
  307.      ╗ AT║ i≤ addeΣ t∩ contaiε thσ fou≥ maiε attribute≤ fo≥ thi≤ terminal:
  308.      ╗       Normal¼ Blink¼ Reverse¼ Underscore
  309.  
  310.      ; ExtendeΣ Termcap Datß fo≥ NZ
  311.  
  312.      ╗ Thi≤ i≤ thσ proposeΣ Termca≡ Datß fo≥ thσ Ne≈ Z-System.
  313.      ╗ I⌠ morσ full∙ describe≤ thσ termina∞ anΣ it≤ capabilities.
  314. è     ES├       EQ╒       27                  ; ASCI╔ escape character
  315.  
  316.      ; ╔ havσ adopteΣ thσ conventioε tha⌠ ß termina∞ namσ i≤ terminated
  317.      ╗ witΦ ß spacσ character¼ thereforσ n∩ space≤ withiε thσ name.
  318.      ╗ Als∩ tha⌠ thσ termina∞ namσ i≤ uniquσ iε thσ firs⌠ eigh⌠ characters.
  319.      ;
  320.      NZTCAP:   DB        'WYSE-60D'          ; name of terminal (13 chars)
  321.  
  322.      ;
  323.      ╗ Thσ Graphic≤ sectioε i≤ n∩ longe≥ fixeΣ s∩ wσ mus⌠ provide an
  324.      ╗ offse⌠ t∩ it«  Onσ bytσ i≤ sufficien⌠ fo≥ ß two-recorΣ TCAP.
  325.      ;
  326.      B13║      D┬        GOELD-NZTCA╨        ╗ offse⌠ t∩ GOELD
  327.      ;
  328.      ╗ Bi⌠ ╖ oµ B1┤ indicate≤ thσ ne≈ ExtendeΣ TCAP«  Bit≤ 6-░ arσ undefined.
  329.      ;
  330.      B14║      D┬        10000000┬           ╗ extendeΣ TCAP
  331.      ;
  332.      ╗ I⌠ i≤ ofteε desirablσ t∩ differentiatσ terminal≤ witΦ othe≥ than
  333.      ╗ thei≥ commands«  Fo≥ examplσ TeleVide∩ 95╡ ha≤ thσ samσ command
  334.      ╗ se⌠ a≤ Wysσ 6░ bu⌠ take≤ les≤ timσ t∩ initializσ (reset).
  335.  
  336.      ;
  337.      ╗ 1╢ bit≤ arσ no≈ reserveΣ fo≥ indicatinτ termina∞ characteristics
  338.      ╗ whicΦ canno⌠ bσ knowε froφ thσ strings«  ╔ havσ defineΣ five
  339.      ╗ oµ thesσ bit≤ fo≥ m∙ owε purposes.
  340.      ;
  341.      ╗ B1╡ b░       Standou⌠         ░ ╜ half-intensity¼ ▒ ╜ reversσ video
  342.      ╗ B1╡ b▒       Powe≥ U≡ Dela∙   ░ ╜ none¼ ▒ ╜ 1░ seconΣ delay
  343.      ╗ B1╡ b▓       N∩ Wra≡          ░ ╜ linσ wrap¼ ▒ ╜ n∩ wrap
  344.      ╗ B1╡ b│       N∩ Scrol∞        ░ ╜ scroll¼ ▒ ╜ n∩ scroll
  345.      ╗ B1╡ b┤       ANS╔             ░ ╜ ASCII¼ ▒ ╜ ANSI
  346.      ;
  347.      B15:      DB        00000111B           ; powe≥ u≡ delay
  348.      ;
  349.  
  350.                DB        'K'-'@'             ; cursor up
  351.                DB        'J'-'@'             ; cursor down
  352.                DB        'L'-'@'             ; cursor right
  353.                DB        'H'-'@'             ; cursor left
  354.                DB        00                  ; clea≥ screen (CL⌐ delay
  355.                DB        00                  ; curso≥ position (CM⌐ delay
  356.                DB        00                  ; clea≥ t∩ EO╙ (CE) delay
  357.  
  358.      ; Strings start here.
  359.  
  360.      CL║       DB        ESC,'+',0           ; strinτ t∩ clear, home cursor    0
  361.      CM:       DB        ESC,'=%+ %+ ',0     ; strinτ t∩ position cursor       1
  362.      CE:       DB        ESC,'T',0           ; string t∩ clear to end-of-line  2
  363.      SO:       DB        ESC,')',0           ; string t∩ go to highligh⌠ video 3
  364.      SE:       DB        ESC,'(',0           ; string t∩ return normal video   4
  365.      TI:       DB        0                   ; string t∩ initialize terminal   5
  366.      TE:       DB        ESC,'(',0           ; string t∩ de-initialize terφ    6
  367.  
  368.      ;è     ; Extensions to Standard Z3TCAP
  369.      ;
  370.      LD║       DB        ESC,'M',0           ; strinτ t∩ delete linσ           7
  371.      LI║       DB        ESC,'L',0           ; strinτ t∩ insert linσ           8
  372.      CD║       DB        ESC,'J',0           ; strinτ t∩ clear to EO╙          9
  373.      ;
  374.      ╗ Se⌠ attributσ string≤ fo≥ normal¼ blink¼ reverse¼ underline.
  375.      ;
  376.      SA║       D┬        ESC,'G%+0',░        ╗ se⌠ attribute≤ prefi°          10
  377.      AT║       D┬        '0248',░            ╗ attribute≤                     11
  378.      ╗
  379.      ╗ Thesσ tw∩ allo≈ readinτ thσ terminal'≤ screen.
  380.      ;
  381.      RC║       D┬        ESC,'?',░           ╗ reaΣ curren⌠ curso≥ positioε   12
  382.      RL║       D┬        ESC,'6',░           ╗ reaΣ linσ unti∞ curso≥         13
  383.  
  384.      ;
  385.      ╗ Graphic≤ star⌠ here«  Wyse-6░ goe≤ graphiπ witΦ bi⌠ ╖ set.
  386.      ;
  387.      GOELD║    D┬        ░                   ╗ graphic≤ on/ofµ dela∙           0
  388.      ;
  389.      ╗ Graphic≤ string≤ offse⌠ froφ dela∙ value.
  390.      ;
  391.      GO║       DB        0                   ; strinτ t∩ turε oε graphic≤      1
  392.      GE║       ─B        0                   ; strinτ t∩ turε ofµ graphic≤     2
  393.      CDO:      DB        ESC,'`0',0          ; strinτ t∩ turε ofµ curso≥       3
  394.      CDE:      DB        ESC,'`1',0          ; strinτ t∩ enablσ curso≥         4
  395.  
  396.      GULC║     DB        'Z'+80h             ; upper left corner    [*▌        5
  397.      GURC:     DB        '?'+80h             ; upper right corner   [*▌        6
  398.      GLLC:     DB        '@'+80h             ; lower left corner    [*▌        7
  399.      GLRC:     DB        'Y'+80h             ; lower right corner   [*▌        8
  400.  
  401.      GHL:      DB        'D'+80h             ; horizontal line      [-▌        9
  402.      GVL:      DB        '3'+80h             ; vertical line        [|▌       10
  403.      GFB:      DB        '['+80h             ; full block string    [*▌       11
  404.      GHB:      DB        '2'+80h             ; hashed block string  [#▌       12
  405.      GUI:      DB        'B'+80h             ; upper intersection   [+▌       13
  406.      GLI:      DB        'A'+80h             ; lower intersection   [+▌       14
  407.      GIS:      DB        'E'+80h             ; intersection         [+▌       15
  408.      GRTI:     DB        '4'+80h             ; right intersection   [+▌       16
  409.      GLTI:     DB        'C'+80h             ; left intersection    [+▌       17
  410.      ;
  411.      ; Fill unused space with nulls.
  412.      ;
  413.                  REPT  128-[$-Z3TCAP]
  414.                DB    0
  415.                  ENDM
  416.      ;
  417.                END
  418.  
  419. ;------------- End of Sample N┌ TermCap -------------
  420. 
  421. .paèBASI├ VLI┬ ROUTINES:
  422.  
  423. SCREEN¼ CURSOR¼ AN─ MISCELLANEOU╙ ROUTINES:
  424.  
  425.      Routine║   CLS
  426.      Function║ Clear entire screen and home cursor
  427.      Entry:    None
  428.      Exit:     A <> 0 zero flag reset (NZ) if screen cleared
  429.                A = 0, zero flag set (Z) if function not available
  430.      Affected: AF
  431.      Usage:    Mos⌠ áofteε useΣ t∩ providσ initia∞ áentr∙ ácondiì
  432. ááááááááááááááátions¼ áo≥ át∩ dividσ function≤ oµ ß áprograφ áfo≥ ì
  433. áááááááááááááááergonomiπ reasons.
  434.  
  435.      Routine║   CLREOS
  436.      Function: Clea≥ áfroφ ácurren⌠ curso≥ ápositioε át∩ áenΣ-oµ-ì
  437. áááááááááááááááscreeε leavinτ curso≥ iε presen⌠ position
  438.      Entry:    None
  439.      Exit:     A <> 0 zero flag reset (NZ) if screen cleared
  440.                A = 0, zero set (Z) if function not available
  441.      Affected: AF
  442.      Usage:    Remove≤ transien⌠ informatioε froφ thσ lowe≥ ápar⌠ ì
  443. áááááááááááááááoµ áß áscreeε whilσ retaininτ informatioε áoε áthσ ì
  444. áááááááááááááááuppe≥ part.
  445.  
  446.      Routine║   EREOL
  447.      Function║ Erase line from cursor position to end-of-line
  448.      Entry:    None
  449.      Exit:     A <> 0 zero flag reset (NZ) if line erased
  450.                A = 0, zero flag set (Z) if function not available
  451.      Affected: AF
  452.      Usage:    Insure≤ átha⌠ remaininτ informatioε oε ß álinσ ái≤ ì
  453. ááááááááááááááácleared
  454.  
  455.      Routine║   AT
  456.      Function: Positioε curso≥ froφ iε-linσ codσ coordinatσ posiì
  457. ááááááááááááááátions
  458.      Entry:    None; address of XY coordinates are on stack top
  459.      Exit:     None╗ áexecutioε resume≤ a⌠ instructioε áafte≥ áX┘ ì
  460. ááááááááááááááácoordinates
  461.      Affected: None
  462.      Usage:    Position≤ áthσ ácurso≥ a⌠ ro≈ anΣ ácolumε áaddres≤ ì
  463. ááááááááááááááápointeΣ t∩ b∙ thσ returε address«  UseΣ wherσ áthσ ì
  464. ááááááááááááááádesireΣ áro≈ anΣ columε positioε i≤ knowε áb∙ áthσ ì
  465. áááááááááááááááprogram¼ áanΣ doe≤ no⌠ changσ witΦ áprograφ áflow«  ì
  466. áááááááááááááááSeσ áGOTOX┘ áfo≥ positioninτ routinσ tha⌠ áma∙ ábσ ì
  467. ááááááááááááááávarieΣ withiε ß program«  Therσ i≤ n∩ checkinτ áoµ ì
  468. ááááááááááááááátermina∞ limit≤ iε thσ environment.
  469.      Example:
  470.                          EX╘       AT             ; declare the routine
  471.                          ...                      ; ..other parts of program
  472.                          CALL      AT             ; call the positioning routine
  473.                          DEFB      ROW,COL        ; ..row and column (1,1 is home)
  474.                          ...                      ; program flow resumes here
  475. è     Routine║   GOTOXY
  476.      Function: Positioε curso≥ froφ ro≈ anΣ columε datß iε regisì
  477. áááááááááááááááters
  478.      Entry:    HL = desired cursor position (H=row, L=column)
  479.      Exit:     A <> 0 zero flag reset (NZ) if cursor positioned
  480.                A = 0, zero set (Z) if function not available
  481.      Affected: AF
  482.      Usage:    Positioε áthσ ácurso≥ a⌠ ro≈ (iε registe≥ áH⌐ áanΣ ì
  483. ááááááááááááááácolumε á(iε L)«  Thσ homσ positioε (to≡ lef⌠ ácorì
  484. áááááááááááááááner⌐ ái≤ áH=▒ anΣ L=1«  Wheε áthσ ádesireΣ ácurso≥ ì
  485. ááááááááááááááápositioε i≤ fixed¼ yo⌡ ma∙ wan⌠ t∩ usσ A╘ (above)«  ì
  486. áááááááááááááááBit≤ á▒ áanΣ ▓ oµ thσ ne≈ modσ bytσ áiε áthσ áTCA╨ ì
  487. áááááááááááááááshoulΣ bσ senseΣ beforσ positioninτ t∩ las⌠ Columε ì
  488. áááááááááááááááiε ß ro≈ t∩ avoiΣ screeε wrap/scrol∞ problems.
  489.      Example:
  490.                          EXT       GOTOXY         ; declare the routine
  491.                          ...                      ; ..intervening code
  492.                          L─        HL,10*256+│    ╗ loaΣ coord≤ (row 10, col 3)
  493.                          CALL      GOTOXY         ; try to position the cursor
  494.                          JR        NZ,MOVOK       ; ..jump if successful
  495.                          ...                      ; else try something else
  496.  
  497.      Routine║   SETATR
  498.      Function║ Se⌠ codeΣ attributes
  499.      Entry║    ┴ ╜ attributσ codσ (0..7)
  500.      Exit║     ┴ ╜ 0FFh¼ zer∩ flaτ clea≥ (NZ⌐ iµ attributσ i≤ available
  501.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ attributσ i≤ no⌠ available
  502.      Affected║ AF
  503.      Usage║    Attributσ code≤ are:
  504.                     ░ ╜ norma∞ (al∞ attribute≤ off)
  505.                     ▒ ╜ blink
  506.                     ▓ ╜ reversσ video
  507.                     │ ╜ blinδ anΣ reversσ video
  508.                     ┤ ╜ underscore
  509.                     ╡ ╜ blinδ anΣ underscore
  510.                     ╢ ╜ underscorσ anΣ reversσ video
  511.                     ╖ ╜ blink¼ underscore¼ anΣ reversσ video
  512.  
  513.      Routine║   SETATT
  514.      Function║ Se⌠ attributes
  515.      Entry║    ╚ ╜ firs⌠ value
  516.                ╠ ╜ seconΣ value
  517.      Exit║     ┴ <╛ 0¼ zer∩ flaτ clea≥ (NZ⌐ iµ functioε i≤ available
  518.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ functioε i≤ no⌠ available
  519.      Affected║ AF
  520.      Usage:    Use≤ áthσ samσ parse≥ a≤ GOTOXY¼ s∩ value≤ ma∙ ábσ ì
  521. ááááááááááááááápasseΣ át∩ i⌠ a≤ the∙ arσ t∩ thσ ácurso≥ ámovemen⌠ ì
  522. ááááááááááááááástring«  Refe≥ t∩ ZCPR3║ Thσ Manua∞ fo≥ C═ ástrinτ ì
  523. áááááááááááááááprogramminτ anΣ t∩ you≥ particula≥ termina∞ manua∞ ì
  524. áááááááááááááááfo≥ áattributσ values«  Also¼ seσ SETAT╥ ádescripì
  525. ááááááááááááááátioε above«  Yo⌡ ma∙ no⌠ neeΣ SETAT╘ a⌠ all.
  526. .paè     Routine║   DELLIN
  527.      Function║ Delete the currently addressed line
  528.      Entry:    None
  529.      Exit:     A <> 0, zero flag clear (NZ) if action completed
  530.                A = 0, zero set (Z) if function not defined
  531.      Affected: AF
  532.      Usage:    Enhance≤ screeε edito≥ function≤ unde≥ ZCPR│ áwitΦ ì
  533. áááááááááááááááappropriatσ TERMCA╨ definitions.
  534.      Example║  Seσ INSLI╬ below.
  535.  
  536.      Routine║   INSLIN
  537.      Function║ Insert a new line at the current cursor position
  538.      Entry:    None
  539.      Exit:     A <> 0, zero flag clear (NZ) if action completed
  540.                A = 0, zero set (Z) if function not defined
  541.      Affected: AF
  542.      Usage:    Enhance≤ screeε edito≥ function≤ unde≥ ZCPR│ áwitΦ ì
  543. áááááááááááááááappropriatσ TERMCA╨ definitions.
  544.      Example:
  545.                          EXT       DELLIN,INSLI╬  ; declare the routines
  546.                          ...                      ; ..pos'n cursor to 
  547.                          ..«                      ╗ ..desired line
  548.                          CALL      DELLIN         ; kill it!
  549.                          JR        Z,NOTDONE      ; ..jump if not defined
  550.                          ...                      ; ..position to new line pos'n
  551.                          CALL      INSLIN         ; new line here,
  552.                                                   ╗ ..push others down
  553.                          JR        Z,NOINSL       ; ..jump if not defined
  554.                          ...                      ; else continue on
  555.  
  556.      Routine║   ISCUR
  557.      Function║ Test character for cursor movement key
  558.      Entry:    A = character to test
  559.      Exit:     ┴ á╜ á1..┤ (1=up¼ 2=down¼ 3=right¼ á4=left)¼ ázer∩ ì
  560. áááááááááááááááclea≥ (NZ⌐ iµ characte≥ i≤ curso≥ ke∙ froφ TCA╨ o≥ ì
  561. áááááááááááááááWordSta≥ curso≥ key
  562.                A = character, zero set (Z) if not cursor key
  563.      Affected: AF
  564.      Usage:    Determine≤ iµ ß characte≥ i≤ ß commanΣ t∩ movσ thσ ì
  565. ááááááááááááááácurso≥ áup¼ ádown¼ right¼ o≥ áleft« á BotΦ ásinglσ ì
  566. ááááááááááááááácharacte≥ command≤ froφ thσ extendeΣ TCAP¼ a≤ wel∞ ì
  567. áááááááááááááááa≤ WordSta≥ ^E¼ ^X¼ ^D¼ anΣ ^╙ arσ checked.
  568.      Example:
  569.                          EXT       ISCUR,CIN      ; declare some routines
  570.                          ...                      ; ..preceding code
  571.                          CALL      CIN            ; get char from keyboard
  572.                          CALL      ISCUR          ; is it a cursor key?
  573.                          JR        Z,NOCUR        ; ..jump if not a cursor key
  574.  
  575.      Routine║   VVERS
  576.      Function║ Return the VLIB version number
  577.      Entry:    None
  578.      Exit:     HL = VLIB version number (H=major, L=minor)
  579.      Affected: HL
  580.      Usage:    Mos⌠ áofteε calleΣ fo≥ debugginτ o≥ ádocumentatioε ìèááááááááááááááápurpose≤ t∩ includσ thσ VLI┬ librar∙ versioε ánumì
  581. ááááááááááááááábe≥ linkeΣ iε programs.
  582.  
  583. INITIALIZATION:
  584.  
  585.      Routine║   VIDINIT
  586.      Function║ Initialize the VLIB routines to a specified TCAP
  587.      Entry:    HL = address of a Z3 formatted TCAP
  588. .ix VIDPTR (g)
  589.      Exit:     None╗ ábu⌠ VIDPT╥ globa∞ initializeΣ t∩ áTCA╨ áanΣ ì
  590. áááááááááááááááVLI┬ set
  591.      Affected: None
  592.      Usage:    Provide≤ thσ abilit∙ t∩ usσ ß TCA╨ othe≥ thaε tha⌠ ì
  593. áááááááááááááááprovideΣ áiε áthσ ZCPR│ áenvironment« á Fo≥ áaddeΣ ì
  594. ááááááááááááááásafet∙ áiε áprogramming¼ yo⌡ shoulΣ als∩ áse⌠ áthσ ì
  595. áááááááááááááááZ3LI┬ variablσ ENVPT╥ t∩ aε addres≤ poin⌠inτ t∩ aε ì
  596. áááááááááááááááEN╓ áconstruc⌠ whicΦ provide≤ termina∞ áparameter≤ ì
  597. ááááááááááááááát∩ somσ routines.
  598.      Example:
  599.                          EXT       VIDINIT        ; declare the routine
  600.                          ...                      ; ..program initialization
  601.                          LD        HL,(Z3EADR⌐    ; load ENV address
  602.                          LD        DE,80H         ; offset to TCAP portion
  603.                          ADD       HL,DE
  604.                          CALL      VIDINIT        ; ..and initialize VLIB
  605.                          ...                      ; carry on with program
  606.  
  607.      Routine║   Z3VINIT
  608.      Function║ Initialize Z3LIB and VLIB routines for use
  609.      Entry:    HL = address of a ZCPR3 environment descriptor
  610.      Exit:     None
  611.      Affected: None
  612.      Usage:    Combine≤ thσ function≤ oµ thσ Z3LI┬ routinσ Z3INI╘ ì
  613. áááááááááááááááanΣ áVIDINI╘ covereΣ above«  I⌠ assume≤ átha⌠ áthσ ì
  614. áááááááááááááááTCA╨ ábegin≤ 80Φ (128⌐ byte≤ afte≥ áthσ áspecifieΣ ì
  615. áááááááááááááááenvironmen⌠ pointe≥ passeΣ iε HL.
  616.      Example:
  617.                          EXT       Z3VINIT        ; declare the routine
  618.                          ...                      ; ..initial program code
  619.                          LD        HL,(Z3EADR)    ; get the environment address
  620.                          CALL      Z3VINIT        ; ..set ENVPTR and init VLIB
  621.                          ...                      ; carry on!
  622.  
  623. PRINT ROUTINES:
  624.  
  625.      Routine║   GXYMSG
  626.      Function║ Position cursor and print text with highlighting
  627.      Entry:    None╗ áaddres≤ oµ X┘ coordinate≤ followeΣ b∙ átex⌠ ì
  628. áááááááááááááááoε stacδ top
  629.      Exit:     None; execution resumes after text terminating NUL
  630.      Affected: None
  631.      Usage:    Print≤ ß tex⌠ messagσ a⌠ ß prσ-defineΣ locatioε oε ì
  632. áááááááááááááááthσ termina∞ screen«  I⌠ i≤ analagou≤ t∩ positionì
  633. áááááááááááááááinτ thσ curso≥ witΦ A╘ followeΣ b∙ ß strinτ áprin⌠ ì
  634. áááááááááááááááwitΦ VPRINT«  Standou⌠ anΣ standenΣ attribute≤ arσ ì
  635. ááááááááááááááárecognizeΣ áwitΦ ábinar∙ á▒ áanΣ á▓ árespectively«  ìèáááááááááááááááTherσ ái≤ án∩ checkinτ oµ termina∞ limit≤ áiε áthσ ì
  636. áááááááááááááááenvironment.
  637.      Example:
  638.                          EX╘       GXYMSG         ; declare the routine
  639.                          ...                      ; ..intervening code
  640.                          CALL      GXYMSG         ; print as...
  641.                          DEF┬      2,1╡           ╗ positioε t∩ ro≈ 2¼ column 15
  642.                          DEFB      1,'Hi',2       ; ..and print this message
  643.                          DEFB      ' There!',0    ; ...highlighting "Hi"
  644.                          ...                      ; execution resumes here
  645.  
  646.      Routine║   VPRINT
  647.      Function║ Print NUL-terminated inline text with highlighting
  648.      Entry:    None; the string starting address in on stack top
  649.      Exit:     None╗ execution resumes after string terminator
  650.      Affected: None
  651.      Usage:    Print≤ áß tex⌠ strinτ froφ inlinσ codσ witΦ áhighì
  652. ááááááááááááááálightinτ áabilit∙ b∙ enablinτ STNDOU╘ modσ witΦ áß ì
  653. ááááááááááááááábinar∙ á1¼ anΣ resuminτ norma∞ prin⌠ áviß áSTNDEN─ ì
  654. áááááááááááááááwitΦ áß binar∙ 2«  Thi≤ i≤ VLIB'≤ versioε áoµ áthσ ì
  655. áááááááááááááááSYSLI┬ routinσ PRINT.
  656.      Example:
  657.                          EXT       VPRINT         ; declare the routine
  658.                          ...                      ; ..intervening code
  659.                          CALL      VPRINT         ; print the following line
  660.                          DEFB      2,'Hi',1       ; ..hilighting "Hi" and
  661.                          DEFB      ' There',0     ; ...the remainder in normal
  662.                          ...                      ; execution resumes here
  663.  
  664.      Routine║   VPSTR
  665.      Function║ Print a NUL-terminated message with highlighting
  666.      Entry:    HL = address of NUL-terminated string to print
  667.      Exit:     HL = points to byte after terminating NUL
  668.                A = 0, zero flag set (Z)
  669.      Affected: AF¼ HL
  670.      Usage:    Print≤ átex⌠ message≤ witΦ highlightinτ ácapabiliì
  671. ááááááááááááááátie≤ áprovideΣ b∙ STNDOUT/STNDEN─ áfroφ álocation≤ ì
  672. áááááááááááááááothe≥ áthaε áthσ executinτ code«  I⌠ i≤ áthσ áVLI┬ ì
  673. ááááááááááááááácorollar∙ oµ PST╥ iε SYSLIB.
  674.  
  675. STANDOUT MODE:
  676.  
  677.      Routine║   STNDOUT
  678.      Function║ Begin standout mode.
  679.      Entry:    None
  680.      Exit:     A <> 0 zero flag reset (NZ) if standout mode entered
  681.                A = 0, zero flag set (Z) if not available
  682.      Affected: AF
  683.      Usage:    Fo≥ áterminal≤ áwitΦ reversσ video¼ áthi≤ ároutinσ ì
  684. áááááááááááááááwil∞ ástar⌠ tha⌠ mode«  Fo≥ thosσ witΦ diφ o≥ áreì
  685. áááááááááááááááduceΣ video¼ usσ TINI╘ t∩ se⌠ thσ termina∞ t∩ tha⌠ ì
  686. ááááááááááááááámodσ áfo≥ ánorma∞ print¼ anΣ STNDOU╘ t∩ áplacσ áiε ì
  687. ááááááááááááááánorma∞ ámode«  DINI╘ shoulΣ theε reversσ oε áexit«  ì
  688. áááááááááááááááThi≤ modσ i≤ useΣ t∩ providσ visua∞ attribute≤ fo≥ ì
  689. ááááááááááááááábette≥ ámaε-machinσ áinterface«  Caution║ áD∩ áno⌠ ìèááááááááááááááárepositioε thσ curso≥ o≥ issuσ carriagσ return≤ o≥ ì
  690. ááááááááááááááálinσ áfeed≤ whilσ thσ standou⌠ modσ i≤ áiε áeffec⌠ ì
  691. ááááááááááááááásincσ áunknowε effect≤ caε occu≥ oε somσ type≤ áoµ ì
  692. áááááááááááááááterminals«  Usσ STNDEN─ t∩ disablσ thi≤ mode.
  693.  
  694.      Routine║   STNDEND
  695.      Function║ End standout mode, return to normal screen display
  696.      Entry:    None
  697.      Exit:     A <> 0 zero flag reset (NZ) if standout mode ended
  698.                A = 0, zero set (Z) if function not available
  699.      Affected: AF
  700.      Usage:    Reverse≤ thσ modσ se⌠ b∙ STNDOU╘ above«  Seσ note≤ ì
  701. áááááááááááááááfo≥ STNDOUT.
  702.  
  703. TERMINAL INITIALIZATION AND DE-INITIALIZATION:
  704.  
  705.      Routine║   TINIT
  706.      Function║ Initialize terminal for use with VLIB routines
  707.      Entry:    None
  708.      Exit:     None
  709.      Affected: None
  710.      Usage:    Wheε áwritinτ áprogram≤ baseΣ áoε áVLI┬ ároutines¼ ì
  711. áááááááááááááááTINI╘ shoulΣ bσ calleΣ earl∙ iε thσ prograφ áflow«  ì
  712. áááááááááááááááIµ yo⌡ arσ usinτ vide∩ attribute≤ t∩ providσ highì
  713. ááááááááááááááálightinτ áwitΦ STNDOUT/STNDEN─ anΣ áyou≥ átermina∞ ì
  714. áááááááááááááááonl∙ áprovide≤ ß diφ o≥ áreduceΣ-intensit∙ áattriì
  715. ááááááááááááááábute¼ TINI╘ shoulΣ se⌠ thσ norma∞ modσ t∩ thσ ádiφ ì
  716. áááááááááááááááo≥ áreduceΣ mode¼ anΣ STNDOU╘ useΣ fo≥ norma∞ áinì
  717. ááááááááááááááátensit∙ print«  Thσ correspondinτ DINI╘ shoulΣ ábσ ì
  718. áááááááááááááááuseΣ t∩ restorσ norma∞ modσ jus⌠ prio⌠ t∩ áprograφ ì
  719. áááááááááááááááexit.
  720.  
  721.      Routine║   DINIT
  722.      Function║ De-initialize the terminal; return to normal
  723.      Entry:    None
  724.      Exit:     None
  725.      Affected: None
  726.      Usage:    Normall∙ áuseΣ t∩ restorσ termina∞ defaul⌠ ácondiì
  727. ááááááááááááááátion≤ áupoε prograφ termination«  Seσ usagσ ánote≤ ì
  728. áááááááááááááááfo≥ TINI╘ above.
  729.      Example:
  730.                          EXT       TINIT,DINIT    ; declare the routines
  731.                          ...                      ; ..initial program code
  732.                          CALL      TINIT          ; initialize the terminal
  733.                          ...                      ; ..main program code
  734.                          CALL      DINIT          ; do just before exiting pgm
  735.                          JP        EXIT           ; ..and return to normal
  736. .paèGRAPHICSô á(Januar∙ 22¼ 1990):é  Thesσ extension≤ t∩ VLI┬ áincorpoì
  737. ratσ man∙ oµ thσ interface≤ oµ thσ origina∞ Echelon/Denni≤ Wrigh⌠ ì
  738. GRXLI┬ anΣ GRWLIB¼ anΣ providσ additiona∞ functionalit∙ fo≥ easΘì
  739. e≥ áinterfacing«  The∙ requirσ thσ extendeΣ TCA╨ ádefinition≤ áiε ì
  740. orde≥ t∩ work.
  741.  
  742. INITIALIZATION:
  743.  
  744.      Routine║   GZ3INIT
  745.      Function║ Initialize Z3LIB and VLIB, return TCAP flags
  746.      Entry:    HL = pointer to Z3 environment descriptor
  747.      Exit:     A = bitmap of capabilities, zero set on results:
  748.                     b0 = ▒ áiµ delete/inser⌠ linσ present¼ á░ áiµ ì
  749. áááááááááááááááááááááááááabsent
  750.                     b1 = 1 if clear to EOS present, 0 if absent
  751.                     b2 = 1 if graphics on/off present, 0 if absent
  752.                     b3 = ▒ iµ 1│ graphic≤ character≤ exist¼ ░ áiµ ì
  753. áááááááááááááááááááááááááan∙ absent
  754.      Affected: AF
  755.      Usage:    Call≤ Z3VINI╘ anΣ thereforσ ma∙ bσ substituteΣ fo≥ ì
  756. ááááááááááááááái⌠ át∩ áse⌠ thσ Z3LI┬ ENVPT╥ anΣ áinitializσ áVLI┬ ì
  757. ááááááááááááááároutines«  Flaτ bit≤ arσ returneΣ t∩ sho≈ áwhethe≥ ì
  758. áááááááááááááááthσ TCA╨ extendeΣ function≤ arσ present.
  759.  
  760.      Routine║   GRXON
  761.      Function║ Place terminal in graphics mode
  762.      Entry:    None
  763.      Exit:     A <> 0, zero flag clear (NZ) if operation successful
  764.                A = 0, zero flag set (Z) if not implemented
  765.      Affected: AF
  766.      Usage:    Control≤ thσ graphic≤ capabilitie≤ oµ thσ termina∞ ì
  767. áááááááááááááááa≤ defineΣ iε thσ extendeΣ TCAP«  Iµ thi≤ áro⌡tinσ ì
  768. ááááááááááááááái≤ no⌠ implemented¼ an∙ call≤ t∩ graphiπ ároutine≤ ì
  769. áááááááááááááááwil∞ prin⌠ thσ defineΣ string≤ iε norma∞ áalphanuì
  770. ááááááááááááááámeriπ mode.
  771.      Example║  Seσ GRXOF╞ below.
  772.  
  773.      Routine:   GRXOFF
  774.      Function║ Return terminal to alphanumeric mode
  775.      Entry:    None
  776.      Exit:     A <> 0, zero flag clear (NZ) if operation successful
  777.                A = 0, zero flag set (Z) if not implemented
  778.      Affected: AF
  779.      Usage:    Turn≤ ofµ thσ graphic≤ capabilite≤ oµ you≥ átermiì
  780. ááááááááááááááána∞ a≤ defineΣ iε thσ extendeΣ TCAP.
  781.      Example:
  782.                          EXT       GRXON,GRXOF╞   ; define the routines
  783.                          ...                      ; ..do VIDINIT/Z3VINIT up here
  784.                          CALL      GRXON          ; put terminal in graphics mode
  785.                          JR        Z,NOGRAF       ; .jump if no graphics mode
  786.                          ...                      ; ..else print in graphics
  787.                          CALL      GRXOFF         ; return to alphanumeric mode
  788. .paè     Routine║   CURON ¼  CUROFF
  789.      Function║ Turε displa∙ oµ curso≥ oε o≥ off
  790.      Entry║    None
  791.      Exit║     ┴ <╛ 0¼ zer∩ flaτ clea≥ (NZ⌐ iµ operatioε successful
  792.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ no⌠ implemented
  793.      Affected║ AF
  794.      Usage:    Thesσ routine≤ allo≈ inhibitinτ thσ curso≥ ádurinτ ì
  795. ááááááááááááááágraphiπ ádisplay≤ t∩ avoiΣ thσ distractioε oµ áthσ ì
  796. ááááááááááááááácurso≥ ájumpinτ áarounΣ thσ screen« á Turninτ áthσ ì
  797. ááááááááááááááácurso≥ áofµ áwil∞ supposedl∙ als∩ áspeeΣ áu≡ ásomσ ì
  798. ááááááááááááááátermina∞ operations«  CUROF╞ turn≤ ofµ thσ cursor¼ ì
  799. áááááááááááááááwhilσ CURO╬ turn≤ i⌠ bacδ on.
  800.  
  801. BLOC╦ GRAPHICS:
  802.  
  803.      Routines║  DRFULL ¼  DRHASH
  804.      Function║ Prin⌠ ß graphic≤ blocδ character
  805.      Entry:    None
  806.      Exit:     A <> 0, zero flag clear (NZ) if character printed
  807.                A = 0, zero flag set (Z) if not implemented
  808.      Affected: AF
  809.      Usage:    Thesσ ároutine≤ arσ useΣ b∙ severa∞ oµ áthσ áaddeΣ ì
  810. ááááááááááááááároutine≤ (fo≥ example¼ thσ linσ dra≈ routines⌐ át∩ ì
  811. áááááááááááááááprin⌠ ááful∞-blocδ ágraphic≤ ácharacter≤ át∩ ááthσ ì
  812. áááááááááááááááscreen«  DRFUL╠ print≤ ß ful∞ graphic≤ blocδ charì
  813. áááááááááááááááacter╗ áDRHAS╚ print≤ ß hasheΣ o≥ shadeΣ ágraphic≤ ì
  814. áááááááááááááááblocδ character.
  815.      Example:
  816.                          EX╘       DRFULL,DRHASH  ; declare the routines
  817.                          ...                      ; ..other code including Z3INIT
  818.                          CALL      DRFULL         ; print full block graphics
  819.                          CALL      DRHASH         ; ..and hashed (shaded) block
  820.                          ...                      ; carry on!
  821.  
  822. CORNER╙ AN─ INTERSECTIONS:
  823.  
  824.      Routines║  ULEFT ¼  URIGHT ¼  LLEFT ¼  LRIGHT
  825.      Function: Prin⌠ ácorne≥ graphic≤ characte≥ ¡¡ áULEF╘ áuppe≥-ì
  826. áááááááááááááááleft¼ URIGH╘ uppe≥-right¼ LLEF╘ lowe≥-left¼ LRIGH╘ ì
  827. ááááááááááááááálowe≥-right
  828.      Entry║    None
  829.      Exit:     A <> 0, zero flag clear (NZ) if character printed
  830.                A = 0, zero flag set (Z) if not implemented
  831.      Affected: AF
  832.      Usage:    Print≤ thσ respectivσ corne≥ graphic≤ ácharacters«  ì
  833. áááááááááááááááUseΣ áiε thσ bo° drawinτ routinσ describeΣ ábelow«  ì
  834. áááááááááááááááIµ yo⌡ havσ n∩ graphic≤ capability¼ usσ character≤ ì
  835. áááááááááááááááiε parenthese≤ iε TCA╨ strings.
  836. .paè     Routines║  LTISEC ¼  RTISEC ¼  UISEC ¼  LISEC ¼  ISEC
  837.      Function: Prin⌠ áintersectioε graphic≤ characte≥ á¡¡ áLTISE├ ì
  838. áááááááááááááááleft¼ RTISE├ right¼ UISE├ upper¼ LISE├ lower¼ ISE├ ì
  839. áááááááááááááááintersection
  840.      Entry:    None
  841.      Exit:     A <> 0, zero flag clear (NZ) if character printed
  842.                A = 0, zero flag set (Z) if not implemented
  843.      Affected: AF
  844.      Usage:    A≤ áwitΦ thσ corne≥ routines¼ thesσ prin⌠ thσ áreì
  845. áááááááááááááááspectivσ ágraphic≤ characte≥ fo≥ áthei≥ áfunction«  ì
  846. áááááááááááááááDefinσ áthσ TCA╨ strinτ fo≥ thesσ function≤ t∩ ábσ ì
  847. áááááááááááááááthσ ASCI╔ characte≥ iε parenthese≤ iµ yo⌡ havσ án∩ ì
  848. ááááááááááááááágraphic≤ capability.
  849.      Example:
  850.                        EXT     LTISEC,RTISEC,UISEC,LISEC,ISEC  ; declare routines
  851.                        ...                    ; ..preceding code
  852.                        CALL    LTISEC         ; (or RTISEC, etc)
  853.  
  854. HORIZONTA╠ AN─ VERTICA╠ BARS:
  855.  
  856.      Routine║   DRHBAR
  857.      Function: Prin⌠ heav∙ horizonta∞ ba≥ witΦ thσ graphic≤ áful∞ ì
  858. áááááááááááááááo≥ hasheΣ blocδ characte≥ froφ inlinσ code
  859.      Entry:    None; the top of stack points to parameters
  860.      Exit:     None; execution resumes after the parameters
  861.      Affected: None
  862.      Usage:    UseΣ áwherσ fixeΣ parameter≤ exist«  Fo≥ ávariablσ ì
  863. ááááááááááááááába≥ parameters¼ usσ GHBA╥ whicΦ execute≤ thσ ásamσ ì
  864. áááááááááááááááfroφ áparameter≤ passeΣ iε registers« á Parameter≤ ì
  865. áááááááááááááááfo≥ DRHBA╥ are:
  866.                          cal∞ drhbar
  867.                          defb  Type    ; 1 = Full Block, 2 = Hashed Block
  868.                          defb  Row     ; 1 = Top Row on screen
  869.                          defb  Column  ; 1 = Left Most Column on screen
  870.                          defb  Length  ; Number of characters to print
  871.                          defΓ  Direc   ; 0 = Left-to-Right, 1 = R-to-L
  872.                Wheε bar≤ arσ specifieΣ a≤ righ⌠-t∩-left¼ thσ lef⌠ ì
  873. ááááááááááááááámargiε i≤ validateΣ fo≥ exceedinτ thσ lef⌠ margin¼ ì
  874. áááááááááááááááanΣ áonl∙ áthσ valiΣ portioε i≤ áprinted« á Actua∞ ì
  875. áááááááááááááááprintinτ i≤ alway≤ lef⌠-t∩-right.
  876.      Example:
  877.                          EX╘       DRHBA╥         ; declare the routine
  878.                          ...                      ; ..preceding code
  879.                          CALL      DRHBAR         ; draw heavy bar at:
  880.                          DEF┬      1,2,10,20,░    ╗ full¼ ro≈ 2¼ col 10, len 20
  881.                                                   ; ..print left-to-right
  882.                          ...                      ; execution resumes here
  883.  
  884.      Routines║  DRHORZ ¼  ERAHORZ
  885.      Function: Prin⌠ o≥ erasσ horizonta∞ linσ froφ inlinσ parameì
  886. áááááááááááááááters
  887.      Entry:    None╗ the top of stack points to parameters
  888.      Exit:     None; execution resumes after the parameters
  889.      Affected: None
  890.      Usage:    DRHOR┌ draw≤ ß thiε graphic≤ horizonta∞ line¼ áanΣ ìèáááááááááááááááERAHOR┌ áerase≤ áß álinσ b∙ áoverwritinτ ái⌠ áwitΦ ì
  891. áááááááááááááááspaces« á The∙ áarσ useΣ áwherσ áfixeΣ áparameter≤ ì
  892. áááááááááááááááexist«  Fo≥ variablσ ba≥ parameters¼ usσ GHBA╥ anΣ ì
  893. áááááááááááááááERAHBA╥ áwhicΦ áexecutσ thσ samσ áfroφ áparameter≤ ì
  894. ááááááááááááááápasseΣ iε registers«  Parameter≤ are:
  895.                          cal∞  drhorz [or erahorz]
  896.                          defb  Row     ; 1 = top row on screen
  897.                          defΓ  Column  ; 1 = left most column on screen
  898.                          defb  Length  ; number of characters to print
  899.                          defb  Direc   ; 0 = left-to-right, 1 = right-to-left
  900.                Wheε áline≤ áarσ specifieΣ a≤ árigh⌠-t∩-left¼ áthσ ì
  901. ááááááááááááááálef⌠ ámargiε i≤ validateΣ fo≥ exceedinτ áthσ álef⌠ ì
  902. ááááááááááááááámargin¼ áanΣ áonl∙ thσ valiΣ portioε ái≤ áprinted«  ì
  903. áááááááááááááááActua∞ printinτ i≤ alway≤ lef⌠-t∩-right.
  904.      Example:
  905.                          EX╘       DRHORZ,ERAHOR┌ ; declare the routines
  906.                          ...                      ; ..preceding code
  907.                          CALL      DRHORZ         ; draw horizontal line at:
  908.                          DEF┬      2,10,20,░      ╗ ro≈ 2¼ co∞ 10¼ length 20
  909.                                                   ; ..print left-to-right
  910.                          ...                      ; execution resumes here
  911.                          CALL      ERAHORZ        ; erase the horizontal line at:
  912.                          DEF┬      5,60,20,▒      ╗ ro≈ 5¼ co∞ 60¼ length 20
  913.                                                   ╗ ..froφ righ⌠-t∩-left
  914.  
  915.      Routine║   GHBAR
  916.      Function: Prin⌠ ß graphic≤ horizonta∞ bar/linσ froφ áparameì
  917. áááááááááááááááter≤ iε registers
  918.      Entry:    A = bar type (0=line, 1=full block, 2=hashed block)
  919.                B = length of bar
  920.                C = print direction (0=left-to-right,1=right-to-left)
  921.                H = starting row (1=top of screen)
  922.                L = starting column (1=leftmost column)
  923.      Exit:     None; registers are meaningless, the bar is printed
  924.      Affected: AF¼ BC¼ HL
  925.      Usage:    UseΣ wherσ horizonta∞ ba≥ parameter≤ arσ calculatì
  926. áááááááááááááááeΣ b∙ ß program¼ o≥ no⌠ knowε a⌠ assembl∙ time.
  927.      Examplσ (see als∩ note in DRHORZ example):
  928.                          EXT       GHBA╥          ; declare the routine
  929.                          ...                      ; ..preceding code
  930.                          LD        A,2            ; print bar w/hashed block char
  931.                          LD        HL,10*256+25   ; .start at row 10, column 25
  932.                          LD        BC,15*256+0    ; ..length of 15, left-to-right
  933.                          CALL      GHBAR          ; print it graphically
  934.  
  935.      Routine║   ERAHBAR
  936.      Function║ Erase horizontal bar from register parameters
  937.      Entry:    B = length of bar
  938.                C = print direction (0=left-to-right,1=right-to-left)
  939.                H = starting row (1=top of screen)
  940.                L = starting column (1=leftmost column)
  941.      Exit:     None; registers are meaningless, the bar is erased
  942.      Affected: AF¼ BC¼ HL
  943.      Usage:    Erase≤ ß horizonta∞ ba≥ b∙ overwritinτ witΦ space≤ ì
  944. áááááááááááááááwherσ áparameter≤ arσ calculateΣ b∙ ß program¼ áo≥ ìèáááááááááááááááarσ no⌠ knowε a⌠ assembl∙ time.
  945.      Examplσ (see als∩ note in ERAHORZ example):
  946.                          EX╘       ERAHBAR        ; declare the routine
  947.                          ...                      ; ..preceding code
  948.                          LD        HL,8*256+50    ; .start at row 8, column 50
  949.                          LD        BC,40*256+1    ; ..length of 40, right-to-left
  950.                          CALL      ERAHBAR        ; erase it
  951.  
  952.      Routine║   DRVBAR
  953.      Function: Dra≈ heav∙ vertica∞ ba≥ froφ parameter≤ passeΣ áoε ì
  954. ááááááááááááááástack
  955.      Entry:    None; parameters are addressed by top of stack
  956.      Exit:     None╗ áexecutioε resume≤ afte≥ parameters¼ ba≥ ái≤ ì
  957. áááááááááááááááprinted
  958.      Affected: None
  959.      Usage:    UseΣ wheε ß heav∙ fixeΣ-locatioε ba≥ i≤ needed¼ o≥ ì
  960. ááááááááááááááába≥ locatioε anΣ sizσ arσ knowε a⌠ assembl∙ átime«  ì
  961. áááááááááááááááBa≥ character≤ ma∙ bσ ful∞ o≥ hasheΣ block¼ eithe≥ ì
  962. ááááááááááááááásinglσ áo≥ doublσ width«  Seσ GVBA╥ fo≥ áthσ ásamσ ì
  963. áááááááááááááááfunction≤ áfroφ áparameter≤ passeΣ áiε áregisters«  ì
  964. áááááááááááááááParameter≤ are:
  965.                          cal∞  drvbar  ; call routine passing param≤ addr
  966.                          defb  Type    ; 1=solid single-wide, 2=solid
  967.                                        ╗ double-wide¼ 3=hashed single-
  968.                                        ╗ wide, 4=hashed double-wide
  969.                          defΓ  Row     ; starting row (1=top row)
  970.                          defΓ  Column  ; starting column (1=leftmost col)
  971.                          defb  Length  ; number of columns in bar
  972.                          defb  Dir     ; 0=top-to-bottom, 1=bottom-to-top
  973.                Wheε ß ba≥ i≤ drawε froφ bottoφ-t∩-top¼ check≤ arσ ì
  974. ááááááááááááááámadσ fo≥ exceedinτ thσ to≡ oµ screeε (ro≈ 1)«  Thσ ì
  975. ááááááááááááááálengtΦ i≤ adjusteΣ iµ s∩ t∩ prin⌠ onl∙ thσ par⌠ oε ì
  976. áááááááááááááááscreen«  Bar≤ arσ alway≤ printeΣ to≡-t∩-bottom.
  977.      Example:
  978.                          EXT       DRVBAR         ; declare the routine
  979.                          ...                      ; ..preceding code
  980.                          CALL      DRVBAR         ; draw vertical bar as:
  981.                          DEFB      2,20,10,5,0    ; solid single-width, row 20,
  982.                                                   ; ..col 10, 5 long,
  983.                                                   ╗ ..to≡-t∩-bottom
  984.                          ...                      ; execution resumes here
  985.  
  986.      Routines║  DRVERT ¼  ERAVERT
  987.      Function: Prin⌠ o≥ erasσ graphic≤ vertica∞ linσ froφ áinlinσ ì
  988. áááááááááááááááparameters
  989.      Entry:    None; the top of stack points to parameters
  990.      Exit:     None; execution resumes after the parameters
  991.      Affected: None
  992.      Usage:    DRVER╘ print≤ ß vertica∞ linσ anΣ ERAVER╘ erase≤ ß ì
  993. ááááááááááááááávertica∞ linσ froφ inlinσ parameters«  Thesσ árouì
  994. ááááááááááááááátine≤ arσ useΣ wherσ fixeΣ parameter≤ exist« á Fo≥ ì
  995. ááááááááááááááávariablσ ába≥ áparameter≤ usσ GVBA╥ áanΣ áERAVBAR¼ ì
  996. áááááááááááááááwhicΦ áexecutσ thσ samσ froφ parameter≤ passeΣ áiε ì
  997. áááááááááááááááregisters«  Parameter≤ are:
  998. .paè                         cal∞  drvert [or eravert]
  999.                          defb  Row     ; 1=top row on screen
  1000.                          defb  Column  ; 1=leftmost column on screen
  1001.                          defb  Length  ; number of characters to print
  1002.                          defb  Direc   ; 0=top-to-bottom, 1=bottom-to-top
  1003.                Wheε ß ba≥ i≤ drawε froφ bottoφ-t∩-top¼ check≤ arσ ì
  1004. ááááááááááááááámadσ fo≥ exceedinτ thσ to≡ oµ screeε (ro≈ 1)«  Thσ ì
  1005. ááááááááááááááálengtΦ i≤ adjusteΣ iµ s∩ t∩ prin⌠ onl∙ thσ par⌠ oε ì
  1006. áááááááááááááááscreen«  Bar≤ arσ alway≤ printeΣ to≡-t∩-bottom.
  1007.      Example:
  1008.                          EX╘       DRVERT,ERAVER╘ ╗ declarσ thσ routines
  1009.                          ..«                      ╗ ..precedinτ code
  1010.                          CALL      DRVERT         ; draw vertical line at:
  1011.                          DEFB      2,10,15,0      ; row 2, col 10, length 15
  1012.                                                   ; ..print top-to-bottom
  1013.                          ..«                      ; execution resumes here
  1014.                          CALL      ERAVERT        ; erase the vertical line at:
  1015.                          DEFB      22,60,20,1     ; row 22, col 60, length 20
  1016.                                                   ; ..from bottom-to-top
  1017.  
  1018.      Routine║   GVBAR
  1019.      Function: Prin⌠ ágraphic≤ ávertica∞ bar/linσ áfroφ áregiste≥ ì
  1020. áááááááááááááááparameters
  1021.      Entry:    ┴ ╜ ba≥ typσ (0=line¼ 1=singlσ ful∞ block¼ á2=douì
  1022. áááááááááááááááblσ ful∞ block¼ 3=singlσ hasΦ block¼ 4=doublσ hasΦ ì
  1023. áááááááááááááááblock)
  1024.                B = length of bar (number of characters)
  1025.                C = print direction (0=top-to-bottom,1=bottom-to-top)
  1026.                H = starting row (1=top of screen)
  1027.                L = starting column (1=leftmost column)
  1028.      Exit:     None; registers are meaningless, the bar is printed
  1029.      Affected: AF¼ BC¼ HL
  1030.      Usage:    Print≤ ácalculateΣ ávertica∞ ábar≤ áfroφ áprogram≤ ì
  1031. áááááááááááááááwherσ parameter≤ arσ no⌠ knowε a⌠ assembl∙ time.
  1032.      Examplσ (see note in DRVERT example):
  1033.                          EX╘       GVBAR          ; declare the routine
  1034.                          ...                      ; ..preceding code
  1035.                          LD        A,2            ; double bar w/full block char
  1036.                          LD        HL,22*256+60   ; .start at row 22, column 60
  1037.                          LD        BC,15*256+1    ; ..length of 15, bottom-to-top
  1038.                          CALL      GVBAR          ; print it graphically
  1039.  
  1040.      Routine║   ERAVBAR
  1041.      Function║ Erase vertical bar from register parameters
  1042.      Entry:    B = length of bar (number of characters)
  1043.                ├ ╜ prin⌠ directioε (0=to≡-t∩-bottom¼ 1=bottoφ-t∩-ì
  1044. ááááááááááááááátop)
  1045.                H = starting row (1=top of screen)
  1046.                L = starting column (1=leftmost column)
  1047.      Exit:     None; registers are meaningless, the bar is erased
  1048.      Affected: AF¼ BC¼ HL
  1049.      Usage:    Erase≤ áß vertica∞ ba≥ b∙ overwritinτ witΦ áspace≤ ì
  1050. áááááááááááááááwherσ áparameter≤ arσ calculateΣ b∙ ß program¼ áo≥ ì
  1051. áááááááááááááááarσ áno⌠ áknowε a⌠ assembl∙ time« á D∩ átwicσ áfo≥ ì
  1052. ááááááááááááááádoublσ-widtΦ bar.è     Examplσ (see note in ERAVERT example):
  1053.                          EX╘       ERAVBAR        ; declare the routine
  1054.                          ...                      ; ..preceding code
  1055.                          LD        HL,8*256+10    ; .start at row 8, column 10
  1056.                          LD        BC,15*256+0    ; ..length of 15, top-to-bottom
  1057.                          CALL      ERAVBAR        ; erase it
  1058.  
  1059. BO╪ DRAWIN╟ ROUTINES:
  1060.  
  1061.      Routines║  DRFBOX ¼  DRBOX ¼  ERABOX
  1062.      Function: Dra≈ anΣ erasσ graphic≤ characte≥ bo° froφ áinlinσ ì
  1063. áááááááááááááááparameters
  1064.      Entry:    None; the top of stack addresses box parameters
  1065.      Exit:     None╗ áexecutioε áresume≤ a⌠ ábytσ áfollowinτ áthσ ì
  1066. áááááááááááááááparameters
  1067.      Affected: None
  1068.      Usage:    DRFBO╪ draw≤ graphic≤ boxe≤ frameΣ witΦ ful∞ blocδ ì
  1069. ááááááááááááááácharacters¼ DRBO╪ draw≤ graphic≤ boxe≤ frameΣ witΦ ì
  1070. ááááááááááááááánorma∞ ágraphic≤ linσ anΣ corne≥ ácharacters¼ áanΣ ì
  1071. áááááááááááááááERABO╪ áerase≤ ß box«  Boxe≤ arσ drawε áfroφ áto≡-ì
  1072. ááááááááááááááálef⌠ át∩ bottoφ right¼ anΣ eraseΣ áb∙ áoverwritinτ ì
  1073. áááááááááááááááwitΦ spaces«  Parameter≤ are:
  1074.                          cal∞  drfbox  ; (or drbox or erabox)
  1075.                          defb  Row     ; starting row (1 = top row)
  1076.                          defb  Column  ; starting column
  1077.                          defb  Height  ; height of box in character rows
  1078.                          defb  Width   ; width of box in character positions
  1079.      Example:
  1080.                          EX╘       DRFBOX,DRBOX,ERABOX ; declare routines
  1081.                          ...                      ; ..preceding code
  1082.                          CALL      DRBOX          ; draw a normal box
  1083.                          DEFB      5,5,10,20      ; row 5, col 5, 10 spaces high
  1084.                                                   ; ..and 20 spaces wide
  1085.                          CALL      DRFBOX         ; draw box framed w/solid blks
  1086.                          DEFB      10,30,6,25     ; row 10, col 30, 6 spaces high
  1087.                                                   ; ..and 25 wide
  1088.                          CALL      ERABOX         ; erase the first box
  1089.                          DEFB      5,5,10,20
  1090.                          ...                      ; ..and continue
  1091.  
  1092.      Routines║  GFBOX ¼  GBOX ¼  GERBOX
  1093.      Function: Dra≈ o≥ erasσ graphic≤ characte≥ bo° froφ registe≥ ì
  1094. áááááááááááááááparameters
  1095.      Entry:    B = width of box in character spaces
  1096.                C = height of box in lines
  1097.                H = starting row (top left corner, 1=top row)
  1098.                ╠ á╜ startinτ columε (to≡ lef⌠ corner¼ á1=leftmos⌠ ì
  1099. ááááááááááááááácolumn)
  1100.      Exit:     None; registers indeterminate, box drawn
  1101.      Affected: AF¼ BC¼ HL
  1102.      Usage:    GFBO╪ ádraw≤ graphic≤ bo° frameΣ witΦ soliΣ áblocδ ì
  1103. ááááááááááááááácharacters¼ áGBO╪ ádraw≤ graphiπ bo° áframeΣ áwitΦ ì
  1104. ááááááááááááááálinσ anΣ corne≥ graphic≤ characters¼ GERBO╪ erase≤ ì
  1105. ááááááááááááááábo° áb∙ overwritinτ witΦ spaces« á Thesσ ároutine≤ ì
  1106. áááááááááááááááimplemen⌠ áthσ samσ function≤ a≤ thσ previou≤ ábo° ìèááááááááááááááároutines¼ ábu⌠ áderivσ thei≥ parameter≤ áfroφ áCP╒ ì
  1107. áááááááááááááááregisters« á Usσ áthesσ ároutine≤ áfo≥ ácalculateΣ ì
  1108. ááááááááááááááávalue≤ o≥ fo≥ parameter≤ no⌠ knowε a⌠ assembly.
  1109.      Example:
  1110.                          EX╘       GFBOX,GBOX,GERBOX ; declare the routines
  1111.                          ...                      ; ..preceding code
  1112.                          LD        BC,30*256+10   ; 30 spaces wide, 10 high
  1113.                          LD        HL,10*256+20   ; ..at row 10, col 20
  1114.                          CALL      GBOX           ; draw it!
  1115.  
  1116.      Routine║   CHKBOX
  1117.      Function║ Check and adjust box parameters
  1118.      Entry:    B = width of box in character spaces
  1119.                C = height of box in lines
  1120.                H = starting row (top left corner, 1=top row)
  1121.                ╠ á╜ startinτ columε (to≡ lef⌠ corner¼ á1=leftmos⌠ ì
  1122. ááááááááááááááácolumn)
  1123.      Exit:     ┴ á<╛ 0¼ zer∩ clea≥ (NZ⌐ iµ bo° drawable¼ áparameì
  1124. áááááááááááááááter≤ set
  1125.                A = 0, zero flag clear (Z) if box not drawable
  1126.      Affected: AF, anΣ maybe B├ anΣ HL if parameters arσ adjusted
  1127.      Usage:    Thi≤ ároutinσ ái≤ useΣ internall∙ át∩ áadjus⌠ ábo° ì
  1128. ááááááááááááááádimension≤ át∩ áscreeε sizσ reflecteΣ iε áthσ áCR╘ ì
  1129. ááááááááááááááádatß iε thσ Z│ environment«  Startinτ ro≈ o≥ ácolì
  1130. áááááááááááááááumε áexceedinτ áthσ maximuφ heigh⌠ o≥ áwidtΦ áwil∞ ì
  1131. ááááááááááááááácausσ áthσ áerro≥ status«  I⌠ ma∙ ábσ áuseΣ áafte≥ ì
  1132. ááááááááááááááásettinτ áregister≤ fo≥ ß GRBO╪ o≥ GRFBO╪ ácal∞ át∩ ì
  1133. ááááááááááááááásavσ áthσ áactua∞ ábo° parameter≤ áwhicΦ áwil∞ ábσ ì
  1134. ááááááááááááááádrawn.
  1135.      Example:
  1136.                          EXT       CHKBOX,GBOX    ; declare the routines
  1137.                          ...                      ; ..set up for box draw
  1138.                          CALL      CHKBOX         ; validate the dimen/location
  1139.                          JR        Z,NOGOOD       ; ..jump if can't draw this one
  1140.                          LD        (HITWID),BC    ; else save width/height
  1141.                          LD        (ROWCOL),HL    ; ..and row/col start loc'n
  1142.                          CALL      GBOX           ; draw this box
  1143.                          ...
  1144.  
  1145. PULL-DOW╬ MENUS:
  1146.  
  1147.      Routine║   SETPDM
  1148.      Function: Se⌠ áselec⌠ men⌡ anΣ iteφ men⌡ ba≥ áfo≥ ápul∞-dowε ì
  1149. ááááááááááááááámen⌡ froφ inlinσ data
  1150.      Entry:    None; top of stack points to menu data area
  1151.      Exit:     A <> 0, zero flag clear (NZ) if pull-down menu OK
  1152.                A = 0, zero set (Z) if error or not supported
  1153.      Affected: AF
  1154.      Usage: á  SETPD═ áuse≤ inlinσ parameter≤ anΣ áestablishe≤ áß ì
  1155. ááááááááááááááásinglσ men⌡ selection¼ anΣ se⌠ informatioε fo≥ thσ ì
  1156. ááááááááááááááápul∞-dowε iteφ selectioε bar«  Thσ numbe≥ oµ ámen⌡ ì
  1157. áááááááááááááááselection≤ ái≤ determineΣ b∙ screeε width¼ anΣ áu≡ ì
  1158. ááááááááááááááát∩ áteε áselection≤ ma∙ bσ supported« á Men⌡ ádatß ì
  1159. ááááááááááááááádescription≤ áarσ ASCI╔ tex⌠ string≤ áwitΦ ábinar∙ ì
  1160. ááááááááááááááávalue≤ oµ onσ t∩ teε (onl∙ ▒-╡ currentl∙ used⌐ át∩ ìèááááááááááááááádenotσ specia∞ feature≤ anΣ fields.
  1161.  
  1162.                Thσ men⌡ datß areß i≤ structured a≤ follows:
  1163.                     Menu number (byte⌐ in the range of 1..10
  1164.                     Menu name (string) terminated by binary 1
  1165.                     Item selection strings terminated by binary 3's
  1166.                Optiona∞ field≤ ma∙ bσ intersperseΣ witΦ selectioε ì
  1167. ááááááááááááááástrings:
  1168.                     Sub-header strings terminated by binary 2's
  1169.                     Separator lines indicateΣ b∙ binary ┤ (byte)
  1170.                     Blank lines indicateΣ b∙ binary ╡ (byte)
  1171.      Example:
  1172.                               EXT       SETPDM    ; declare the routine
  1173.                               ...                 ; ..call PDMINI up here
  1174.                               CALL      SETPDM
  1175.                               DEFB      1         ; menu number (1..10)
  1176.                               DEFB      'MenuName',1 ; name on menu bar
  1177.                               DEFB      'Subheader',2 ; optional subheader(s)
  1178.                               DEFB      4         ; optional separator line
  1179.                               DEFB      'Item 1',3 ; first item name
  1180.                               DEFB      5         ; optional blank line
  1181.                               DEFB      'Item 2',3 ; second item name
  1182.                               DEFB      0         ; end of menu item list
  1183.                               ...                 ; ..execution resumes here
  1184.  
  1185.      Routine║   SETPDR
  1186.      Function║ Se⌠ áselec⌠ men⌡ anΣ iteφ men⌡ ba≥ áfo≥ ápul∞-dowε ì
  1187. ááááááááááááááámen⌡ froφ registe≥ data
  1188.      Entry:    HL = pointer to menu data area
  1189.      Exit:     A <> 0, zero flag clear (NZ) if pull-down menu OK
  1190.                A = 0, zero set (Z) if error or not supported
  1191.                HL = address of byte after terminating NUL
  1192.      Affected: AF¼ HL
  1193.  
  1194.      Usage: á  SETPD╥ use≤ ß separatσ datß areß pointeΣ t∩ b∙ áH╠ ì
  1195. áááááááááááááááanΣ áestablishe≤ ß singlσ men⌡ selection¼ anΣ áse⌠ ì
  1196. áááááááááááááááinformatioε fo≥ thσ pul∞-dowε iteφ selectioε ábar«  ì
  1197. áááááááááááááááThσ ánumbe≥ áoµ men⌡ selection≤ i≤ ádetermineΣ áb∙ ì
  1198. áááááááááááááááscreeε áwidth¼ áanΣ u≡ t∩ teε áselection≤ áma∙ ábσ ì
  1199. ááááááááááááááásupported«  Men⌡ datß description≤ arσ ASCI╔ átex⌠ ì
  1200. ááááááááááááááástring≤ witΦ binar∙ value≤ oµ onσ t∩ teε (onl∙ ▒-╡ ì
  1201. ááááááááááááááácurrentl∙ áused⌐ át∩ denotσ specia∞ áfeature≤ áanΣ ì
  1202. áááááááááááááááfields.
  1203.  
  1204.                Thσ men⌡ datß areß i≤ structured a≤ follows:
  1205.                     Menu number (byte⌐ in the range of 1..10
  1206.                     Menu name (string) terminated by binary 1
  1207.                     Item selection strings terminated by binary 3's
  1208.                Optiona∞ field≤ ma∙ bσ intersperseΣ witΦ selectioε ì
  1209. ááááááááááááááástrings:
  1210.                     Sub-header strings terminated by binary 2's
  1211.                     Separator lines indicateΣ b∙ binary ┤ (byte)
  1212.                     Blank lines indicateΣ b∙ binary ╡ (byte)
  1213.      Example║  Seσ SETPD═ above.
  1214. è     Routine║   CLRPDM
  1215.      Function║ Clear a pull-down menu from the menu selection bar
  1216.      Entry:    A = menu number to clear (0 = clear all)
  1217.      Exit:     A <> 0, zero flag clear (NZ) if operation successful
  1218.                A = 0, zero flag set (Z) if entry not found
  1219.      Affected: AF
  1220.      Usage:    Delete≤ áaε entr∙ froφ thσ men⌡ ba≥ anΣ move≤ áal∞ ì
  1221. ááááááááááááááásubsequen⌠ áentrie≤ át∩ thσ left« á Logica∞ áentr∙ ì
  1222. ááááááááááááááánumber≤ ásta∙ áthσ samσ a≤ wheε loaded¼ ábu⌠ áthi≤ ì
  1223. áááááááááááááááfunctioε refer≤ t∩ thσ physica∞ positioninτ oε thσ ì
  1224. ááááááááááááááámen⌡ bar.
  1225.      Example:
  1226.                          EXT       CLRPDM         ; declare the variable
  1227.                          ...                      ; ..establish pull-down menus
  1228.                          LD        A,4            ; remove the 4th entry
  1229.                          CALL      CLRPDM         ; ..in the bar
  1230.                          JR        NZ,REMOK       ; jump if removal OK
  1231.                          ...
  1232.  
  1233.      Routine║   SELPDM
  1234.      Function: Ente≥ ápul∞-dowε men⌡ anΣ returε menu/iteφ áselecì
  1235. ááááááááááááááátions
  1236.      Entry:    None
  1237.      Exit:     ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ pul∞-dowε men⌡ áescapσ ì
  1238. áááááááááááááááke∙ pressed
  1239.                A <> 0, zero clear (NZ) if menu item selected
  1240.                H = menu numbe≥ selected
  1241.                L = item selection numbe≥ selected
  1242.      Affected: AF¼ HL
  1243.      Usage:    Thi≤ routinσ form≤ thσ hear⌠ oµ thσ pul∞-dowε men⌡ ì
  1244. ááááááááááááááásystem«  Wheε entered¼ contro∞ wil∞ no⌠ returε át∩ ì
  1245. áááááááááááááááthσ prograφ unti∞ eithe≥ thσ pul∞-dowε men⌡ escapσ ì
  1246. ááááááááááááááácharacte≥ i≤ pressed¼ o≥ ß valiΣ men⌡ anΣ iteφ arσ ì
  1247. áááááááááááááááselected« á B∙ áevaluatinτ áthσ áreturneΣ ávalues¼ ì
  1248. áááááááááááááááspecifiπ áaction≤ ma∙ bσ takeε sucΦ áa≤ áselectinτ ì
  1249. áááááááááááááááprogram≤ t∩ run¼ item≤ t∩ list¼ etc.
  1250.  
  1251.      Routine║   MCLS
  1252.      Function║ Clear terminal screen except for pull-down menu bar
  1253.      Entry:    None
  1254.      Exit:     A <> 0, zero flag reset (NZ) if screen cleared OK
  1255.                A = 0 zero flag set (Z) if CLREOS not implemented
  1256.      Affected: AF
  1257.      Usage:    Clear≤ áthσ áscreeε áfroφ linσ ▓ át∩ áthσ áenΣ-oµ-ì
  1258. áááááááááááááááscreen¼ át∩ preservσ pul∞-dowε men⌡ selectioε ába≥ ì
  1259. áááááááááááááááoε linσ 1.
  1260.  
  1261.      Routine║   PDMINI
  1262.      Function║ Initialize pull-down menu functions
  1263.      Entry:    None
  1264.      Exit:     None; internal menu variables are initialized
  1265.      Affected: None
  1266.      Usage:    Thi≤ ároutinσ mus⌠ bσ calleΣ beforσ thσ ápul∞-dowε ì
  1267. ááááááááááááááámen⌡ ásysteφ i≤ used«  I⌠ clear≤ needeΣ ávariable≤ ì
  1268. áááááááááááááááanΣ set≤ thσ defaul⌠ pul∞-dowε men⌡ escapσ characìèáááááááááááááááte≥ t∩ ES├ (1Bh).
  1269.      Example:
  1270.                          EXT       PDMINI         ; declare the routine
  1271.                          ...                      ; ..preliminary code sections
  1272.                          CALL      PDMINI         ; initialize pull-down menus
  1273.                          ...                      ; ..now set menus, etc
  1274.  
  1275.      Routine║   ISPDM
  1276.      Function║ Check character for pull-down menu escape character
  1277.      Entry:    A = character to check
  1278.      Exit:     A = character
  1279.                Zero clear (NZ) if it is the escape character
  1280.                Zer∩ flaτ se⌠ (Z⌐ iµ no⌠ thσ escapσ charaπter
  1281.      Affected: Flags
  1282.      Usage:    Thi≤ routinσ i≤ useΣ iε thσ pul∞-dowε men⌡ áselecì
  1283. ááááááááááááááátioε ácodσ t∩ sensσ fo≥ thσ escapσ character¼ áanΣ ì
  1284. áááááááááááááááma∙ ábσ useΣ iε ß simila≥ modσ iε othe≥ áprograms«  ì
  1285. áááááááááááááááSe⌠ thσ desireΣ characte≥ witΦ SPDMCHR.
  1286.      Example:
  1287.                          EXT       ISPDM,CIN      ; declare some routines
  1288.                          ...                      ; ..preceding code
  1289.                          CALL      CIN            ; get a character from console
  1290.                          CALL      ISPDM          ; is it the escape char?
  1291.                          JR        NZ,HAVIT       ; ..jump if so
  1292.                          ...                      ; else loop or whatever..
  1293.  
  1294.      Routine║   SPDMCHR
  1295.      Function: Changσ áthσ ávaluσ oµ thσ ápul∞-dowε ámen⌡ áescapσ ì
  1296. ááááááááááááááácharacter
  1297.      Entry:    ┴ ╜ ne≈ characte≥ t∩ usσ a≤ pul∞-dowε men⌡ áescapσ ì
  1298. ááááááááááááááácharacter
  1299.      Exit:     None╗ áthσ characte≥ i≤ se⌠ (normall∙ ES├-1Bh¼ áo≥ ì
  1300. ááááááááááááááá^▄-1Ch)
  1301.      Affected: None
  1302.      Usage:    Change≤ áthσ pul∞-dowε men⌡ escapσ characte≥ áfroφ ì
  1303. áááááááááááááááthσ initia∞ valuσ oµ ES├ (1Bh)«  Norma∞ value≤ arσ ì
  1304. áááááááááááááááeithe≥ ES├ (1Bh⌐ o≥ ^▄ (1Ch).
  1305.  
  1306. READIN╟ TH┼ TERMINA╠ SCREEN:
  1307.  
  1308.      Routine║   GETCUR
  1309.      Function║ Ge⌠ thσ curren⌠ curso≥ positioε froφ thσ terminal
  1310.      Entry║    None
  1311.      Exit║     ┴ ╜ 0FFh¼ zer∩ flaτ clea≥ (NZ⌐ iµ successful
  1312.                H╠ ╜ curren⌠ curso≥ positioε (iµ NZ)
  1313.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ functioε i≤ no⌠ available
  1314.      Affected║ AF¼ HL
  1315.      Usage║    Return≤ curso≥ positioε a≤ useΣ b∙ GOTOX┘ ároutinσ ì
  1316. ááááááááááááááá(╚ ╜ row¼ ╠ ╜ column).
  1317.      Example:
  1318.                          EX╘       GETCUR,GOTOX┘       ╗ declarσ routines
  1319.                          «.«                           ╗ ..intervening code
  1320.                          CAL╠      GETCU╥              ╗ ge⌠ cursor position
  1321.                          J╥        Z,NOTAVAI╠          ╗ ..jum≡ if not available
  1322.                          L─        (CURPOS),H╠         ╗ storσ position for laterè                         «.«                           ╗ .«you≥ screen routines
  1323.                          L─        HL,(CURPOS⌐         ╗ ge⌠ back stored position
  1324.                          CAL╠      GOTOX┘              ╗ anΣ restore cursor
  1325.                                                        ╗  t∩ where it was
  1326.  
  1327.      Routine║   GETLIN
  1328.      Function║ ReaΣ ß linσ froφ thσ termina∞ screen
  1329.      Entry║    Curso≥ positioneΣ a⌠ enΣ oµ line
  1330.      Exit║     ┴ ╜ 0FFh¼ zer∩ flaτ clea≥ (NZ⌐ iµ successful
  1331.                H╠ ╜ addres≤ oµ nul∞-terminateΣ strinτ froφ terminal (if NZ)
  1332.                ┴ ╜ 0¼ zer∩ flaτ se⌠ (Z⌐ iµ functioε i≤ no⌠ available
  1333.      Affected║ AF¼ HL
  1334.      Usage:    Read≤ linσ containinτ curso≥ froφ thσ firs⌠ columε ì
  1335. ááááááááááááááát∩ á(anΣ including⌐ thσ curren⌠ curso≥ column¼ ás∩ ì
  1336. ááááááááááááááápositioε thσ curso≥ first.
  1337.      Example:
  1338.                          EX╘       GOTOXY,GETLI╬       ╗ declarσ routines
  1339.                          ..«                           ╗ ..intervening code
  1340.                          L─        H,▒                 ╗ ro≈ 1
  1341.                          L─        L,8░                ╗ columε 80
  1342.                          CAL╠      GOTOX┘              ╗ position the cursor
  1343.                          CAL╠      GETLI╬              ╗ ge⌠ thσ line
  1344.                          J╥        Z,NOTAVAI╠          ╗ ..jum≡ if not available
  1345. .paè