home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1985 October
/
Ahoy_Magazine_85-10_1985_Double_L.d64
/
flankspeed
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
3KB
|
116 lines
5 poke53280,12:poke53281,11
6 print"[147][155] flankspeed ";
10 print" mistakeproof ml entry program "
15 print" created by g. f. wheat "
20 print" copr. 1984, ion international inc. "
30 fora=54272to54296:pokea,0:next
40 poke54272,4:poke54273,48:poke54277,0:poke54278,249:poke54296,15
70 fora=680to699:readb:pokea,b:next
75 data169,251,166,253,164,254,32,216,255,96
76 data169,0,166,251,164,252,32,213,255,96
80 b$="starting address in hex":gosub2010:ad=b:sr=b
85 gosub2520:ifb=0then80
86 poke251,t(4)+t(3)*16:poke252,t(2)+t(1)*16
90 b$="ending address in hex":gosub2010:en=b
95 gosub2510:ifb=0then80
96 poke254,t(2)+t(1)*16:b=t(4)+1+t(3)*16
97 ifb>255thenb=b-255:poke254,peek(254)+1
98 poke253,b:print
100 rem get hex line
110 gosub3010:print": [175][157]";:fora=0to8
120 forb=0to1:goto210
125 nextb
130 a%(a)=t(1)+t(0)*16:ifad+a-1=enthen310
135 print" [175][157]";
140 nexta:t=ad-(int(ad/256)*256):print" "
150 fora=0to7:t=t+a%(a):ift>255thent=t-255
160 next
170 ifa%(8)<>tthengosub1010:goto110
180 fora=0to7:pokead+a,a%(a):next:ad=ad+8:goto110
200 rem get hex input
210 geta$:ifa$=""then210
211 ifa$=chr$(20)then270
212 ifa$=chr$(133)then4000
213 ifa$=chr$(134)then4100
214 ifa$=chr$(135)thenprint" ":goto4500
215 ifa$=chr$(136)thenprint" ":goto4700
220 ifa$>"@"anda$<"g"thent(b)=asc(a$)-55:goto250
230 ifa$>"/"anda$<":"thent(b)=asc(a$)-48:goto250
240 gosub1100:goto210
250 printa$"[175][157]";
260 goto125
270 ifa>0then280
272 a=-1:ifb=1then290
274 goto140
280 ifb=0thenprintchr$(20);chr$(20);:a=a-1
285 a=a-1
290 printchr$(20);:goto140
300 rem last line
310 print" ":t=ad-(int(ad/256)*256)
320 forb=0toa-1:t=t+a%(b):ift>255thent=t-255
330 next
340 ifa%(a)<>tthengosub1010:goto110
350 forb=0toa-1:pokead+b,a%(b):next
360 print:print"you are finished!":goto4000
1000 rem bell and error messages
1010 print:print"line entered incorrectly":print:goto1100
1020 print:print"input a 4 digit hex value!":goto1100
1030 print:print"ending is less than starting!":b=0:goto1100
1040 print:print"address not within specified range!":b=0:goto1100
1050 print:print"not zero page or rom!":b=0:goto1100
1060 print"?error in save":goto1100
1070 print"?error in load":goto1100
1080 print:print:print"end of ml area":print
1100 poke54276,17:poke54276,16:return
1200 open15,8,15:input#15,a,a$:close15:printa$:return
2000 rem get four digit hex
2010 print:printb$;:inputt$
2020 iflen(t$)<>4thengosub1020:goto2010
2040 fora=1to4:a$=mid$(t$,a,1):gosub2060:ift(a)=16thengosub1020:goto2010
2050 next:b=(t(1)*4096)+(t(2)*256)+(t(3)*16)+t(4):return
2060 ifa$>"@"anda$<"g"thent(a)=asc(a$)-55:return
2070 ifa$>"/"anda$<":"thent(a)=asc(a$)-48:return
2080 t(a)=16:return
2500 rem adress check
2510 ifad>enthen1030
2515 ifb<srorb>enthen1040
2520 ifb<256or(b>40960andb<49152)orb>53247then1050
2530 return
3000 rem address to hex
3010 ac=ad:a=4096:gosub3070
3020 a=256:gosub3070
3030 a=16:gosub3070
3040 a=1:gosub3070
3060 return
3070 t=int(ac/a):ift>9thena$=chr$(t+55):goto3090
3080 a$=chr$(t+48)
3090 printa$;:ac=ac-a*t:return
4000 a$="**save**":gosub4200
4050 open1,t,1,a$:sys680:close1
4060 ifst=0thenend
4070 gosub1060:ift=8thengosub1200
4080 goto4000
4100 a$="**load**":gosub4200
4150 open1,t,0,a$:sys690:close1
4160 ifst=64then110
4170 gosub1070:ift=8thengosub1200
4180 goto4100
4200 print" ":printtab(14)a$
4210 print:a$="":input"filename";a$
4215 ifa$=""then4210
4220 print:print"tape or disk?":print
4230 getb$:t=1:ifb$="d"thent=8:a$="@0:"+a$:return
4240 ifb$<>"t"then4230
4250 return
4500 b$="continue from address":gosub2010:ad=b
4510 gosub2515:ifb=0then4500
4520 print:goto110
4700 b$="begin scan at address":gosub2010:ad=b
4705 gosub2515:ifb=0then4700
4706 print:goto4740
4710 forb=0to7:ac=peek(ad+b):gosub3030:ifad+b=enthenad=sr:gosub1080:goto110
4715 print" ";:nextb
4720 print:ad=ad+8
4730 getb$:ifb$=chr$(136)then110
4740 gosub3010:print": ";:goto4710