home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1985 June / Ahoy_Magazine_85-06_1985_Double_L.d64 / flankspeed (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  3KB  |  116 lines

  1. 5 poke53280,12:poke53281,11
  2. 6 print"[147][155]               flankspeed               ";
  3. 10 print"     mistakeproof ml entry program      "
  4. 15 print"         created by g. f. wheat         "
  5. 20 print"   copr. 1984, ion international inc.   "
  6. 30 fora=54272to54296:pokea,0:next
  7. 40 poke54272,4:poke54273,48:poke54277,0:poke54278,249:poke54296,15
  8. 70 fora=680to699:readb:pokea,b:next
  9. 75 data169,251,166,253,164,254,32,216,255,96
  10. 76 data169,0,166,251,164,252,32,213,255,96
  11. 80 b$="starting address in hex":gosub2010:ad=b:sr=b
  12. 85 gosub2520:ifb=0then80
  13. 86 poke251,t(4)+t(3)*16:poke252,t(2)+t(1)*16
  14. 90 b$="ending address in hex":gosub2010:en=b
  15. 95 gosub2510:ifb=0then80
  16. 96 poke254,t(2)+t(1)*16:b=t(4)+1+t(3)*16
  17. 97 ifb>255thenb=b-255:poke254,peek(254)+1
  18. 98 poke253,b:print
  19. 100 rem  get hex line
  20. 110 gosub3010:print": [175][157]";:fora=0to8
  21. 120 forb=0to1:goto210
  22. 125 nextb
  23. 130 a%(a)=t(1)+t(0)*16:ifad+a-1=enthen310
  24. 135 print" [175][157]";
  25. 140 nexta:t=ad-(int(ad/256)*256):print" "
  26. 150 fora=0to7:t=t+a%(a):ift>255thent=t-255
  27. 160 next
  28. 170 ifa%(8)<>tthengosub1010:goto110
  29. 180 fora=0to7:pokead+a,a%(a):next:ad=ad+8:goto110
  30. 200 rem    get hex input
  31. 210 geta$:ifa$=""then210
  32. 211 ifa$=chr$(20)then270
  33. 212 ifa$=chr$(133)then4000
  34. 213 ifa$=chr$(134)then4100
  35. 214 ifa$=chr$(135)thenprint" ":goto4500
  36. 215 ifa$=chr$(136)thenprint" ":goto4700
  37. 220 ifa$>"@"anda$<"g"thent(b)=asc(a$)-55:goto250
  38. 230 ifa$>"/"anda$<":"thent(b)=asc(a$)-48:goto250
  39. 240 gosub1100:goto210
  40. 250 printa$"[175][157]";
  41. 260 goto125
  42. 270 ifa>0then280
  43. 272 a=-1:ifb=1then290
  44. 274 goto140
  45. 280 ifb=0thenprintchr$(20);chr$(20);:a=a-1
  46. 285 a=a-1
  47. 290 printchr$(20);:goto140
  48. 300 rem last line
  49. 310 print" ":t=ad-(int(ad/256)*256)
  50. 320 forb=0toa-1:t=t+a%(b):ift>255thent=t-255
  51. 330 next
  52. 340 ifa%(a)<>tthengosub1010:goto110
  53. 350 forb=0toa-1:pokead+b,a%(b):next
  54. 360 print:print"you are finished!":goto4000
  55. 1000 rem bell and error messages
  56. 1010 print:print"line entered incorrectly":print:goto1100
  57. 1020 print:print"input a 4 digit hex value!":goto1100
  58. 1030 print:print"ending is less than starting!":b=0:goto1100
  59. 1040 print:print"address not within specified range!":b=0:goto1100
  60. 1050 print:print"not zero page or rom!":b=0:goto1100
  61. 1060 print"?error in save":goto1100
  62. 1070 print"?error in load":goto1100
  63. 1080 print:print:print"end of ml area":print
  64. 1100 poke54276,17:poke54276,16:return
  65. 1200 open15,8,15:input#15,a,a$:close15:printa$:return
  66. 2000 rem get four digit hex
  67. 2010 print:printb$;:inputt$
  68. 2020 iflen(t$)<>4thengosub1020:goto2010
  69. 2040 fora=1to4:a$=mid$(t$,a,1):gosub2060:ift(a)=16thengosub1020:goto2010
  70. 2050 next:b=(t(1)*4096)+(t(2)*256)+(t(3)*16)+t(4):return
  71. 2060 ifa$>"@"anda$<"g"thent(a)=asc(a$)-55:return
  72. 2070 ifa$>"/"anda$<":"thent(a)=asc(a$)-48:return
  73. 2080 t(a)=16:return
  74. 2500 rem adress check
  75. 2510 ifad>enthen1030
  76. 2515 ifb<srorb>enthen1040
  77. 2520 ifb<256or(b>40960andb<49152)orb>53247then1050
  78. 2530 return
  79. 3000 rem address to hex
  80. 3010 ac=ad:a=4096:gosub3070
  81. 3020 a=256:gosub3070
  82. 3030 a=16:gosub3070
  83. 3040 a=1:gosub3070
  84. 3060 return
  85. 3070 t=int(ac/a):ift>9thena$=chr$(t+55):goto3090
  86. 3080 a$=chr$(t+48)
  87. 3090 printa$;:ac=ac-a*t:return
  88. 4000 a$="**save**":gosub4200
  89. 4050 open1,t,1,a$:sys680:close1
  90. 4060 ifst=0thenend
  91. 4070 gosub1060:ift=8thengosub1200
  92. 4080 goto4000
  93. 4100 a$="**load**":gosub4200
  94. 4150 open1,t,0,a$:sys690:close1
  95. 4160 ifst=64then110
  96. 4170 gosub1070:ift=8thengosub1200
  97. 4180 goto4100
  98. 4200 print" ":printtab(14)a$
  99. 4210 print:a$="":input"filename";a$
  100. 4215 ifa$=""then4210
  101. 4220 print:print"tape or disk?":print
  102. 4230 getb$:t=1:ifb$="d"thent=8:a$="@0:"+a$:return
  103. 4240 ifb$<>"t"then4230
  104. 4250 return
  105. 4500 b$="continue from address":gosub2010:ad=b
  106. 4510 gosub2515:ifb=0then4500
  107. 4520 print:goto110
  108. 4700 b$="begin scan at address":gosub2010:ad=b
  109. 4705 gosub2515:ifb=0then4700
  110. 4706 print:goto4740
  111. 4710 forb=0to7:ac=peek(ad+b):gosub3030:ifad+b=enthenad=sr:gosub1080:goto110
  112. 4715 print" ";:nextb
  113. 4720 print:ad=ad+8
  114. 4730 getb$:ifb$=chr$(136)then110
  115. 4740 gosub3010:print": ";:goto4710
  116.