home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 September / Ahoy_Magazine_86-09_1986_Double_L.d64 / Flankspeed (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  3KB  |  116 lines

  1. 100 poke53280,12:poke53281,11
  2. 105 print"[147][155]               flankspeed               ";
  3. 110 print"     mistakeproof ml entry program      "
  4. 115 print"         created by g. f. wheat         "
  5. 120 print"   copr. 1984, ion international inc.   "
  6. 125 fora=54272to54296:pokea,0:next
  7. 130 poke54272,4:poke54273,48:poke54277,0:poke54278,249:poke54296,15
  8. 135 fora=680to699:readb:pokea,b:next
  9. 140 data169,251,166,253,164,254,32,216,255,96
  10. 145 data169,0,166,251,164,252,32,213,255,96
  11. 150 b$="starting address in hex":gosub430:ad=b:sr=b
  12. 155 gosub480:ifb=0then150
  13. 160 poke251,t(4)+t(3)*16:poke252,t(2)+t(1)*16
  14. 165 b$="ending address in hex":gosub430:en=b
  15. 170 gosub470:ifb=0then150
  16. 175 poke254,t(2)+t(1)*16:b=t(4)+1+t(3)*16
  17. 180 ifb>255thenb=b-255:poke254,peek(254)+1
  18. 185 poke253,b:print
  19. 190 rem  get hex line
  20. 195 gosub495:print": [175][157]";:fora=0to8
  21. 200 forb=0to1:goto250
  22. 205 nextb
  23. 210 a%(a)=t(1)+t(0)*16:ifad+a-1=enthen340
  24. 215 print" [175][157]";
  25. 220 nexta:t=ad-(int(ad/256)*256):print" "
  26. 225 fora=0to7:t=t+a%(a):ift>255thent=t-255
  27. 230 next
  28. 235 ifa%(8)<>tthengosub375:goto195
  29. 240 fora=0to7:pokead+a,a%(a):next:ad=ad+8:goto195
  30. 245 rem    get hex input
  31. 250 geta$:ifa$=""then250
  32. 255 ifa$=chr$(20)then305
  33. 260 ifa$=chr$(133)then535
  34. 265 ifa$=chr$(134)then560
  35. 270 ifa$=chr$(135)thenprint" ":goto620
  36. 275 ifa$=chr$(136)thenprint" ":goto635
  37. 280 ifa$>"@"anda$<"g"thent(b)=asc(a$)-55:goto295
  38. 285 ifa$>"/"anda$<":"thent(b)=asc(a$)-48:goto295
  39. 290 gosub415:goto250
  40. 295 printa$"[175][157]";
  41. 300 goto205
  42. 305 ifa>0then320
  43. 310 a=-1:ifb=1then330
  44. 315 goto220
  45. 320 ifb=0thenprintchr$(20);chr$(20);:a=a-1
  46. 325 a=a-1
  47. 330 printchr$(20);:goto220
  48. 335 rem last line
  49. 340 print" ":t=ad-(int(ad/256)*256)
  50. 345 forb=0toa-1:t=t+a%(b):ift>255thent=t-255
  51. 350 next
  52. 355 ifa%(a)<>tthengosub375:goto195
  53. 360 forb=0toa-1:pokead+b,a%(b):next
  54. 365 print:print"you are finished!":goto535
  55. 370 rem bell and error messages
  56. 375 print:print"line entered incorrectly":print:goto415
  57. 380 print:print"input a 4 digit hex value!":goto415
  58. 385 print:print"ending is less than starting!":b=0:goto415
  59. 390 print:print"address not within specified range!":b=0:goto415
  60. 395 print:print"not zero page or rom!":b=0:goto415
  61. 400 print"?error in save":goto415
  62. 405 print"?error in load":goto415
  63. 410 print:print:print"end of ml area":print
  64. 415 poke54276,17:poke54276,16:return
  65. 420 open15,8,15:input#15,a,a$:close15:printa$:return
  66. 425 rem get four digit hex
  67. 430 print:printb$;:inputt$
  68. 435 iflen(t$)<>4thengosub380:goto430
  69. 440 fora=1to4:a$=mid$(t$,a,1):gosub450:ift(a)=16thengosub380:goto430
  70. 445 next:b=(t(1)*4096)+(t(2)*256)+(t(3)*16)+t(4):return
  71. 450 ifa$>"@"anda$<"g"thent(a)=asc(a$)-55:return
  72. 455 ifa$>"/"anda$<":"thent(a)=asc(a$)-48:return
  73. 460 t(a)=16:return
  74. 465 rem adress check
  75. 470 ifad>enthen385
  76. 475 ifb<srorb>enthen390
  77. 480 ifb<256or(b>40960andb<49152)orb>53247then395
  78. 485 return
  79. 490 rem address to hex
  80. 495 ac=ad:a=4096:gosub520
  81. 500 a=256:gosub520
  82. 505 a=16:gosub520
  83. 510 a=1:gosub520
  84. 515 return
  85. 520 t=int(ac/a):ift>9thena$=chr$(t+55):goto530
  86. 525 a$=chr$(t+48)
  87. 530 printa$;:ac=ac-a*t:return
  88. 535 a$="**save**":gosub585
  89. 540 open1,t,1,a$:sys680:close1
  90. 545 ifst=0thenend
  91. 550 gosub400:ift=8thengosub420
  92. 555 goto535
  93. 560 a$="**load**":gosub585
  94. 565 open1,t,0,a$:sys690:close1
  95. 570 ifst=64then195
  96. 575 gosub405:ift=8thengosub420
  97. 580 goto560
  98. 585 print" ":printtab(14)a$
  99. 590 print:a$="":input"filename";a$
  100. 595 ifa$=""then590
  101. 600 print:print"tape or disk?":print
  102. 605 getb$:t=1:ifb$="d"thent=8:a$="@0:"+a$:return
  103. 610 ifb$<>"t"then605
  104. 615 return
  105. 620 b$="continue from address":gosub430:ad=b
  106. 625 gosub475:ifb=0then620
  107. 630 print:goto195
  108. 635 b$="begin scan at address":gosub430:ad=b
  109. 640 gosub475:ifb=0then635
  110. 645 print:goto670
  111. 650 forb=0to7:ac=peek(ad+b):gosub505:ifad+b=enthenad=sr:gosub410:goto195
  112. 655 print" ";:nextb
  113. 660 print:ad=ad+8
  114. 665 getb$:ifb$=chr$(136)then195
  115. 670 gosub495:print": ";:goto650
  116.