home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / dpl.zip / DPL.DOC < prev    next >
Text File  |  1988-07-13  |  34KB  |  829 lines

  1.           ================================
  2.             Doug's Programming Language
  3.           ================================
  4.  
  5.                   TABLE OF CONTENTS
  6.  
  7.  
  8.                1. What's needed
  9.                     Hardware required.
  10.                     Programs you must supply.
  11.                     Installing the code on a hard drive.
  12.                     Compiling the sample programs.
  13.  
  14.                2. Basic program structure
  15.  
  16.                3. Data declarations
  17.                     Predefined global variables
  18.                     DEFINE declaration
  19.                     ENDREC declaration
  20.                     FILE declaration
  21.                     INTEGER declaration
  22.                     RECORD declaration
  23.                     SET declaration
  24.                     STRING declaration
  25.  
  26.                4. Executable Instructions
  27.                     CURSOR int,int
  28.                     CALL routine param-1 param-2 param-3 param-4
  29.                     CLOSE file
  30.                     DECODE string,integer
  31.                     ENCODE integer,string
  32.                     GOTO addr
  33.                     HSTOI integer,string
  34.                     IF...
  35.                     INKEY str,WAIT
  36.                     ITOBS string,integer,length
  37.                     ITOHS string,integer
  38.                     MATH EXPRESSIONS
  39.                     NOTE file,dd
  40.                     OPEN INPUT, file
  41.                     POINT file,dd
  42.                     READ file,string,length
  43.                     READB file,record
  44.                     RETURN
  45.                     STOP
  46.                     STRING CONCATENATION
  47.                     WRITE file,string
  48.                     WRITEB file,record
  49.  
  50.                5. Bibliography
  51.  
  52.  
  53. M╙á DO╙á anΣá Macr∩á Assembler¼á aka¼á MASM¼á arσá trademark≤á oµ ì
  54. Microsoft corporation.
  55. èDoug's Programming Language  -- DPL, Version 2.22
  56. Copyright (c) 1988 Douglas S. Cody, All rights reserved.
  57.  
  58.  
  59. .paè                    W h a t 's   N e e d e d
  60.  
  61.  
  62. Hardware Required.
  63.  
  64.      The minimal system configurable recommended to use DPL is:
  65.  
  66.           IBM PC or Compatible w/256k ram.
  67.           MS, PC DOS 2.0 or higher.
  68.           2 floppy disk drives.
  69.           Monochrome or CGA video adapter & monitor.
  70.  
  71.      The optimal system configurable recommended to use DPL is:
  72.  
  73.           IBM PC or Compatible w/640k ram.
  74.           MS, PC DOS 2.0 or higher.
  75.           1 floppy disk drive and a hard drive of
  76.           ten megabytes, or higher.
  77.           Monochrome, CGA, EGA video adapter & monitor.
  78.  
  79.  
  80.  
  81. Programs You Must Supply.
  82.  
  83.      Iε orde≥ t∩ program¼á assemble¼á anΣ ruε program≤ writteε iε ì
  84. DPL¼ thσ followinτ program≤ mus⌠ bσ madσ available:
  85.  
  86.      Microsoft MASM, MAKE, LINK, and LIB, versions 3.0
  87.      through 5.0.
  88.  
  89.      Thesσá program≤ wil∞ havσ t∩ bσ iε thσ curren⌠ director∙á o≥ ì
  90. iε thσ "PATH". See your DOS manual for setting "PATH"s.
  91.  
  92.  
  93.  
  94. Installing the Code on a Hard Drive.
  95.  
  96.      Thσ DP╠ releasσ diskettσ contain≤ tw∩ batcΦ file≤ fo≥ movinτ ì
  97. thσá wholσ releasσ t∩ ß targe⌠ diskettσ o≥ harΣ drive«á Thσ firs⌠ ì
  98. batcΦ filσ i≤ called¼á "MOVE.BAT"«á I⌠ wil∞ cop∙ al∞ thσ corσ DP╠ ì
  99. routine≤á anΣá suppor⌠ file≤ t∩ ß giveεá drive\path«á Thσá seconΣ ì
  100. batcΦá filσ i≤ called¼á "MOVEAPP.BAT"¼á anΣ i⌠ contain≤á al∞á thσ ì
  101. samplσ applicatioε routines¼á programs¼á anΣ suppor⌠ files«á EacΦ ì
  102. batch file is invoked like the following example:
  103.  
  104.           C:\DPL>MOVE A:
  105.           C:\DPL>MOVEAPP A:
  106.  
  107.      Thσá paramete≥á followinτ thσ batcΦ filσ namσ indicate≤á thσ ì
  108. target [drive][path] that the will receive the DPL files.
  109.  
  110. To create a backup of the release from drive A: to drive B:
  111.  
  112.      1. Install a blank, formatted diskette in drive B:
  113.      2. Install the DPL release diskette in drive A:è     3. At the DOS prompt, type "A:" and the ENTER key.
  114.      4. Type "MOVE B:" and the ENTER key. All the core
  115.           routines, libraries & support files will be copied.
  116.      5. Type "MOVEAPP B:" and the ENTER key. All the application
  117.           routines, programs & support file will be copied.
  118.  
  119. To copy the release from drive A: to the hard drive, C:.
  120.  
  121.      1. If the current disk is not drive C, then type "C:"
  122.           and the ENTER key.
  123.      2. If the current disk is drive C, then type "CD\"
  124.           and the enter key.
  125.      3. Type "MKDIR DPL" and the ENTER key.
  126.      4. Type "CD DPL" and the ENTER key.
  127.      5. Install the DPL release diskette in drive A:
  128.      6. Type "A:" and the ENTER key.
  129.      7. Type "MOVE C:" and the ENTER key. All the core
  130.           routines, libraries & support files will be copied.
  131.      8. Type "MOVEAPP C:" and the ENTER key. All the application
  132.           routines, programs & support file will be copied.
  133.  
  134.  
  135.  
  136. Compiling the Sample Programs.
  137.  
  138. U S I N G   F L O P P Y   D I S K S
  139.  
  140.      Fo≥ thosσ oµ yo⌡ usinτ onl∙ tw∩ flopp∙ disks¼ you'l∞ wan⌠ t∩ ì
  141. creatσá ß specia∞ developmen⌠ diskettσ containinτ onl∙ thσá file≤ ì
  142. needeΣ t∩ develo≡ code«á Thσ batcΦ filσ named¼ "MOVEDEV.BATó wil∞ ì
  143. cop∙ thosσ file≤ t∩ ß targe⌠ drive« Follo≈ thσ instruction≤ belo≈ ì
  144. t∩ creatσ thi≤ specia∞ disk:
  145.  
  146.      1. Install the DPL release diskette in drive A:
  147.      2. Install a blank, formatted diskette in drive B: 
  148.      3. At the DOS prompt, type "A:" and the ENTER key.
  149.      4. Type "MOVEDEV B:" and the enter key. All the required
  150.           files will be copied to this diskette.
  151.      5. Copy any DPL source files, such as, LIST.D, to drive B:
  152.  
  153.      Oncσá thσ developmen⌠ diskettσ i≤ finished¼á inser⌠ i⌠á int∩ ì
  154. drivσá A:«á Placσá thσ diskettσ contaiεá Microsoft'≤á MASM.EX┼á ª ì
  155. LINK.EX┼ int∩ drivσ B:«á A⌠ thσ DO╙ prompt¼á typσ "PATH=B:\;ó anΣ ì
  156. thσ returε key« Thi≤ allow≤ thσ Microsof⌠ softwarσ t∩ bσ founΣ b∙ ì
  157. DO╙á wheεá attemptinτ t∩ compilσ thσ DP╠ programs«á Yo⌡á arσá no≈ ì
  158. read∙ t∩ compilσ somσ code«á Thσ DP╠ samplσ program¼ "LIST.Dó ha≤ ì
  159. beeεá copieΣ t∩ thσ developmen⌠ diskettσ t∩ allo≈ yo⌡ t∩ practicσ ì
  160. compiling«á T∩ compilσ thi≤ program¼ type¼ "─ LISTó anΣ thσ ENTE╥ ì
  161. key. Thσá batcΦá file¼áá "D.BATóá wil∞á invokσá thσá DP╠á prepas≤ ì
  162. compiler¼ MASM¼ theε LINK.
  163.      Oncσ thσ compilσ i≤ done¼ thσ DO╙ promp⌠ wil∞ return.
  164.  
  165.  
  166.  
  167. è
  168. U S I N G   H A R D   D R I V E
  169.  
  170.      Iµá yo⌡á arσá usinτ ß harΣ disδ drive¼á you'rσ iεá thσá bes⌠ ì
  171. developmen⌠ environment« Thi≤ allow≤ yo⌡ t∩ storσ al∞ DP╠ codσ iε ì
  172. onσá subdirectory¼á anΣá al∞á thσ Microsof⌠á codσá iεá it'≤á sub-ì
  173. directory«á Placσ thσ patΦ t∩ thσ Microsof⌠ softwarσ iε thσ envi-ì
  174. ronmen⌠á PAT╚á b∙ typinτ "PATH=\[MAS═ PATH]ó a⌠ thσá DO╙á prompt« ì
  175. Oncσ thi≤ i≤ done¼á ente≥ thσ DP╠ subdirectory¼á anΣ you'rσ read∙ ì
  176. t∩á work«á Assuminτ al∞ thσ codσ ha≤ beeε installeΣ iε thi≤á sub-ì
  177. directory¼á type¼á "─á LISTó anΣ thσ ENTE╥ key«á Thσ batcΦá file¼ ì
  178. "D.BATóá wil∞ invokσ thσ DP╠ prepas≤ compiler¼á MASM¼á theε LINK« ì
  179.      Oncσ thσ compilσ i≤ done¼ thσ DO╙ promp⌠ wil∞ return.
  180. .paè          B a s i c   P r o g r a m   S t r u c t u r e 
  181.  
  182. DPL i≤ ß macr∩ languagσ usinτ higΦ leve∞ languagσ synta° fo≥ it'≤ ì
  183. instructions«á I⌠ doe≤ no⌠ limi⌠ thσ programme≥ froφ usinτ nativσ ì
  184. 8088áá code¼áá bu⌠á make≤á programminτá easie≥á b∙á automaticall∙ ì
  185. declarinτá segment≤ anΣ thσ prograφ entrypoint«á Comment≤ ma∙á bσ ì
  186. declareΣá iε standarΣ 808╕ fashioε b∙ placinτ ß semi-coloε t∩ thσ ì
  187. lef⌠ oµ thσ comment'≤ bod∙ oµ text«á Thσ basiπ prograφá structurσ ì
  188. i≤ a≤ follows:
  189.  
  190.      PROG   NAME
  191.      ;
  192.      ; data goes here
  193.      ;
  194.      BEGIN  NAME
  195.      ;
  196.      ; code goes here
  197.      ;
  198.      ENDPGM NAME
  199.  
  200.      Thσ keyworΣ "PROGó declare≤ thσ beginninτ oµ thσ prograφ anΣ ì
  201. open≤ u≡ thσ datß segment«á Thσ datß segmen⌠ wil∞ continuσá unti∞ ì
  202. thσá keyworΣ "BEGINó i≤ encountered«á Oncσ "BEGINó i≤ found¼á thσ ì
  203. datß segmen⌠ i≤ endeΣ anΣ thσ codσ segmen⌠ wil∞ begin«á Thσá codσ ì
  204. segmen⌠ wil∞ bσ endeΣ wheε thσ keyworΣ "ENDPGMó i≤ encountereΣ a⌠ ì
  205. thσá enΣá oµ thσ sourcσ file«á Iε betweeε thσ datß anΣ codσá seg-
  206. ments¼ thσ stacδ segmen⌠ i≤ declareΣ usinτ ß 25╢ word stack.
  207.      Thi≤ maiε procedurσ i≤ declareΣ a≤ ß "FARó procedurσ anΣá i≤ ì
  208. thσ entrypoin⌠ fo≥ thσ program«á Anothe≥ valiΣ wa∙ oµ declarinτ ß ì
  209. prograφá i≤ usinτ thσ keyword¼á "SUBPGMó iε lie⌡ oµ "PROG"«á Thi≤ ì
  210. wil∞á givσá thσá prograφ ß publiπ namσ a≤á wel∞á a≤á declarσá thσ ì
  211. entrypoin⌠ t∩ bσ ß NEA╥ procedure«
  212.      Thσá NAM┼á oµá thσá prograφ caε bσ an∙á name¼á bu⌠á mus⌠á bσ ì
  213. declareΣá threσ time≤ iε thσ program«á Thσ NAM┼ declaratioεá mus⌠ ì
  214. follo≈ the keywords¼ PROG¼ SUBPGM¼ BEGIN¼ anΣ ENDPGM.
  215.      Thσá followinτá arσ tw∩ example≤ oµá thσá shortes⌠á program≤ ì
  216. writteε iε DPL:
  217.  
  218.      Example #1          :    Example #2
  219.                          :
  220.      PRO╟      NAM┼      ║    SUBPG═    NAME
  221.      ;                   :    ;
  222.      BEGIN     NAME      :    BEGIN     NAME
  223.      ;                   :    ;
  224.      ENDPGM    NAME      :    ENDPGM    NAME
  225.  
  226.     Sincσá DP╠ control≤ thσ segmen⌠ declarations¼á thσ prograφ i≤ ì
  227. limiteΣ t∩ 64δ oµ code¼á 64δ oµ data¼á anΣ 64δ oµ stacδá segment« ì
  228. Othe≥ segment≤ ma∙ bσ declared¼ bu⌠ wil∞ bσ nesteΣ dependinτ upoε ì
  229. location«á Iµá ß segmen⌠ i≤ declareΣ withiε thσ boundarie≤ oµ thσ ì
  230. "PROG/SUBPGMó anΣ "BEGINó statement¼ i⌠ wil∞ bσ nesteΣ withiε thσ ì
  231. datß segment«á Likewise¼á iµ thσ segmen⌠ i≤ declareΣ betweeεá thσ ì
  232. "BEGINó anΣ "ENDPGMó statement¼ i⌠ wil∞ bσ nesteΣ withiε thσ codσ ì
  233. segment.
  234. .PAè               D a t a   D e c l a r a t i o n s
  235.  
  236.      DP╠á support≤á simplσ datß types¼á bu⌠ doe≤á no⌠á limi⌠á thσ ì
  237. programme≥á froφá buildinτá othe≥ types«á Thσá basiπá datßá type≤ ì
  238. supporteΣá arσá 1╢ bi⌠ integer≤ anΣ ASCII┌ strings«á Thσá 1╢á bi⌠ ì
  239. integer≤á arσ considereΣ t∩ bσ signeΣ integer≤ anΣ thereforσ wil∞ ì
  240. bσ manipulateΣ appropriately« File≤ arσ supporteΣ whicΦ allo≈ thσ ì
  241. prograφá t∩ addres≤ an∙ disδ filσ o≥ logica∞ device¼á sucΦ a≤ thσ ì
  242. keyboarΣ o≥ screen.
  243.  
  244.  
  245. Predefined Global Variables
  246.  
  247.      DP╠ declare≤ certaiε commoε variable≤ fo≥ thσ programmer« A≤ ì
  248. oµá thi≤á revision¼á thσ followinτá variable≤á arσá automaticall∙ ì
  249. declared:
  250.  
  251.      SE╘       STATUS,0░      ╗ 1╢ bi⌠ intege≥ whicΦ contain≤ thσ 
  252.                               ; return result of various reads
  253.                               ; and writes.
  254.      SE╘       ZERO,0░á       ╗ ┴ intege≥ácontaininτáßázer∩ value.
  255.      DEFINE    BEEP,07        ; ASCII Bell alarm (^G)
  256.      DEFINE    EJECT,12       ; ASCII Form Feed (^L)
  257.      SE╘á      @DPLVE╥        ╗ Curren⌠ versioε oµ DP╠ásuppor⌠
  258.                               ; routines
  259.      VIDPAGE   DB   ?         ; Current active video page
  260.      CRTFLAG   DB   ?         ; A byte indicating which video
  261.                               ; adapter is installed:
  262.                               ;   Monochrome    =  00
  263.                               ;   CGA card      =  01
  264.                               ;   EGA Mono emul =  02
  265.                               ;   EGA CGA emul  =  03.
  266.                               ; Bit 0 = Monochrome(0),CGA(1)
  267.                               ; Bit 1 = EGA(1)
  268.                               ; Bit 2 = VGA(not implemented yet)
  269.  
  270.    Thσá keyword¼á "STATUS"¼á i≤á maintaineΣ b∙ DP╠ t∩ returεá thσ ì
  271. resul⌠á oµ an∙ attempteΣ reaΣ o≥ writσ usinτ DOS«á Thσá followinτ ì
  272. error codes are returned in STATUS from IO:
  273.  
  274. 0 = All okay                        10 = Invalid environment
  275. 1 = End of File encountered         11 = Invalid format
  276. 2 = File not found                  12 = Invalid access code
  277. 3 = Path not found                  13 = Invalid data
  278. 4 = No handle available, all used   14 = not used
  279. 5 = Access denied                   15 = Invalid drive specified
  280. ╢ ╜ invaliΣ handlσ                  1╢ ╜ Attemp⌠ t∩ removσ
  281. 7 = Memory control block destroyed       directory
  282. ╕ ╜ Insufficien⌠ memor∙             17 = Not same device
  283. 9 = Invalid memory block address    1╕ ╜ N∩ morσ file≤ to be   
  284.                                          found                 
  285.  
  286. Iµá yo⌡ havσ no⌠ noticed¼á al∞ thσ returε codes¼á excep⌠ #1¼á arσ ì
  287. standarΣá DO╙ returε codes«á Codσ #▒ serve≤ ßá dua∞á purpose«á Iε ì
  288. read≤á anΣ writes¼á thi≤ valuσ woulΣ indicatσ aε EOF«á Iε openinτ ìèanΣá closinτ files¼á i⌠ retain≤ it≤ origina∞ DO╙á meaning«á Sincσ ì
  289. STATU╙á i≤á jus⌠ ß 1╢ bi⌠ integer¼á i⌠ ma∙ als∩ bσá useΣá b∙á thσ ì
  290. programmer¼ fo≥ example¼ t∩ holΣ ß returε codσ froφ ß subroutine.
  291.  
  292.  
  293. D E F I N E  --  pre-initialized string declaration
  294.  
  295.      DEFINE    msg0,'This is the first message declared'
  296.      DEFINE    BEEP,07
  297.      DEFINE    ESC_SEQ,<1BH,'[31;40m'>   ; ANSI.SYS ESC sequence
  298.  
  299.    Thσá datßá declaration¼á "DEFINEóá allow≤á thσá programme≥á t∩ ì
  300. declarσ ß strinτ witΦ ß pre-initializeΣ value«á Thi≤ strinτá wil∞ ì
  301. havσ it'≤ maximuφ lengtΦ determineΣ b∙ thσ lengtΦ oµ thσ message« ì
  302. Thσá seconΣ examplσ abovσ show≤ ho≈ t∩ declarσ ß onσ bytσá strinτ ì
  303. usinτ aε ASCII contro∞ characte≥ value«á Thσ lengtΦ oµ thσ strinτ ì
  304. wil∞á bσá thσ datß lengtΦ ½ 1«á Thσá DEFIN┼á macr∩á automaticall∙ ì
  305. provide≤ ß nul∞ bytσ a≤ ß strinτ terminator«á This¼ anΣ al∞ othe≥ ì
  306. datßá declarations¼á mus⌠á precedσá thσá "BEGINóá statement«á Thσ ì
  307. maximuφá lengtΦ i≤ determineΣ b∙ MASM's limitations.
  308.  
  309.  
  310. E N D R E C  --  End of record marker
  311.  
  312.           RECORD recname,length
  313.             STRING strname,length
  314.             INTEGER num
  315.           ENDREC recname
  316.  
  317.      Thσ ENDRE├ declaratioε mark≤ thσ enΣ oµ thσ datß record«á I⌠ ì
  318. i≤á useΣá iεá conjunctioεá witΦá thσá RECOR─á declaration«áá Thi≤ ì
  319. statemen⌠á mus⌠á alway≤ bσ useΣ t∩ terminatσ ß recorΣá t∩á insurσ ì
  320. correc⌠ memor∙ allocatioε fo≥ thσ entirσ record«á This¼á anΣá al∞ ì
  321. othe≥ datß declarations¼ mus⌠ precedσ thσ "BEGINó statement.
  322.  
  323.  
  324. F I L E  --  Define a file device
  325.  
  326.      FILE     CONSL,     'CON'
  327.      FILE     PRT,       'LPT1',       A
  328.      FILE     AFILE,     'WORK.DAT',   A,   BUFFA
  329.      FILE     DSKFIL,    'WORK.DAT',   B
  330.      FILE     BFILE,     'WORK.DAT',   B,   BUFFB
  331.      FILE     RNDFIL,    'WORK.DAT',   R,   RKEY
  332.  
  333.      BUFFER    BUFFA,512
  334.      BUFFER    BUFFB,512
  335.      INTEGER   RKEY
  336.  
  337.    Thσá filσ declaratioε set≤ u≡ ß filσ declaratioε fo≥ accessinτ ì
  338. DO╙ devices«á Thσ declaratioε come≤ iε fivσ parts║ 1⌐ thσ keyworΣ ì
  339. FILE¼á 2⌐á thσá interna∞á namσ oµ thσ devicσ t∩ bσá useΣá b∙á thσ ì
  340. program¼ 3⌐ thσ externa∞ ASCII┌ strinτ namσ giveε t∩ DO╙ wheε thσ ì
  341. filσá i≤á opened¼á 4⌐á thσá devicσ class¼á anΣ 5⌐á ßá buffe≥á fo≥ ì
  342. sequentia∞ files¼á o≥ recorΣ KE┘ fo≥ randoφ files«á Thσ differen⌠ ìèpart≤á arσ separateΣ b∙ commas«á Thσ devicσ clas≤á indicate≤á thσ ì
  343. typσ oµ datß expecteΣ t∩ bσ writteε o≥ reaΣ froφ thσ device/file« ì
  344. Thσá fou≥á classe≤ arσ "Aó fo≥ ASCII¼á "Bó fo≥á binary¼á "Róá fo≥ ì
  345. randoφ access¼ anΣ defaul⌠ fo≥ characte≥ device≤ (defaul⌠ assume≤ ì
  346. variablσ lengtΦ ASCII)« Thσ file≤ classes¼ "A"¼ "B"¼ anΣ default¼ ì
  347. arσáá sequentia∞áá acces≤á files«áá Buffer≤á oµá 25╢á byte≤áá arσ ì
  348. automaticall∙ declareΣ fo≥ "Aó anΣ "Bó filσ types« Thσ programme≥ ì
  349. ma∙á declarσ differen⌠ buffer≤ fo≥ filσ classe≤ "Aó anΣá "B"¼á a≤ ì
  350. seeεá iεá thσá abovσ example≤ fo≥ "AFILEó anΣá "BFILE"«á Thi≤á i≤ ì
  351. useful¼á fo≥á examplσá t∩ speedu≡ disδ I/╧á b∙á declarinτá large≥ ì
  352. buffers¼ thu≤ requestinτ fewe≥ read≤ froφ DOS.
  353.      NOTE!!íá Thσ buffe≥ sizσ represent≤ thσ larges⌠ singlσ piecσ ì
  354. oµ datß whicΦ ma∙ bσ reaΣ froφ thσ file╗á therefore¼á iε orde≥ t∩ ì
  355. reaΣ string≤ o≥ record≤ ove≥ 25╢ byte≤ iε length¼á thσ programme≥ ì
  356. MUS╘á providσ ß buffe≥ a⌠ leas⌠ thσ sizσ oµ thσ larges⌠ strinτ o≥ ì
  357. recorΣ t∩ bσ reaΣ froφ that file.
  358.      Randoφá acces≤ file≤ havσ ß KE┘ declaration«á Thσ ke∙á i≤á ß ì
  359. namσ oµ aε intege≥ t∩ bσ useΣ iε recorΣ locatioε calculations« T∩ ì
  360. acces≤á ß giveε recorΣ iε ß randoφ file¼á pu⌠ thσ recorΣ locatioε ì
  361. numbe≥á int∩á thσá ke∙ theε reaΣ o≥ writσ t∩ thσá file«á Thσá ke∙ ì
  362. numbe≥á i≤ simila≥ iε functionalit∙ t∩ aεá array'≤á subscript«á ┴ ì
  363. gooΣá perspectivσá oµ ß randoφ filσ i≤ t∩ vie≈ i⌠ a≤ aε arra∙á oµ ì
  364. records¼á wherσá thσá ke∙á i≤ thσ subscrip⌠á t∩á thσá array«á Thσ ì
  365. followinτá codσ segmen⌠ show≤ ho≈ t∩ reaΣ thσ 5tΦ recorΣá froφá ß ì
  366. file:
  367.  
  368.      ;---------------╝áDATA VARIABLES >----------------
  369.  
  370.      FILE RFILE,'DATA.FIL',R,RKEY
  371.      INTEGER RKEY
  372.      ;
  373.      RECORD RREC,13
  374.        STRING STR,8
  375.        INTEGER NUM
  376.      ENDREC RREC
  377.  
  378.      ;---------------╝áCOD┼áEXECUTIO╬ >----------------
  379.  
  380.      RKEY = 5
  381.      READB RFILE,RREC
  382.      
  383.      ;-------------╝áEND COD┼áEXECUTIO╬ >--------------
  384.  
  385. Thσ subscrip⌠ t∩ thσ file¼á RKEY¼á i≤ se⌠ t∩ thσ valuσ oµ 5«á Thσ ì
  386. read or write can then be attempted by the program.
  387.  
  388.  
  389. I N T E G E R  --  16 bit integer declaration
  390.  
  391.      INTEGE╥ num0
  392.  
  393.    Thσá intege≥á declaratioεá set≤ u≡ ß 1╢ bi⌠ worΣ iεá thσá datß ì
  394. segmen⌠ withou⌠ ß predefineΣ value«á I⌠ i≤ initializeΣ t∩ zer∩ b∙ ì
  395. thσ macr∩ statement«á This¼ anΣ al∞ othe≥ datß declarations¼ mus⌠ ì
  396. precede the "BEGIN" statement.è
  397.  
  398. R E C O R D  --  File record declaration
  399.  
  400.           RECORD recname,length
  401.             STRING strname,length
  402.             INTEGER num
  403.           ENDREC recname
  404.  
  405.      Thi≤á declaratioε identifie≤ thσ "recnameó a≤ thσá beginninτ ì
  406. oµ ß datß record« Thσ abovσ examplσ show≤ ho≈ t∩ declarσ ß recorΣ ì
  407. witΦá onσá strinτá elemen⌠ anΣ onσ intege≥á element«á Thσá ENDRE├ ì
  408. statemen⌠ mus⌠ bσ addeΣ t∩ terminatσ thσ recorΣ declaration«á Seσ ì
  409. thσ sectioε oε ENDREC« Thσ lengtΦ giveε iε thσ RECOR─ declaratioε ì
  410. i≤á thσ tota∞ lengtΦ oµ al∞ variablσ element≤ withiε thσá record« ì
  411. STRIN╟á length≤á arσá alway≤ arσ ▒ greate≥á thaεá therσá declareΣ ì
  412. length«á INTEGER╙á arσ tw∩ byte≤ iε length«á RECORD≤ declaration≤ ì
  413. ma∙ no⌠ bσ nested«á This¼á anΣ al∞ othe≥ datß declarations¼á mus⌠ ì
  414. precedσáá thσá "BEGINóá statement«áá Seσá thσá sectioεá oεáá FIL┼ ì
  415. declarations for more on record size limitations.
  416.  
  417.  
  418. S E T  --  16 bit integer declaration
  419.  
  420.      SET     ONE,1
  421.      SET     X99,99
  422.  
  423.    Thσá SE╘ declaratioε set≤ u≡ ß signeΣ 1╢ bi⌠ worΣ witΦ ßá pre-ì
  424. defineΣ value« I⌠ i≤ identica∞ t∩ thσ INTEGE╥ declaration¼ excep⌠ ì
  425. thσ programme≥ supplie≤ aε initia∞ valuσ t∩ thσ word«á This¼á anΣ ì
  426. al∞ othe≥ datß declarations¼ mus⌠ precedσ thσ "BEGINó statement.
  427.  
  428.  
  429. S T R I N G  -- Undefined string declaration
  430.  
  431.      STRING    name,length
  432.      STRING    wor_string,132
  433.  
  434.    Thσá STRIN╟ declaratioε allow≤ thσ operato≥ t∩ declarσ ßá nul∞ ì
  435. string¼á ╪á numbe≥ oµ byte≤ iε length«á Thσ tota∞ lengtΦá oµá thσ ì
  436. strinτ i≤ thσ lengtΦ ½ 1«á This¼ anΣ al∞ othe≥ datß declarations¼ ì
  437. mus⌠á precedσá thσ "BEGINó statement«á Thσ maximuφ lengtΦ ma∙á bσ ì
  438. u≡ t∩ 64k¼á bu⌠ remember¼á DP╠ onl∙ provide≤ ON┼ datß segmen⌠á oµ ì
  439. u≡á t∩á 64k╗á therefore¼á sucΦá ß strinτ woulΣá fil∞á thσá entirσ ì
  440. segment«á Seσ thσ sectioε oε FIL┼ declaration≤ fo≥ morσ oε strinτ ì
  441. lengths.
  442. .paè         E X E C U T A B L E   I N S T R U C T I O N S
  443.  
  444.  
  445. C U R S O R  --  Move the video cursor.
  446.  
  447.      CURSOR     1,5
  448.      CURSOR     1,int
  449.      CURSOR     int,int
  450.      CURSOR     row,col
  451.  
  452.    Thi≤ instructioε move≤ thσ vide∩ curso≥ t∩ thσ X/┘á coordinatσ ì
  453. giveεá b∙ thσ parameters«á Thσ parameter≤ ma∙ bσ eithe≥ ß numeriπ ì
  454. litera∞ o≥ intege≥ iε an∙ combination«á Thσ valiΣ row≤ arσ ░ thr⌡ ì
  455. 24«á Thσ valiΣ column≤ arσ ░ thr⌡ 79« B∙ movinτ thσ curso≥ ou⌠ oµ ì
  456. thσ valiΣ range≤ effectivel∙ make≤ thσ cursor disappear.
  457.  
  458.  
  459. C A L L  -- DPL call with parameter passing in registers.
  460.  
  461.      CALL     routine param-1 param-2 param-3 param-4
  462.      CALL     CALC 05 NUM
  463.  
  464.      Thσá DP╠á pre-pas≤ compile≥ examine≤ eacΦ CAL╠ statemen⌠á iε ì
  465. thσ sourcσ filσ lookinτ fo≥ paramete≥ passinτ t∩ thσá subroutine« ì
  466. Parameter≤ ma∙ bσ listeΣ t∩ thσ righ⌠ oµ thσ subroutinσ namσ witΦ ì
  467. space≤á betweeεá eacΦ one«á Thσ parameter≤ passeΣ arσá placeΣá iε ì
  468. register≤á AX,BX,CX,D╪á respectively«á ▒á - ┤ parameter≤á ma∙á bσ ì
  469. passeΣ t∩ thσ subroutine«á NOTE║á Paramete≥ passinτ i≤ limiteΣ t∩ ì
  470. passinτ thσ ADDRES╙ oµ thσ variable¼á NO╘ thσ actua∞ valuσ oµ thσ ì
  471. variable«á Thi≤á differ≤ witΦ somσ commoε programminτá languages¼ ì
  472. sucΦ a≤ ├ anΣ PASCAL«á Sincσ DP╠ doe≤ no⌠ maintaiε tigh⌠á contro∞ ì
  473. ove≥á variablσá declarations¼á i⌠á doe≤ no⌠ kno≈á thσá differencσ ì
  474. betweeεá strinτá variablσá name≤á anΣá intege≥á variablσáá names╗ ì
  475. therefore¼á i⌠á applie≤ ß blanke⌠ rulσ oµ passinτ addresse≤ only« ì
  476. Litera∞áá value≤á arσá thσá exceptioεá anΣá arσá passeΣá t∩áá thσ ì
  477. subroutine«á Thσá litera∞á value≤ arσ limiteΣá t∩á aεá expressioε ì
  478. resultinτ iε ß 1╢ bi⌠ value.
  479.  
  480.  
  481. C L O S E  -- Close a file.
  482.  
  483.      CLOSE     file
  484.  
  485.   Thi≤ functioε close≤ ß previousl∙ openeΣ file«á Iµ thσ filσ wa≤ ì
  486. openeΣ fo≥ output¼á anΣ enΣ oµ filσ marδ i≤ writteε anΣ thσá filσ ì
  487. i≤ closed« Al∞ pertinen⌠ datß i≤ theε entereΣ int∩ thσ directory«  ì
  488. Iµ thσ filσ wa≤ openeΣ fo≥ input¼ thσ filσ wil∞ bσ closeΣ witΦ n∩ ì
  489. change≤ t∩ thσ directory«á Oncσ ß filσ i≤ closed¼á n∩ morσ acces≤ ì
  490. wil∞á bσ alloweΣ unti∞ i⌠ i≤ reopened«á Thσ appropriatσ DO╙ erro≥ ì
  491. codσ wil∞ returned in STATUS.
  492.  
  493. .paèD E C O D E  --  Convert decimal ASCIIZ string to signed binary
  494.                  integer format.
  495.  
  496.      DECODE     integer,string
  497.  
  498.    DECOD┼á wil∞ conver⌠ ß numeriπ ASCI╔ strinτ int∩ ßá signeΣá 1╢ ì
  499. bi⌠á intege≥á value«á Thσá valuσ wil∞ bσ storeΣ iεá thσá provideΣ ì
  500. integer«á Thσ conversioε wil∞ bσ madσ froφ lef⌠ t∩ righ⌠ anΣ wil∞ ì
  501. continuσá unti∞ ß noε numeriπ ASCI╔ characte≥ o≥ enΣ oµá linσá i≤ ì
  502. encountered« ValiΣ numeriπ ASCI╔ character≤ fal∞ withiε thσ rangσ ì
  503. oµ '0º - '9'«á ┴ negativσ sigε i≤ alloweΣ t∩ thσ righ⌠ o≥ lef⌠ oµ ì
  504. thσ numbers« Iµ ß non-numeriπ valuσ i≤ encountered¼ ┴ STATU╙ oµ ▒ ì
  505. wil∞ bσ returneΣ and the integer will be set to zero.
  506.  
  507.  
  508. E N C O D E  -- Convert signed binary integer to ASCIIZ
  509.                 decimal string.
  510.  
  511.      ENCODE     string,integer
  512.  
  513.    Thi≤á instructioεá wil∞ conver⌠ ß signeΣ 1╢ bi⌠ valuσ int∩á aε ì
  514. ASCII┌ strinτ representation« Thσ maximuφ lengtΦ oµ thσ converteΣ ì
  515. strinτ caε bσ ╢ characters¼á therefore╗ thσ targe⌠ strinτ mus⌠ bσ ì
  516. ßá minimuφ oµ ╢ character≤ iε orde≥ t∩ protec⌠ agains⌠ corruptinτ ì
  517. memor∙á followinτ thσ string«á Thσ actua∞ decima∞á representatioε ì
  518. createΣá b∙ ENCOD┼ ma∙ bσ les≤ thaε ╢ character≤ iεá length«á An∙ ì
  519. value over 32767 will be considered negative.
  520.   
  521.  
  522. G O T O  -- Unconditional jump.
  523.  
  524.      GOTO     addr
  525.  
  526.    Thσá GOT╧ commanΣ i≤ converteΣ int∩ aε 808╕ 'JMPº instruction« ì
  527. Thσá rangσ oµ thσ jum≡ wil∞ bσ intra-segment¼á unles≤ thσá targe⌠ ì
  528. addres≤ i≤ ß FA╥ type«á Therσ wil∞ no⌠ bσ an∙ checδ t∩ seσ iµ thσ ì
  529. targe⌠á addres≤á caε bσ reacheΣ b∙ ß shor⌠á jump«á Thi≤á forφá oµ ì
  530. optimization will normally be done by the assembler.
  531.  
  532.  
  533. H S T O I  -- Hex string to integer conversion.
  534.  
  535.      HSTOI     integer,string
  536.  
  537.    Thi≤á instructioε wil∞ conver⌠ ß HE╪ strinτ int∩ ßá signeΣá 1╢ ì
  538. bi⌠ binar∙ value«á Thσ conversioε wil∞ operatσ froφ lef⌠ t∩ righ⌠ ì
  539. anΣá wil∞ enΣ wheε ß non-he° characte≥ ("0"-"9"¼á o≥ "a"-"f"⌐á o≥ ì
  540. enΣ oµ linσ i≤ encountered.
  541.  
  542.  
  543. ╔á╞á -- Conditiona∞ jum≡ suppor⌠ fo≥ábyte¼áword¼áo≥
  544.         strinτ comparisons.
  545.  
  546.      IF BYTE   addr EQ addr GOTO addr
  547.      IF BYTE   addr LT addr CALL addr param param param paramè     IF BYTE   addr EQ addr RETURN
  548.      IF WORD   addr LE addr GOTO addr
  549.      IF WORD   addr NE addr CALL addr param param
  550.      IF WORD   addr EQ addr RETURN
  551.      IF STRING addr EQ addr GOTO addr
  552.      IF STRING addr NE addr CALL addr param param param param
  553.      IF STRING addr EQ addr RETURN
  554.  
  555.   Thσá DP╠á I╞ statemen⌠ give≤ thσ programme≥ thσá capabilit∙á t∩ ì
  556. makσ comple° comparisoε witΦ ease«á Thσ I╞ statement≤ cove≥ ever∙ ì
  557. typσ oµ comparisoε anΣ condition« ┴ truσ resul⌠ t∩ thσ comparisoε ì
  558. alway≤á result≤ iε ß changσ t∩ thσ prograφ counter«á Thσ instruc-ì
  559. tioε followinτ thσ  comparison¼á GOTO¼á CALL¼á o≥ RETUR╬ arσá al∞ ì
  560. standarΣá DP╠ instructions«á Seσ eacΦ sectioε fo≥ detail≤ oεá thσ ì
  561. synta° oµ eacΦ oµ thσ instructions.
  562.   Thσá I╞á statement≤ allo≈ ß ful∞ rangσ oµ test≤ t∩ bσ madσá fo≥ ì
  563. intege≥á comparisons«á Strinτ comparison≤ arσ limiteΣ t∩ "EQóá o≥ ì
  564. "NEó tests« The following is a explanation of each comparison:
  565.  
  566.      NE - Not equal to
  567.      LT - Less than
  568.      LE - Less than or equal to
  569.      EQ - Equal to
  570.      GE - Greater than or equal to
  571.      GT - Greater than
  572.  
  573.  
  574. I N K E Y  --  Scan the keyboard for one character
  575.  
  576.      INKEY
  577.      INKEY     str
  578.      INKEY     str,WAIT
  579.      INKEY     ,WAIT
  580.  
  581.    Thi≤á instruction≤á use≤ thσ BIO╙ keyboarΣá interrup⌠á 16╚á t∩ ì
  582. retrievσá ß typeΣ key«á A≤ thσ abovσ example≤á show¼á thσá targe⌠ ì
  583. strinτá i≤á optional«á Thσá returneΣ valuσ i≤ storeΣá iεá thσá A╪ ì
  584. registe≥á upoεá returε froφ thσ BIO╙ call.
  585.      Thσá firs⌠á tw∩ example≤ wil∞ no⌠ sto≡ thσ executioε oµá thσ ì
  586. program¼á whereas╗á thσá las⌠ tw∩ example≤ wai⌠ fo≥ ß ke∙á t∩á bσ ì
  587. typed« Thσ DP╠ keyworΣ STATU╙ wil∞ bσ se⌠ t∩ ▒ iµ ß ke∙ i≤ found¼ ì
  588. otherwise╗á i⌠á wil∞á bσ se⌠ t∩ 0«á Thσ targe⌠ strinτ mus⌠á bσá ß ì
  589. minimuφ oµ ▓ byte≤ long« Tw∩ byte≤ wil∞ bσ returneΣ froφ thσ BIO╙ ì
  590. anΣá storeΣá iε thσ string«á Thσ firs⌠ bytσ wil∞ bσ thσá "normaló ì
  591. key¼ sucΦ a≤ thσ lette≥ "A"« Iε thi≤ casσ thσ seconΣ bytσ wil∞ bσ ì
  592. reporteΣ a≤ ß binar∙ zero«á Thσ seconΣ bytσ reporteΣ i≤ thσá scaε ì
  593. code«á Iµá thσá ke∙ wa≤ ß functioε key¼á thσ firs⌠ bytσá wil∞á bσ ì
  594. binar∙ zero¼ anΣ thσ seconΣ bytσ wil∞ bσ thσ scaε code.
  595.  
  596. .paèI T O B S  --  Convert binary integer to Binary string 
  597.  
  598.      ITOBS     string,integer,length
  599.      ITOBS     string,0255h,8
  600.  
  601.    Thi≤á commanΣ convert≤ ß 1╢ bi⌠ intege≥ int∩ ß strinτ oµá "0"≤ ì
  602. anΣ "1"≤ fo≥ ß binar∙ representation« Thσ lengtΦ oµ thσ strinτ i≤ ì
  603. determineΣ b∙ thσ lengtΦ declaration«á A≤ aε example¼ iµ jus⌠ thσ ì
  604. leas⌠á significan⌠á bytσ oµ thσ 1╢ bi⌠ worΣ i≤ t∩á bσá converted¼ ì
  605. jus⌠ givσ thσ instructioε aε ╕ bytσ lonτ length«á Thσ intege≥ ma∙ ì
  606. bσ ß address o≥ ß litera∞ value.
  607.  
  608.  
  609. I T O H S  --  Convert binary integer to ASCII hex string
  610.  
  611.      ITOHS     string,integer
  612.      ITOHS     string,0256
  613.  
  614.     Thi≤á commanΣ wil∞ takσ ß 1╢ bi⌠ intege≥ valuσ aε creatσ ßá ┤ ì
  615. bytσá he° string«á Thσ targe⌠ strinτ mus⌠ bσ ß minimuφ oµ ┤ byte≤ ì
  616. iε length¼ o≥ ß memory overrun will occur.
  617.  
  618.  
  619. ═ ┴ ╘ ╚ -- DP╠ámatΦ routine≤áfo≥áarithmeticáanΣ Boolean
  620.            expressioε evaluation
  621.  
  622.      result = int * 05 + int / 2 - 3 SHL 2 MOD 256
  623.  
  624.    DP╠ provide≤ fo≥ signeΣ 1╢ bi⌠ mathematica∞ expression≤ witΦ ß ì
  625. simplσ lef⌠ t∩ righ⌠ evaluation«á Thσ lengtΦ oµ thσ expressioε i≤ ì
  626. limiteΣá t∩á ß maximuφ strinτ oµ 13▓á characters«á Thσá followinτ ì
  627. mathematical operations are valid:
  628.  
  629.           *    Multiplication      /    Division
  630.           +    Addition            -    Subtraction
  631.           AND  Logical And         OR   Logical OR
  632.           XOR  Exclusive OR        SHL  Shift left
  633.           SHR  Shift Right         MOD  Remainder
  634.  
  635.  
  636. N O T E  -- Note the current file pointer.
  637.  
  638.      NOTE     file,dd
  639.  
  640.    Thi≤á instructioε retrieve≤ thσ curren⌠ filσ pointe≥ froφá thσ ì
  641. specifieΣá filσ anΣ store≤ i⌠ iε thσ specifieΣ 3▓ bi⌠á lonτá worΣ ì
  642. storage«á Thi≤á instructioε i≤ useΣ iε conjunctioε witΦ thσ POIN╘ ì
  643. instructioεá t∩á creatσá ßá limiteΣ forφá oµá randoφá acces≤á fo≥ ì
  644. sequentia∞á disδá files«áá B∙á "NOTE"inτá ßá file¼áá theεá later¼ ì
  645. "POINT"inτ t∩ it¼ datß ma∙ bσ rereaΣ o≥ rewritten.
  646.  
  647. .paèO P E N  -- Open a file
  648.  
  649.      OPEN     INPUT, file
  650.      OPEN     OUTPUT, file
  651.      OPEN     IO, file
  652.  
  653.    DP╠á use≤ thσ DO╙ filσ handlσ methoΣ oµ filσ control«á Wheεá ß ì
  654. filσá i≤ opened¼á DO╙ return≤ ß handlσ whicΦ wil∞á bσá associateΣ ì
  655. witΦ tha⌠ filσ unti∞ i⌠ i≤ CLOSED«á Thσ allowablσ mode≤ oµ acces≤ ì
  656. fo≥ file≤ arσ INPUT¼ OUTPUT¼ or¼ IO.
  657.    Iε orde≥ t∩ acces≤ an∙ oµ thσ computer≤ devices¼á usinτ ß filσ ì
  658. i≤ thσ easies⌠ method« Thσ logica∞ devicσ fo≥ thσ screen/keyboarΣ ì
  659. ('CON'⌐á ma∙á bσ openeΣ a≤ INPUT¼á OUTPUT¼á o≥á IO«á Thσá printe≥ ì
  660. ('LPTx'⌐á woulΣ bσ openeΣ a≤ OUTPUT«
  661.    Iµ ß disδ filσ i≤ openeΣ a≤ IO¼á DP╠ attempt≤ t∩ opeε thσ filσ ì
  662. withou⌠á resettinτá thσá filσ pointer«á Thi≤ i≤ donσá s∩á no⌠á t∩ ì
  663. destro∙ an∙ datß iε thσ file«á Iµ thσ filσ i≤ no⌠ found¼ theε DP╠ ì
  664. wil∞ creatσ thσ file.
  665.    Iµá ß filσ i≤ openeΣ a≤ OUTPUT¼á DP╠ wil∞ opeε o≥á creatσá thσ ì
  666. file¼á theεá rese⌠ thσ filσ pointe≥ t∩ thσ beginninτ oµ thσ file¼ ì
  667. thu≤á clearinτ an∙ datß froφ thσ file«á Wheε thσ filσ i≤á closed¼ ì
  668. thσá director∙ entr∙ i≤ modifieΣ t∩ reflec⌠ thσ las⌠ update¼á anΣ ì
  669. curren⌠ size.
  670.    Wheε readinτ files¼á duσ t∩ thσ sequentia∞ acces≤á method¼á i⌠ ì
  671. ma∙ bσ necessar∙ t∩ star⌠ readinτ froφ thσ beginning« Thi≤ ma∙ bσ ì
  672. accomplisheΣá b∙ closing¼á theε re-openinτ thσ file«á Thi≤ reset≤ ì
  673. thσ filσ pointer≤ t∩ thσ beginninτ oµ the file.
  674.   DP╠ provide≤ fo≥ erro≥ code≤ t∩ bσ returneΣ t∩ thσá applicatioε ì
  675. througΦá thσá STATU╙á integer«áá Thi≤á intege≥á i≤á automaticall∙ ì
  676. declareΣá b∙á DP╠á anΣ i≤ se⌠ t∩ thσ resultinτ MS-DO╙á valuσá fo≥ ì
  677. openinτ ß file«á Consul⌠ aε MS-DO╙ manua∞ fo≥ thσ returneΣ value≤ ì
  678. fo≥ Functioε 3Dh« Thesσ value≤ wil∞ be returned in STATUS.
  679.  
  680.  
  681. P O I N T  --  Point to a location in the file.
  682.  
  683.      POINT     file,dd
  684.  
  685.      Thi≤á instructioεá move≤á thσ filσ pointe≥á t∩á ßá specifieΣ ì
  686. locatioε iε thσ file«  POIN╘ i≤ useΣ iε conjunctioε witΦ thσ NOT┼ ì
  687. instructioεá t∩á creatσá ßá limiteΣ forφá oµá randoφá acces≤á fo≥ ì
  688. sequentia∞ disδ files«á POIN╘ ha≤ aε identica∞ counterpar⌠ iε thσ ì
  689. ├ programminτ language¼ "LSEEK"« B∙ "NOTE"inτ ß file¼ theε later¼ ì
  690. "POINT"inτ t∩ it¼ datß ma∙ bσ rereaΣ o≥ rewritten« Applicablσ DO╙ ì
  691. error codes are returned in STATUS.
  692.  
  693. .PAèR E A D  -- Read a variable length ASCII string from an opened
  694.             file
  695.  
  696.      READ      file,string,length
  697.  
  698.    Thi≤ commanΣ read≤ datß froφ ß device/filσ anΣ place≤ thσ datß ì
  699. iε thσ string«á Thσ maximuφ amoun⌠ datß reaΣ i≤ determineΣ b∙ thσ ì
  700. "lengthó iε thσ statement«á Thσ strinτ ma∙ bσ shorte≥ iµ aε CR/L╞ ì
  701. i≤á encountereΣá durinτá thσ read«á Iµ aεá erro≥á occur≤á iεá thσ ì
  702. attempteΣ read¼ thσ DO╙ erro≥ codσ wil∞ bσ returneΣ iε STATUS.
  703.  
  704.  
  705. R E A D B  -- Read a fixed number of bytes from an opened file
  706.  
  707.      READB     file,record
  708.  
  709.    Thi≤ commanΣ read≤ datß froφ ß device/filσ anΣ place≤ thσ datß ì
  710. iε thσ record.á Thσ maximuφ amoun⌠ datß reaΣ i≤ determineΣ b∙ thσ ì
  711. lengtΦ oµ thσ record«á Thi≤ instructioε mus⌠ bσ useΣ t∩ reaΣ froφ ì
  712. "Bóá anΣá "Ró typσ oµ files«á Thσ norma∞ REA─ wil∞á no⌠á worδá oε ì
  713. binar∙á anΣá randoφ files«á Iµ aε erro≥ occur≤ iεá thσá attempteΣ ì
  714. read¼ thσ DO╙ erro≥ codσ wil∞ bσ returneΣ iε STATUS.
  715.  
  716.  
  717. R E T U R N  --  Subroutine return statement
  718.  
  719.      RETURN
  720.  
  721.    Thi≤ statemen⌠ i≤ identica∞ t∩ thσ returε statemen⌠ iεá nativσ ì
  722. 808╕ code«á I⌠ ma∙ bσ useΣ b∙ itself¼á o≥ iε aε I╞ statement« Thσ ì
  723. followinτ subroutinσ demonstrate≤ it'≤ use:
  724.  
  725.      SUB     PROC   NEAR
  726.           IF WORD FLAG EQ ZERO RETURN
  727.           .
  728.           .
  729.           RETURN
  730.      SUB     ENDP
  731.  
  732.  
  733. S T O P  -- Terminate the program's execution
  734.  
  735.      STOP
  736.      STOP     1
  737.      STOP     int
  738.  
  739.    Thi≤á instructioε give≤ contro∞ bacδ t∩ DO╙ anΣ als∩ allow≤á ß ì
  740. completioεá codσá t∩ bσ se⌠ iε DOS«á Thσ completioε codσá caεá bσ ì
  741. testeΣ witΦ thσ "ERRORLEVELó DO╙ command«á Also¼á thσ codσ caε bσ ì
  742. retrieveΣ b∙ anothe≥ prograφ froφ DOS« Thσ codσ ma∙ bσ ß literal¼ ì
  743. o≥á intege≥á variable«á Jus⌠á thσ leas⌠ significan⌠ bytσá oµá thσ ì
  744. completioε codσ wil∞ bσ returneΣ t∩ DOS.
  745.  
  746. .paèS T R I N G   C O N C A T E N A T I O N
  747.  
  748.      str0 $= str1 + str2 + str3 + str4 + str5
  749.  
  750.    DP╠ allow≤ string≤ t∩ bσ concatenateΣ togethe≥ anΣ thσá resul⌠ ì
  751. placeΣ int∩ ß targe⌠ string«á Thσ synta° i≤ almos⌠ identica∞ t∩ ß ì
  752. mathematica∞á expressioε excep⌠ fo≥ tw∩ things║á 1⌐ Onl∙ thσ plu≤ ì
  753. sigεá ("+"⌐ i≤ alloweΣ iε thσ expression¼á anΣ 2⌐ iε lie⌡ oµá thσ ì
  754. equa∞á sign¼á ßá specia∞á equatσ symbo∞ pair¼á "$=óá i≤á useΣá t∩ ì
  755. designatσ strinτ concatenation.
  756.  
  757.  
  758. W R I T E  --  Write an ASCIIZ string to an opened file
  759.  
  760.      WRITE     file,string
  761.      WRITE     file,string,CR
  762.      WRITE     file,,CR
  763.  
  764.    Thi≤ statemen⌠ allow≤ thσ programme≥ t∩ writσ datß ou⌠ t∩á an∙ ì
  765. device/file«á Iµá thσá keyworΣá C╥á (a≤ showεá iεá thσá las⌠á tw∩ ì
  766. examples⌐ i≤ given¼á theε ß CR/L╞ wil∞ bσ appendeΣ t∩ thσ output« ì
  767. Thσá thirΣ examplσ show≤ ho≈ ß CR/L╞ caε bσ accomplisheΣá withou⌠ ì
  768. firs⌠á printinτá ß string«á Iµ thσ programme≥ want≤ t∩á prin⌠á aε ì
  769. integer¼á theε thσ intege≥ wil∞ firs⌠ havσ t∩ bσ converteΣ int∩ ß ì
  770. string¼ theε printed.
  771.  
  772.  
  773. W R I T E B  --  Write a record to an opened file
  774.  
  775.      WRITEB    file,record
  776.  
  777.      Thi≤á instructioε write≤ thσ content≤ oµ thσ recorΣá ou⌠á t∩ ì
  778. thσá giveε file«á Thi≤ statemen⌠ mus⌠ bσ useΣ t∩ writσ t∩ "Bó anΣ ì
  779. "Ró typσ oµ files«á Thσ standarΣ WRIT┼ instructioε wil∞ no⌠á worδ ì
  780. oε binar∙ anΣ randoφ files«á Thσ appropriatσ DO╙ erro≥ code≤ wil∞ ì
  781. bσ returneΣ iε STATUS« 
  782.  
  783. .paè                    B i b l i o g r a p h y
  784.  
  785.      Thσ developmen⌠ oµ DP╠ ha≤ beeε evolvinτ fo≥ ove≥ tw∩ years« ì
  786. Admittedly¼á thσá directioεá ha≤á beeε oε thσ basi≤á oµá "╔á neeΣ ì
  787. this..."¼á anΣ "wouldn'⌠ i⌠ bσ nea⌠ if..."«á Iε othe≥ words¼á it≤ ì
  788. thσá produc⌠ oµ creepinτ enhancement¼á thougΦ thσá integrit∙á ha≤ ì
  789. beeε protecteΣ b∙ m∙ visioε oµ creatinτ ß soliΣ assembl∙ languagσ ì
  790. developmen⌠ environment«á Durinτ thσ coursσ oµ investigatioεá anΣ ì
  791. research¼á ╔ havσ reaΣ anΣ studieΣ man∙ publications¼á whicΦ havσ ì
  792. haΣ ß direc⌠ influencσ oε thi≤ endeavor«á Thσ followinτ i≤ ß lis⌠ ì
  793. oµ thσse publications:
  794.  
  795.  
  796. Borland International, Inc. TURBO C., 1987
  797.  
  798. IBM AT Technical Reference Manual. IBM Corp., 1985
  799.  
  800. IBM PC Technical Reference Manual. IBM Corp., 1983
  801.  
  802. Microsoft Macro Assembler. Microsoft, 1985
  803.  
  804. Osborne/McGraw Hill. Using TURBO C., 1988
  805.  
  806. Osborne/McGraw Hill. Advanced TURBO C., 1988
  807.  
  808. Duncan, Raymond. Advance MS-DOS. Microsoft Press, 1986
  809.  
  810. Coffron, James W. Programming the 8086/8088. SYBEX, 1983
  811.  
  812. Hyman, Michael I. Memory Resident Utilities, Interrupts,
  813.      and Disk Management with MS & PC DOS. MIS, 1986
  814.  
  815. Jourdain, Robert. Programmer's Problem Solver for the IBM
  816.      PC, XT & AT. Brady Communications Co. 1986
  817.  
  818. Kernighan, Brian W. & Ritchie, Dennis M. The "C"
  819.      Programming Language. Bell Telephone Labs, Inc. 1978
  820.  
  821. Norton, Peter. Programmer's Guild to the IBM PC.
  822.      Microsoft Press, 1985
  823.  
  824. Wadlow, Thomas A. Memory Resident Programming on the IBM PC.
  825.      Addison-Wesley Publishing Co., 1987
  826.  
  827. Young, Michael J. Performance Programming Under MS-DOS.
  828.      SYBEX, 1987
  829.