home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 130
/
130.d81
/
numcon
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
10KB
|
295 lines
10 rem *** universal base converter ***
20 rem *** version 2.0 090194 ***
30 rem *** by michael j. gulyas ***
40 :
50 clr:dv=peek(186):if dv<8 then dv=8
60 poke788,52:gosub 270:gosub 870
70 poke214,16:poke211,2:sys58732:printc0$s0$(0)
80 poke214,16:poke211,21:sys58732:printc0$s0$(0)
90 poke214,19:poke211,2:sys58732:printc0$s0$(1)
100 poke214,22:poke211,2:sys58732:printc0$s0$(1):x=0:y=0
110 poke214,16+y0*3:poke211,2-19*x0*(y0=0):sys58732
120 printc0$s0$(y0)nv$(3*y0-(y0=0)*(1+x0));
130 poke214,16+y*3:poke211,2-19*x*(y=0):sys58732
140 printc0$s0$(y)nv$(3*y-(y=0)*(1+x));
150 poke214,16+y*3:poke211,2-19*x*(y=0):sys58732:ct=0:y0=y:x0=x
160 gosub 460:for n=1 to 50
170 get a$:if a$="" then next:goto 160
180 n=50:next:gosub 490:if mo then mo=0:mg=0:gosub 2140
190 for n=1tolen(pc$):if a$=mid$(pc$,n,1) then co=n:n=len(pc$):next:goto 210
200 next:gosub 1180:goto 160
210 on co gosub 1140,1150,1140,1150,2330,1890
220 on co goto 110,110,110,110,160,160
230 goto 160
240 print"
250 [161] a$:[139] a$[178]"" [167] 250
260 [128]:[138]
270 [143] *** load files ***
280 [141] 500
290 [158]57812"numcon.font",dv,0:[151]780,0:[151]781,0:[151]782,224:[158]65493
300 [158]57812"numcon.obj",dv,0:[151]780,0:[151]781,0:[151]782,192:[158]65493
310 [158] ad[170]21,1
320 [153]"load":[151] 53280,11:[151] 53281,0:[151] 53265,([194](53265)[175]191)
330 [151] 56578,[194](56578)[176]3
340 [151] 56576,([194](56576)[175]252)[176]0
350 [151] 53272,([194](53272)[175]15)[176]32
360 [151] 648,200
370 [151] 53272,([194](53272)[175]240)[176]8
380 [142]
390 [143]
400 [129] i[178]0 [164] 15
410 [158]ad[170]30,8,32,22,24,32,i[170]8,1
420 [158]ad[170]30,9,31,23,23,32,i,1
430 [129] j[178]1 [164] 10:[161] a$:[139] a$[178]"" [167] [130]:[130]:[137] 400
440 j[178]10:i[178]15:[130]:[130]:[142]
450 wd$[178]"":dp[178]0:[142]
460 z[178]51200[170]40[172][194](214)[170][194](211)
470 ct[178]1[171]ct:[145] ct[170]1 [137] 490,480
480 [151] z,[194](z)[176]128:[142]
490 [151] z,[194](z)[175] 127:[142]
500 [143] *** loading screen ***
510 [141] 730
520 [151]53265,[194](53265)[176]64
530 [151] 53280,6:[151] 53281,14:[151] 53282,0:[151]53283,1:[151]53284,6
540 tb[178]7
550 [153]"loadreturn"[163]tb[170]1)"sys+++++++++++++++++++++++++
560 printtab(tb)"[158][160][146][170] [146][170]
570 [153][163]tb)"sysclosewait+ stopuniversal base syswait+
580 printtab(tb)"[158][160][146][170] [144]converter [158][146][170]
590 [153][163]tb)"sysclosewait+ syswait+
600 printtab(tb)"[158][160][146][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170]
610 [153][163]tb)"sysclosewait+ syswait+
620 printtab(tb)"[158][160][146][170] [144]version 2.0 090194 [158][146][170]
630 [153][163]tb)"sysclosewait+ wait+
640 printtab(tb)"[158][160][146][170] [144]by michael j. gulyas [146][158][170]
650 [153][163]tb)"sysclosewait+ wait+
660 printtab(tb)"[158][160][146][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170]
670 [153][163]tb)"sysclosewait+ wait+
680 printtab(tb)"[158][160][146][170] [144]loading... [146][158][170]
690 [153][163]tb)"sysclosewait+ wait+
700 printtab(tb)"[158][160][146][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170][170]
710 [153][163]tb)"sysclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclosecloseclose
720 return
730 rem *** variables ***
740 dim a,ad,a$,b,b0,b1,b%,b$,c,co,cp,ct,c0$,c1$,dp,fr,i,in
750 dim j,ln,lo,mg,mo,n,nu$,pc$,s,tb,tm,wd$,x,x0,xp,y,y0,yp,z
760 dim nv$(3),s0$(1),mg$(10)
770 rem reserved for dimming
780 s0$(0)=" [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]"
790 s0$(1)=" "
800 s0$(1)=s0$(1)+"[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]"
810 c0$="[158]":c1$="[129]"
820 nu$="0123456789abcdefghijklmnopqrstuvwxyz"
830 pc$="[145][157][133][136]"
840 for n=0 to 10:read mg$(n):next
850 ad=49152:s=54272
860 return
870 rem *** print screen ***
880 print"[147][151] [184][188][188][188][188][188][188][188]";
890 print"[188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][185][190][146] [153]*** [213][206][201][214][197][210][211][193][204]";
900 print" [194][193][211][197] [195][207][206][214][197][210][212][197][210] [153]***[151] [191][181][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182]";
910 print"[182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][182][183][190][146] [201]nstructions [152]";
920 print" [151][191][190][152][146] [152] ";
930 print" [151][191][190][152][146] [154]1. [197]nter [154][198][210][207][205] base in decimal. [152]";
940 print" [151][191][190][152][146] [154]2. [197]nter [154][212][207] base in decimal. [152] ";
950 print" [151][191][190][152][146] [154]3. [197]nter numeral to be converted. [152] ";
960 print"[151][191][190][146] [154]4.[152] [154][210]ead converted numeral at bottom[152] [151]";
970 print"[191][190][152][146] window.[152] [151][191][190][152][146]";
980 print" [151][191][186][189][189][189][189][189][189][189][189]";
990 print"[189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][187] ";
1000 print" [198][210][207][205]: [212][207]: ";
1010 print" [184][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][185][184][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][185]";
1020 print" [190][152][146] [151][191][190][152][146] [151]";
1030 print"[191] [186][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][187][186][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][187] [184][188][188][188][188][188]";
1040 print"[188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][185] [190][152][146] ";
1050 print" [151][191] [186][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189]";
1060 print"[189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][187] [184][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188][188]";
1070 print"[188][188][188][188][188][188][188][188][188][185] [190][152][146] ";
1080 print" [151][191] [186][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][189][187] ";
1090 print" [146]";
1100 poke53280,11:poke53281,00:poke52199,160:poke56295,11
1110 poke53282,02:poke53283,03:poke53284,04
1120 sys ad+6:return
1130 rem *** cursors ***
1140 y=1-y:gosub 450:return
1150 ify=0thenx=1-x:gosub 450:return
1160 co=5:return
1170 rem
1180 rem *** handle digits ***
1190 on -1*(a$=chr$(13))-2*(a$=".")-3*(a$=chr$(20))goto 1330,1830,2010
1200 if len(wd$)=0 and a$="0" then return:rem no leading zeros
1210 if y=1 then 1260
1220 if a$<"0" or a$>"9" the