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 / MBUG / MBUG062.ARC / MENU.DOC < prev    next >
Text File  |  1979-12-31  |  6KB  |  116 lines

  1.                             DISK-MENU 
  2.  
  3.                       by Alan Sheehan B.E.
  4.  
  5.      DISK-MENU¼á a≤ thσ namσ suggests¼ i≤ ß MicroWorlΣ Basiπ disδ ì
  6. men⌡á program«á I⌠á automaticall∙ include≤ al∞á MicroWorlΣá Basiπ ì
  7. program≤á (.MWB⌐á anΣá machinσ languagσ program≤á oµá ßá specifiπ ì
  8. forma⌠á (.BE┼á files)«á Thσ intentioε i≤ t∩ makσ runninτá machinσ ì
  9. languagσ files¼ anΣ .MW┬ files¼ eas∙ enougΦ fo≥ kid≤ to use.
  10.  
  11.      Afte≥ typinτ iε thσ program¼ type:
  12.  
  13. >SAVE"MENU"
  14.  
  15.      Before running the program for the first time, type:
  16.  
  17. >OPEN "O",6,"MENU.DAT" : CLOSE 6
  18.  
  19.      Thi≤á create≤ aε empt∙ datß filσ fo≥ DISK-MEN╒ t∩ storσá thσ ì
  20. star⌠ addresse≤ fo≥ thσ .BE┼ files«á Machinσ languagσ program≤ oµ ì
  21. thσ .BE┼ filσ typσ requirσ tha⌠ thei≥ executσ addres≤ i≤ thσ samσ ì
  22. a≤ thei≥ star⌠ address«á i.e« The∙ wil∞ RU╬ properl∙ froφ ß RU╬ ═ ì
  23. FILENAME.BE┼á (addr⌐ command¼á wherσ (addr⌐ i≤ thσá start/executσ ì
  24. address.
  25.  
  26.      No≈á RU╬ thσ program«á Afte≥ ß shor⌠ pausσ thσ firs⌠ pagσ oµ ì
  27. thσ men⌡ wil∞ bσ displayed«á U≡ t∩ 3│ program≤ arσ displayeΣá pe≥ ì
  28. page«á Yo⌡á caε RU╬ an∙ oµ thesσ b∙ enterinτ it≤ men⌡ numbe≥á anΣ ì
  29. pressinτ <RETURN>« Fou≥ othe≥ option≤ arσ als∩ available« Yo⌡ ma∙ ì
  30. exi⌠á thσá prograφ t∩ BASI├ b∙ enterinτ B¼á o≥ t∩ thσá SYSTE═á b∙ ì
  31. enterinτ S«á Iµ thσ men⌡ i≤ longe≥ thaε ▒ pagσ (>3│ programs⌐ thσ ì
  32. Nex⌠ pagσ caε bσ displayeΣ b∙ enterinτ N¼á o≥ thσ previou≤ onσ b∙ ì
  33. using P.
  34.  
  35.      Thσáá prograφá work≤á b∙á usinτá ßá smal∞á machinσá languagσ ì
  36. subroutinσá t∩á interfacσ witΦ CP/M«á Thi≤ i≤ pokeΣá int∩á memor∙ ì
  37. startinτ a⌠ 4╕ decima∞ iε line≤ 70░ t∩ 720«á Linσ 73░ jus⌠á make≤ ì
  38. surσá tha⌠ thσ correc⌠ addres≤ fo≥ thσ disδ DM┴ buffe≥ i≤ sen⌠ t∩ ì
  39. CP/M«á Thi≤ buffe≥ i≤ useΣ t∩ holΣ thσ disδ director∙ onσá secto≥ ì
  40. a⌠á ß time¼á wheε ß valiΣ prograφ filenamσ i≤ found«á Thσ presen⌠ ì
  41. locatioεá oµá thσ buffe≥ coincide≤ witΦ thσ locatioεá oµá BASIC'≤ ì
  42. cassettσ buffe≥ a⌠ 300╚ (76╕ decimal)« Thσ ambiguou≤ filenamσ fo≥ ì
  43. eacΦá searcΦá i≤ constructeΣ iε line≤ 17░ anΣ 19░ anΣ pokeΣá int∩ ì
  44. thσá Filσá Contro∞ Blocδ a⌠ locatioε 9▓ decima∞ b∙ line≤á 76░á t∩ ì
  45. 780«á Line≤ 79░ t∩ 88░ searcΦ thσ disδ director∙ fo≥á appropriatσ ì
  46. file≤á anΣá build≤á u≡á thσ filσ name≤á characte≥á b∙á character¼ ì
  47. omittinτá space≤á (thσá RU╬á ═ commanΣá doesn'⌠á likσá space≤á iε ì
  48. filenames)« Iµ thσ resul⌠ oµ thσ US╥ cal∞ t∩ thσ machinσ languagσ ì
  49. routinσá i≤ 25╡ i⌠ mean≤ n∩ (more⌐ file≤ werσ founΣ matchinτá thσ ì
  50. searcΦá filename«á Als∩ iε linσ 84░ eacΦ characte≥ i≤ ANDeΣá witΦ ì
  51. 12╖ s∩ tha⌠ al∞ character≤ havσ thσ mos⌠ significan⌠ bi⌠ rese⌠ t∩ ì
  52. 0« Thi≤ i≤ necessar∙ becausσ CP/═ set≤ thσ MS┬ higΦ (t∩ 1⌐ oε thσ ì
  53. firs⌠á characte≥ oµ thσ extensioε iµ thσ filσ i≤ REA─á ONLY¼á anΣ ì
  54. BASI├ doesn'⌠ likσ t∩ adΣ character≤ witΦ asciΘ value≤ ╛ 12╖ int∩ ì
  55. strings.
  56.  
  57.      Line≤ 20░ t∩ 30░ displa∙ thσ men⌡ oµ filename≤ oε thσ screeε ì
  58. iε threσ columns¼á onσ pagσ a⌠ ß time« Iµ thσ men⌡ i≤ longe≥ thaε ì
  59. onσá page¼á thσ option≤ t∩ flicδ througΦ thσ page≤áareá displayeΣ ì
  60. (linσá 290)«á Linσá 31░á determine≤á thσ numeriπá VALuσá oµá you≥ ìèselectioε a≤ botΦ numeriπ anΣ alphß inpu⌠ mus⌠ bσ acceptable«á Iµ ì
  61. thσá inpu⌠ i≤ alphabetiπ o≥ negativσ (invalid⌐ thσ prograφá jump≤ ì
  62. t∩á linσ 52░ fo≥ furthe≥ testinτ oµ thσ inpu⌠á string«á There¼á ß ì
  63. SEARC╚á functioεá i≤ useΣ iε conjunctioε witΦá thσá O╬á ..«á GOT╧ ì
  64. structurσá s∩ tha⌠ an∙ invaliΣ inpu⌠ cause≤ thσ prograφ t∩ simpl∙ ì
  65. re-displa∙ thσ men⌡ b∙ jumpinτ t∩ linσ 230« (Iµ thσ inpu⌠ string¼ ì
  66. S0$¼á i≤á no⌠ founΣ iε "BbSsNnPpó thσ resul⌠ oµ thσ SEARC╚ i≤á 0¼ ì
  67. theε adΣ ▒ t∩ poin⌠ t∩ thσ linσ numbe≥ iε thσ lis⌠ t∩ jum≡ to...« ì
  68. firs⌠ iε thσ lis⌠ i≤ 230!)« Linσ 60░ prepare≤ t∩ displa∙ thσ nex⌠ ì
  69. pagσ oµ thσ menu¼ linσ 64░ prepare≤ t∩ displa∙ thσ previou≤ page¼ ì
  70. bu⌠ onl∙ iµ the∙ exist.
  71.  
  72.      Iµá onσ oµ thσ program≤ wa≤ selecteΣ (o≥ an∙ positivσ numbe≥ ì
  73. entered⌐á thσ prograφ passe≤ througΦ linσ 320«á Here¼á thσá arra∙ ì
  74. valuσá oµá thσ filenamσ i≤ calculateΣ anΣ an∙ invaliΣ value≤á arσ ì
  75. deal⌠ with«á Linσ 33░ use≤ thσ SEARC╚ functioε agaiε t∩ finΣá thσ ì
  76. perioΣá betweeεá thσ filenamσ anΣ thσ extensioε anΣ tes⌠á iµá thσ ì
  77. prograφá i≤ ß MicroWorlΣ BASI├ prograφ (.MWB)«á Iµ i⌠ is¼á i⌠á i≤ ì
  78. RUN«á Iµá thσ prograφ i≤ no⌠ ß .MWB¼á line≤ 36░ t∩ 41░ searcΦ thσ ì
  79. datß file¼á MENU.DAT¼ fo≥ thσ program'≤ start/exeπ address« Iµ i⌠ ì
  80. i≤ found¼á thσ prograφ jump≤ t∩ linσ 48░ t∩ RU╬ ═ thσ program« Iµ ì
  81. thσ start/exeπ addres≤ i≤ no⌠ founΣ iε MENU.DAT¼ line≤ 44░ t∩ 47░ ì
  82. promp⌠ thσ use≥ fo≥ thσ address¼á theε storσ i⌠ fo≥ usσ nex⌠ timσ ì
  83. beforσ RUNninτ thσ program.
  84.  
  85.      DISK-MEN╒áá i≤áá ideall∙á suiteΣá t∩á disk≤á oµá game≤áá anΣ ì
  86. educationa∞ program≤ whicΦ kid≤ and/o≥ visitor≤ ma∙ use¼á becausσ ì
  87. star⌠á addresse≤ fo≥ .BE┼ file≤ don'⌠ neeΣ t∩ bσ remembereΣá oncσ ì
  88. DISK-MEN╒ know≤ them«á I⌠ als∩ make≤ lifσ easie≥ fo≥ thσ hardcorσ ì
  89. compute≥ game≤ freak≤ amongs⌠ us¼á a≤ i⌠ i≤ easie≥ t∩ typσ ßá tw∩ ì
  90. digi⌠á numbe≥á correctl∙ thaε ß completσá filename«á 128╦á systeφ ì
  91. user≤á caε eveε makσ i⌠ aut∩ executσ (bu⌠ tha⌠ won'⌠ bσ discusseΣ ì
  92. here).
  93.  
  94.      Iµ yo⌡ havσ ß doublσ disδ drivσ system¼ yo⌡ ma∙ likσ t∩ makσ ì
  95. thσá followinτ modification≤ t∩ allo≈ yo⌡ t∩ leavσ DISK-MEN╒á anΣ ì
  96. MENU.DA╘á oε thσ disδ iε you≥ A║á drivσ anΣ stil∞ ge⌠ ßá men⌡á oµ ì
  97. what's on your B: drive.
  98.  
  99. 0010░ RE═ DISK-MEN╒ v3.01 b∙ Alaε Sheehaε B.E« 27/10/85.
  100.  
  101. 0014░ CLS:CUR╙ 24,5:PRINT"DISK-MEN╒ v3.01"
  102. 0015░ CUR╙ 17,8:PRINT"b∙ Alaε Sheehaε B.E« 27/10/85."
  103.  
  104.      (Inser⌠ thσ followinτ ▓ lines)
  105.  
  106. 0015▒ CUR╙ 16,11:INPUT"Ente≥ Disδ Drivσ Namσ (A,B,C..):"D0$:RE═ ge⌠ disδ drivσ name
  107. 0015▓ I╞ D0$="ó ║ D0$="A"
  108.  
  109. 0016░ V=(ASC(D0$⌐ AN─ 95)-64:I╞ V<▒ O╥ V>1╢ THE╬ PLA┘ 23║ GOT╧ 151
  110.  
  111. 0040░ I╞ F1$(;3,LEN(F1$))=F2ñ THE╬ IN#0:OUT#0:CLOS┼ 6:GOT╧ 480:RE═ addres≤ found
  112.  
  113. 0047░ OUT#6:PRIN╘ F1$(;3,LEN(F1$))","A:OUT#0:CLOS┼ 6
  114.  
  115. 0080░ C=C+1:F0$(C)=D0$(;1,1)+":":RE═ includσ drivσ iε name
  116.