home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 117
/
117.d81
/
1040a
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
11KB
|
396 lines
0 w$="":dv=peek(186):ifdv<8thendv=8
1 ifa=0thena=1:load"scroll 9000",dv,1
2 remifa=1thena=2:load"notepad c900",dv,1
3 remifa=2thena=3:load"tool box c000",dv,1
4 poke55,0:poke56,144:clr
5 w$="":dv=peek(186):ifdv<8thendv=8
6 poke198,0:sp$=" ":max=36
7 dim m1$(max),m2$(20),d$(max),ch(max):fl=0:f1=0:fs=2
8 fori=0tomax:d$(i)="0":next:d$(1)="1":d$(2)="1"
10 poke53280,0:poke53281,0:ad=49152
21 fori=1tomax:readm1$(i):next
22 fori=1to6:readm2$(i):next
25 fori=1tomax:readch(i):next
30 print"[147]";:gosub9500
40 sysad+21,"[212][193][216] [193][195][195][207][213][206][212][193][206][212]: 1040[193]",0,10,0
43 sysad+18,0,1,38,19,7,0:sysad+15,1,2,38,20,160,14
46 gosub9000:gosub9500
50 x=0:y=1:d=36:w=38:tx=14:hi=1:bx=4:ex$=chr$(133):max=19:v=0
52 fori=217to242:pokei,peek(i)or128:next
54 poke214,y-1:print:print:poke646,tx
56 fori=1tomax:printtab(x+1)""left$(m1$(i+v)+sp$,w):next:r=1
57 hi=1:ifch(r+v)=1thenhi=10
58 r=1:r1=1:poke646,hi:poke214,r+y-1:print:printtab(x+1)""left$(m1$(r+v)+sp$,w)
62 getk$:ifk$=""then62
66 ifk$=chr$(13)then135
68 ifk$="[145]"thengosub800
70 ifk$=""thengosub850
79 ifk$="[136]"thengosub1000:ifk=10ork=1ork=11ork=12then52
88 ifk$="_"thengosub7000:rem exit
92 poke646,tx:poke214,r1+y-1:print:printtab(x+1)""left$(m1$(r1+v)+sp$,w)
93 hi=1:ifch(r+v)=1thenhi=10
94 poke646,hi:poke214,r+y-1:print:printtab(x+1)""left$(m1$(r+v)+sp$,w)
96 r1=r:goto62
98 :
135 ifch(r+v)=1then62
136 ifr+v=17then4000
140 gosub9100:iflen(w$)=0then62
145 ww=val(w$):w$=str$(ww):d$(r+v)=w$
150 ifr+v=2thenifval(w$)>1thend$(2)="1"
151 ifval(d$(34))>val(d$(32))thend$(34)=d$(32):d$(34)="0":goto187
152 d$(33)=str$(val(d$(32))-val(d$(34)))
186 remgosub9500
187 m1$(r+v)=left$(m1$(r+v),27):d$(r+v)=right$(sp$+d$(r+v),10)
188 m1$(r+v)=m1$(r+v)+d$(r+v)
190 goto92
191 :
200 gosub9300
210 ifval(w$)=0thenclose2:close15:gosub9000:return
220 open15,dv,15,"io":w$="1040a."+w$
225 open2,dv,2,"0:"+w$+",s,r"
230 input#15,e,e$,e1,e2
234 poke214,21:print:print" "
235 poke214,21:print:print"[196]isk [211]tatus:"e;e$:fori=1to2000:next
236 poke214,21:print:print" "
240 ifethenclose2:close15:gosub9000:return
250 fori=0to36:input#2,d$(i):next
255 input#2,fs
270 close2:close15
275 gosub9000:gosub9500:return
280 :
300 gosub9300:ifval(w$)=0then375
310 w$="1040a."+w$:d$(0)=d$(36)
320 open15,dv,15,"s0:"+w$:close15
330 open15,dv,15,"io"
335 open2,dv,2,"0:"+w$+",s,w"
340 input#15,e,e$,e1,e2
344 poke214,21:print:print" "
345 poke214,21:print:print"[196]isk [211]tatus: "e;e$:fori=1to2000:next
346 poke214,21:print:print" "
350 ifethenclose2:close15:print"[145][198]ile [206]ot [211]aved":fori=1to2000:next:goto375
360 fori=0to36:print#2,d$(i):next
365 print#2,fs
370 close2:close15
375 gosub9000:return
390 :
400 sysad+3,0:gosub9600
401 poke214,21:print:print"[195]alculating..."
402 d$(4)=str$(val(d$(1))+val(d$(2))+val(d$(3)))
405 tl=0:fori=5to11:tl=tl+val(d$(i)):next:d$(12)=str$(tl)
410 d$(15)=str$(val(d$(13))+val(d$(14)))
415 d$(16)=str$(val(d$(12))-val(d$(15)))
420 d$(18)=str$(val(d$(16))-val(d$(17)))
425 d$(19)=str$(val(d$(4))*2350)
429 d$(20)=str$(val(d$(18))-val(d$(19)))
430 ifval(d$(20))>50000thend$(20)="[211][212][207][208]":goto475
431 ifval(d$(20))<0thend$(20)="0"
432 gosub15000
435 d$(24)=str$(val(d$(22))+val(d$(23)))
440 d$(25)=str$(val(d$(21))-val(d$(24))):ifval(d$(25))<0thend$(25)="0"
445 d$(27)=str$(val(d$(25))+val(d$(26)))
450 tl=0:fori=28to30:tl=tl+val(d$(i)):next:d$(31)=str$(tl)
460 x1=val(d$(31)):x2=val(d$(27)):ifx1>x2then470
461 d$(33)="0":d$(34)="0"
465 d$(35)=str$((x2-x1)+val(d$(36))):d$(32)="0":goto475
470 d$(32)=str$(x1-x2):d$(35)="0":d$(36)="0"
471 d$(33)=str$(val(d$(32))-val(d$(34)))
475 gosub9500:return
480 :
500 poke781,23:sys59903
501 poke214,21:print:print" [198]1=[204]oad [198]3=[211]ave [198]5=[208]rint [198]7=[197]xit "
502 sysad+15,1,2,38,20,32,14:n$="1040a.n"
505 sys51456,1,2,38,20,3,0
510 ky=peek(197)
515 ifky=6thensysad+3,3:gosub9400:sysad+6,3:ifw$="y"thensysad+27,1,2,38,20,7
520 ifky=5thenopen15,dv,15,"s0:"+n$:close15:sys57812n$,dv
525 ifky=5thenpoke193,0:poke194,4:poke174,0:poke175,8:sys62954:goto505
530 ifky=4then poke147,0:sys57812n$,dv,1:sys62631:goto505:rem load
550 ifky=3thenreturn
555 goto505
560 :
600 sysad+3,1:print"[147]"tab(14)"[150]*** [200][197][204][208] ***"
601 sysad+18,0,1,38,21,1,0
602 h$="t.1040a help":sysad+33
605 sysad+21,"[208]ress [210][197][212][213][210][206] _ to [197]xit",24,13,0
606 open2,dv,2,h$+",p,r":sysad+30,14
610 poke198,0
611 sysad+21," [208]ress [210][197][212][213][210][206] ",24,10,0
615 getk$:ifk$<>chr$(13)then615
620 poke198,0:close2:sysad+6,1:return
625 :
800 r=r-1:ifr<>0thenreturn
805 r=1:gosub875
806 v=v-1:ifv=-1thenv=0:return
807 poke646,tx:poke214,r+y-1:print:printtab(x+1)""left$(m1$(r+v+1)+sp$,w)
808 sys36864,x+1,x+w,y+1,y+max,1
810 return
815 :
850 r=r+1:ifr<=maxthenreturn
855 r=r-1:ifr>d then return
860 gosub875
861 v=v+1:ifv>d-maxthenv=v-1:return
862 poke646,tx:poke214,r+y-1:print:printtab(x+1)""left$(m1$(r+v-1)+sp$,w)
863 sys36864,x+1,x+w,y+1,y+max,0
865 return
870 :
875 poke646,tx:poke214,r1+y-1:print:printtab(x+1)left$(m1$(r1+v)+sp$,w)
880 poke646,tx:poke214,r+y-1:print:printtab(x+1)left$(m1$(r+v)+sp$,w)
885 return
890 :
900 gosub9400:ifw$<>"y"thengosub9000:return
905 poke214,21:print:print"[208]rinting... ";
910 open4,4,7
915 print#4,sp$"1040[193]"
920 print#4,sp$"-------------------------------------"
925 fori=0to4:print#4,sp$;m1$(i):next:print#4
926 fori=5to12:print#4,sp$;m1$(i):next:print#4
927 fori=13to15:print#4,sp$;m1$(i):next:print#4
928 fori=16to20:print#4,sp$;m1$(i):next:print#4
929 fori=21to31:print#4,sp$;m1$(i):next:print#4
930 fori=32to36:print#4,sp$;m1$(i):next:print#4
932 print#4:close4:gosub9000:return
935 :
1000 sysad+3,2
1005 sysad+18,10,4,20,11,13,1
1010 poke214,4:print
1015 printtab(11)"[153][204]oad [198]ile"
1020 printtab(11)"[211]ave [198]ile"
1025 printtab(11)"[208]rint [198]ile"
1030 printtab(11)"[200]elp"
1035 printtab(11)"[195]alculator"
1036 printtab(11)"[206]otepad"
1040 printtab(11)"[196]irectory"
1045 printtab(11)"[196]isk [196]rive #"+str$(dv)
1050 printtab(11)"[212]otals"
1055 printtab(11)"[195]alculate [211]heet"
1059 printtab(11)"[197]xit"
1060 sysad+12,11,5,29,11,13,1
1065 k=peek(828)
1070 onkgosub200,300,900,600,5000,500,6000,6100,2000,400
1075 sysad+6,2:return
1080 :
2000 sysad+6,2
2005 print"[153][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]";
2010 print"[221] 1040 [212]otals [221]";
2015 print"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]";
2020 print"[221][197]xemptions (6e) [221]";
2025 print"[221][201]ncome (14) [221]";
2030 print"[221][193]djustments to [201]ncome (15c) [221]";
2035 print"[221][193]djusted [199]ross [201]ncome (16) [221]";
2040 print"[221][212]axable [201]ncome (22) [221]";
2045 print"[221][195]redits (24c) [221]";
2050 print"[221][212]otal [212]ax (27) [221]";
2055 print"[221][208]ayments (28d) [221]";
2060 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]";
2065 fori=217to242:pokei,peek(i)or128:next
2075 print""
2080 printtab(28)right$(sp$+d$(4),10)
2085 printtab(28)right$(sp$+d$(12),10)
2090 printtab(28)right$(sp$+d$(15),10)
2095 printtab(28)right$(sp$+d$(16),10)
2100 printtab(28)right$(sp$+d$(20),10)
2105 printtab(28)right$(sp$+d$(24),10)
2110 printtab(28)right$(sp$+d$(27),10)
2115 printtab(28)right$(sp$+d$(31),10)
2120 getk$:ifk$<>chr$(13)then2120
2125 sysad+6,2:return
2130 :
4000