home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 2 #7
/
utv2n7s1.d64
/
seq
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
22KB
|
510 lines
10 rem (c) 1988 uptime magazine
20 rem (c) 1988 softdisk publishing inc.
30 rem author: noel nyman
40 rem gray border, black screen, light green text
45 sys65409
50 poke53280,11:poke53281,0:poke646,13
60 rem q$=quotes, force upper/lower case, run/stop disabled
70 q$=chr$(34):printchr$(14)chr$(8):sp$=" ":poke808,234
80 rem --- sys (NULL),x,y places cursor at row x, column y ---
90 q=679:forx=qto706:reada:pokex,a:next
100 data 32,253,174,32,158,173,32,170,177,132,2,32,253,174,32,158
110 data 173,32,170,177,166,2,76,240,255,56,176,250
120 rem skip sub-routines
130 goto560
140 rem *** clear screen to line 23 starting at line 'x' ***
150 x=10:gosub160:sysq,10,3:return
160 fory=xto23:sysq,y,0:sys 59903:pokey+217,peek(y+217)or128:next
170 return
180 rem *** filter keyboard input for string ***
190 rem ---returns string in xx$ length 'll' or smaller---
200 xx$="":xb=65:xe=90:goto220:rem lower case alpha only
210 xx$="":xb=48:xe=57:goto220:rem numeric only
220 gosub270:xa=asc(cg$):ifxa=13andxx$<>""thenreturn
230 if(xa=20)and(xx$<>"")thenprintcg$;:xx$=left$(xx$,len(xx$)-1):goto220
240 if(xa<xb)or(xa>xe)goto220
250 iflen(xx$)>=llgoto220
260 printcg$;:xx$=xx$+cg$:goto220
270 xl%=peek(211)
280 if(xl%>39)thenxl%=xl%-40:goto280
290 xl%=xl%+peek(214)*40+1024:xc=54272+xl%
300 pokexc,peek(646):xo%=peek(xl%):xt%=xo%:xq%=128:if(xo%>127)thenxq%=-xq%
310 xt%=xt%+xq%:pokexl%,xt%:xq%=-xq%
320 forxr=1to60
330 getcg$:if(cg$<>"")thenpokexl%,xo%:xr=61:next:return
340 next:goto310
350 rem *** delay loop ***
360 rem --- enter with delay time in x ---
370 fora=1tox:next:return
380 fory=11to16:sysq,6,y:print"[158]->[153]":x=50:gosub370:next:return
390 gosub420:sysq,5,19:printsp$:sysq,6,19:printsp$:return
400 sysq,0,0:sys59903:return
410 fory=16to11step-1:sysq,6,y:print"<*":x=50:gosub370:next:return
420 sysq,6,11:print" ":return
430 rem *** prompt ***
440 sys679,24,1:print"[152][211][208][193][195][197] [194][193][210] to continue - [198]8 for [213][208][212][201][205][197][146][153]";
450 wait198,1:poke198,0
460 if(peek(631)=32)or(peek(631)=13)thenwait197,64:return
470 ifpeek(631)<>140goto450
480 rem re-enter uptime environment
490 printchr$(9): rem enable shift/c=
500 poke186,8: rem device #8
510 poke808,237: rem re-enable run-stop
520 load"reboot",8
530 rem ***************************
540 rem main program starts here
550 rem ***************************
560 print"[147]"
570 print"[158] [182][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][181]
580 [153]"sys abs print(NULL)(NULL)right$(NULL)chr$ (NULL)val(NULL)(NULL)val(NULL)(NULL)right$atn(NULL) ascright$(NULL)val(NULL) sysint
590 print" [182][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][181]
600 [153]"print# published by (NULL)oftdisk (NULL)ublishing
610 print" written for [213][208][212][201][205][197] by [206]oel [206]yman
620 [153]"print (NULL)n many disks, you've seen files in
630 print"the disk directory with [211][197][209][153] following
640 [153]"their names. sys(NULL)val(NULL)printuential files are often";
650 [153]"used by programmers to store data. They";
660 [153]"can also be used for word processor and
670 print"other text files.
680 [153]" (NULL)e're going to show you how to make
690 print"your own [158][211][197][209][153] files to hold data from
700 [153]"your programs, and how to read just
710 print"about any [158][211][197][209][153] file.":gosub440
720 print"[147]
730 [153]"lenomputer asciles str$isk asciles
740 print"[129][163][163][163][163][163][163][163][163][163][163][163][163][163][163] [163][163][163][163][163][163][163][163][163][163]
750 [153]"list10 8 2 1 "q$"(NULL)(NULL)(NULL)right$(NULL)val"q$" (NULL)(NULL)chr$
760 print" 4 4 0 15 "q$"[204][197][212][212][197][210]"q$" [211][197][209]
770 [153]"15 8 15 12 "q$"asc(NULL)(NULL)chr$chr$right$val"q$" (NULL)(NULL)chr$
780 print"[153] [213]nfortunately, the same word is often";
790 print"used in the computer world to mean two
800 [153]"different things. (NULL)he word "q$"file"q$"print has
810 print"two meanings for [195]ommodore computers.
820 [153]" (NULL)ou already know that a collection of";
830 [153]"data on a diskprint is known as a sysfileprint.
840 print" [212]he computer[153] also uses [158]files[153], but
850 [153]"for a different purpose.":[141]440
860 [153]"loadlist(NULL)(NULL)val(NULL) 4, 4, 0: len(NULL)str$ 4: (NULL)right$(NULL)(NULL)print
870 print" [217]ou may have used computer files
880 [153]"without knowing it. The set of commands";
890 [153]"above (NULL)right$(NULL)(NULL)prints a peekatn(NULL)right$len program to your":[153]"printer.
900 gosub440:sysq,1,8:print "^
910 [158]q,2,6:[153]"deviceprint":[141]150
920 [153]"(NULL)his is the device numberprint. (NULL)ost
930 print"[195]ommodore printers are [158]device #4[153].
940 [141]440:[158]q,1,8:[153]" ^
950 sysq,2,3:print"secondary address[153]":sysq,14,0
960 print" [212]his number is called the secondary
970 [153]"addressprint. (NULL)ome devices use this number
980 print"for special purposes. [193] secondary
990 [153]"address of syszeroprint puts lenommodore printers
1000 print"into [213]pper [195]ase/[199]raphics mode.
1010 [141]440:[158]q,1,5:[153]"^ ^
1020 sysq,2,1:print"file number file number[153]":sysq,21,3
1030 print"[212]his number is the file number[153].":gosub440
1040 print"[147][155][207][208][197][206][153]
1050 [158]59903:[153]" atn computer fileprint is the reference
1060 print"used by the machine and the programmer
1070 [153]"for input/output or sysright$/(NULL)print activity. (NULL)o
1080 print"communicate with a printer, modem, or
1090 [153]"disk drive, you must create or (NULL)(NULL)val(NULL)print a":[153]"file.
1100 print" [212]he computer keeps track of files by
1110 [153]"using the file numberprint. (NULL)his number
1120 print"can be any whole number from 1[153] through
1130 [153]"127print. ((NULL)he numbers sys128print through sys255print
1140 print"are used to add an extra blank line when";
1150 print"[158][204][201][211][212][153]ing programs to a printer.)
1160 [153]" (NULL)ow, enter a number between 1print and
1170 print"127[153] for a file number."
1180 print"---> ";:x$=""
1190 ll=3:gosub210:xx=val(xx$):if(xx>0)and(xx<128)goto1220
1200 print"[147][153][217]our number should be between [158]1[153]
1210 [153]"and sys127print. (NULL)ry again.":[137]1180
1220 fl$[178]xx$:[153]"loadlist(NULL)(NULL)val(NULL) "fl$"
1230 print"[153] [207]nce we set up or "q$"open"q$"[153] a file,
1240 [153]"we have to tell the computer which
1250 print"device we want to use with that file.
1260 [153]" (NULL)ince we're going to create a sys(NULL)val(NULL)print
1270 print"disk file, we'll use device #8[153].":gosub440
1280 print"[155]"tab(5+len(fl$))",8
1290 [141]150:[153]"printstr$on't forget the sys"q$","q$"print between the
1300 print"file number and the device number.":gosub440
1310 print "[147][155][207][208][197][206] "fl$",8"
1320 print"[147][155][207][208][197][206] "fl$",8":print"[153] [212]he [158]secondary address[153] you need to use";
1330 print"depends on the device. [208]rinters and
1340 [153]"printer interfaces use the secondary
1350 print"address to change printing styles.
1360 [153]" str$isk drives use the syssecondary addressprint";
1370 [153]"in the same way that the computer uses
1380 print"file numbers. [198]or a disk drive, the
1390 [153]"secondary address is often called a":[153]"channelprint.
1400 print" [215]hen you want to [204][207][193][196], [211][193][214][197], read
1410 [153]"from, or write to a file, the disk drive";
1420 [153]"keeps track of which file on the disk to";
1430 [153]"use by a channelprint number.":[141]440
1440 [153]"load(NULL)et's review for a moment.
1450 print"[215]hich answer is correct?
1460 [153]" atn) (NULL)he computer and the disk drive
1470 print" both use [158]file numbers[153] to keep
1480 [153]" track of right$/(NULL)