home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Input 64
/
Input_64_87-10_1987_Verlag_Heinz_Weise_de.d64
/
renumber
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
2KB
|
53 lines
0 rem renumber
1 poke56,32:clr:gosub51:c=8195:dimi1%(800):dimi2%(800):poke53280,0:poke53281,0:print"[147][155]":input"erste zeilennummer0[157][157][157]";pp:input"inkrement50[157][157][157][157]";ag:n1=0
2 print"name von programm";n1+1;:inputb$(n1):ifb$(n1)=""then5
3 n1=n1+1:ifn1>9then5
4 goto2
5 n2=n1:n1=-1
6 n1=n1+1:ifn1=n2thengosub48:print"fertig!":print:print,ti$:poke198,0:wait198,1:end
7 pr=pp:n$=b$(n1):x=1:open2,8,2,n$+",p,r":print"ich lade nr.";n1+1;n$:y=c
8 get#2,a$:poke y,asc(a$+chr$(0)):ifst<>0thenclose2:gosub48:goto11
9 y=y+1:ify<53247then8
10 print"programm ist zu lang!":close2:gosub48:goto6
11 ti$="000000":print" pass 1":gosub29:i=c+1:pr=pr-ag:goto13
12 i=i+1:goto22
13 x=1:cu=0:a=usr(i+3)+256*usr(i+4)
14 ifi1%(x)=(a-32767)then17
15 x=x+1:ifx<tt+1then14
16 pr=pr+ag:hi=int(pr/256):lo=pr-hi*256:pokei+3,lo:pokei+4,hi:print,"neue nummer";pr:i=i+4:goto12
17 b=i2%(x)+32767:a2=pr+ag:a3=i1%(x)+32767:a1=len(str$(a2))-len(str$(a3)):ifa1>0then20
18 forl=2tolen(str$(a2)):pokeb+l-2,asc(mid$(str$(a2),l,1)):next:u=b+l-2:print"adr.";b;" von";a3;" auf";a2:print:ifa1<0thena1=abs(a1):goto26
19 goto15
20 print:printq,"+";a1;"bytes bei adr.";b:print:forl=qtobstep-1:pokel+a1,usr(l):next:q=q+a1:forl=x+1tott:i2%(l)=i2%(l)+a1:next:ifb<itheni=i+a1
21 goto18
22 ifusr(i)=0thenprint:printusr(i+3)+256*usr(i+4):goto24
23 goto12
24 ifusr(i+1)=0andusr(i+2)=0thenprint,l,q:goto28
25 goto13
26 print:printq,"-";a1;"bytes bei adr.";b:print:forl=utoq:pokel,usr(l+a1):next:q=q-a1:forl=x+1tott:i2%(l)=i2%(l)-a1:next:ifb<itheni=i-a1
27 goto19
28 print:print:printti$:open2,8,2,"ren-"+n$+",p,w":print"ich sichere nr.";n1+1;n$:fory=ctoq:print#2,chr$(usr(y));:next:close2:gosub48:goto6
29 l=c+1:goto46
30 ifusr(l)=0then46
31 u=usr(l):ifu=141oru=137oru=138oru=167then34
32 ifu=100andusr(l+1)=48thenl=l+1:goto34
33 l=l+1:goto30
34 l=l+1:ifusr(l)=32then34
35 a=l:ifusr(l)<48orusr(l)>57then30
36 l=l+1:ifusr(l)<48orusr(l)>57thencc=l:l=l-1:goto38
37 goto36
38 b=usr(l)-48:ifusr(l+1)=44theno=1
39 ifl=athen44
40 l=l-1:b=b+(usr(l)-48)*10:ifl=athen44
41 l=l-1:b=b+(usr(l)-48)*100:ifl=athen44
42 l=l-1:b=b+(usr(l)-48)*1000:ifl=athen44
43 l=l-1:b=b+(usr(l)-48)*10000:ifl<>athen31
44 i1%(x)=b-32767:print"sprung nach";b;:i2%(x)=a-32767:x=x+1:ifo=1theno=0:l=cc:goto34:
45 goto33
46 ifusr(l+1)=0andusr(l+2)=0thenq=l+3:tt=x:print:print:print" pass 2":return
47 print:ad=usr(l+3)+256*usr(l+4):l=l+5:printad,:goto30
48 open1,8,15:print:print"";
49 get#1,a$:printa$;:ifst=0anda$<>chr$(13)then49
50 print#1,"m-w";chr$(106);chr$(0);chr$(1);chr$(133):print#1,"i":print#1,"m-w";chr$(6);chr$(0);chr$(2);chr$(36);chr$(1):print#1,"m-w";chr$(0);chr$(0);chr$(1);chr$(128):close1:return
51 restore:forl=704to738:reada:pokel,a:next:data165,20,72,165,21,72,32,247,183,165,1,72:data169,52,120,133,1,160,0,177,20,168,104:data133,1,88,104,133,21,104,133,20,76,162,179:poke785,192:poke786,2:return