start tok64 d64-Fo5QIa 0 RUN00100 1 REM"{delete*6} 2 REM"{delete*7} ponz0*1983*waterloo 3 REM"{delete*6} 100 POKE53281,15:POKE53280,12:PRINT"{black}":PRINT"{clear}{space*14}{reverse on}{blue}c64 tutor-3 101 PRINT"{red}{cm a}{sh asterisk*37}{cm s}" 102 PRINT"{sh -} {reverse on}{blue}{space*10}more on the c64{space*10}{red}{reverse off} {sh -}":ms$=" welcome! " 103 PRINT"{red}{cm z}{sh asterisk*37}{cm x}{black}" 104 sn$="1{0*3}":GOSUB63200:GOSUB63600 105 GOSUB60000:GOSUB59000 1000 GOSUB60000 1010 PRINT"{clear}Qi store info in 8 (binary) bit "CHR$(34)"bytes"CHR$(34)"." 1020 PRINT"Qsince 2^8=256, each byte can hold a" 1030 PRINT" number from 0 to 255 inclusive." 1040 PRINT"Qtwo bytes are used to address" 1050 PRINT" 2^16 memory locations:0,1,2,{.*3},65535" 1060 PRINT"Qyou can find what's in each by {reverse on}peek{reverse off}ing:" 1070 PRINT"{down}{reverse on}for i=100 to 200:print peek(i);:next" 1080 PRINT"{down}Qthis may be entered directly" 1090 PRINT" and will print the contents" 1100 PRINT" of locations 100 to 200." 1110 PRINT"Qsome of {reverse on}m{reverse off}emory is {reverse on}r{reverse off}ead {reverse on}o{reverse off}nly(rom)." 1120 PRINT"Qsome is {reverse on}r{reverse off}andom {reverse on}a{reverse off}ccess(ram)." 1130 PRINT"Qyou can write into ram by {reverse on}poke{reverse off}ing." 1140 PRINT"{down}{space*2}{reverse on}poke1100,1" 1145 PRINT"{down}Qthis will put the no. 1 in loc'n 1100." 1146 GOSUB63000 1160 PRINT"{clear}{reverse on}note{reverse off}: for {reverse on}poke m,n " 1170 PRINT:PRINT"Q{reverse on}m{reverse off} must be in [0,65535],{reverse on}n{reverse off} in [0,255]." 1180 PRINT"Qi use 0 thru' 1023 myself..you use " 1190 PRINT" 2048 to 40959 for {reverse on}basic{reverse off} programs.." 1195 PRINT"Qi use 1024 thru' 2047 1200 PRINT" to store the 1{0*3} characters appearing" 1210 PRINT" on the screen,etc.etc" 1211 PRINT"(note:80 column pets have 2{0*3}) 1220 PRINT"{down}{reverse on}screen memory{reverse off}" 1230 PRINT"Qthese 1{0*3} loc'ns start at $0400" 1240 PRINT" 0400(hexadecimal)=4*256=1024(decimal)" 1245 PRINT"Qyou can change what's" 1250 PRINT" on the screen with a {reverse on}print{reverse off} statement" 1260 PRINT" {reverse on}print "CHR$(34)"abc"CHR$(34) 1270 PRINT" or by 'pokeing' screen memory:" 1280 PRINT" {reverse on}poke1100,1" 1290 PRINT"Qthis puts {reverse on}1{reverse off} into screen memory loc'n" 1300 PRINT" 1100, and {reverse on}1{reverse off} corresponds to an "CHR$(34)"a"CHR$(34) 1310 PRINT" so i'll print the letter "CHR$(34)"a"CHR$(34) 1316 GOSUB63000 1320 PRINT"{clear}to see what no. in [0,255] corresponds" 1330 PRINT"to which symbol, you can try this:" 1340 PRINT"{down}{reverse on}10 for i=0 to 255" 1350 PRINT"{reverse on}20 poke1024+i,i{space*2}" 1360 PRINT"{reverse on}30 next{space*10}" 1370 PRINT"{down*5}..and try {reverse on}poke1100,n{reverse off}" 1371 PRINT"{down}with 'n'=0,1,2,{.*3}or 255.":ms$="{space*2}{reverse on}try it!{reverse off}" 1380 PRINT"{down*2}then {reverse on}type @{reverse off} to continue!":GOSUB63100 1385 GOSUB63000:PRINT"{home}{down*2}" 1390 sn$="02{0*3}":GOTO63300 2000 GOSUB60000:PRINT"{clear}{cm +*6}{reverse on}some special locations{reverse off}{cm +*4}" 2010 PRINT:PRINT"Qin 197 i keep track of what key is" 2020 PRINT"{down} depressed. to see the {reverse on}key{reverse off} vs. {reverse on}number" 2030 PRINT"{down} correspondence, try:" 2040 PRINT"{down*2}{reverse on}50 print peek(197);" 2050 PRINT"{reverse on}60 go to 50{space*8}" 2060 PRINT"{down*2}then run and bang on a key!" 2065 PRINT"{down*2}then type {reverse on}@{reverse off} to continue." 2070 sn$="03{0*3}":GOTO63300 3000 GOSUB60000 3010 PRINT"{clear}{down}printchr$(14) will cause" 3040 PRINT"me to switch to "CHR$(34)"lower"CHR$(34)" case." 3050 PRINT"{down}you might like to try it!" 3060 PRINT"{down}in particular, try running:" 3070 PRINT"{down}{reverse on}10 for i=0 to 255{space*2}" 3071 PRINT"{reverse on}20 poke1024+i,i{space*4}" 3072 PRINT"{reverse on}30 poke55296+i,15*rnd(1)" 3073 PRINT"{reverse on}40 printchr$(14+k);" 3074 PRINT"{reverse on}50 forj=1to200: next " 3075 PRINT"{reverse on}60 k=128-k:next{space*4}" 3080 ms$="{reverse on}do a chr${reverse off}!":GOSUB63100 3082 PRINT"{home}{down*15}printchr$(142) " 3083 PRINT"will put me back to upper case." 3085 PRINT"{home}{down*18}{.*3}then type {reverse on}@{reverse off} to continue" 3090 sn$="04{0*3}":GOTO63300 4000 POKE59468,12:GOSUB60000 4040 PRINT"Qin 160,161 & 162 i keep the time" 4050 PRINT" {.*3}from the moment you turn me on." 4060 PRINT"{down}Qi've got a built-in " 4070 PRINT" crystal-controlled clock." 4080 PRINT" i keep the number of {reverse on}jiffies{reverse off} in" 4090 PRINT" memory loc'ns 160,161,162" 4100 PRINT" a {reverse on}jiffie{reverse off} is 1/60 second." 4110 PRINT"{down}Qyou could write a program to convert" 4120 PRINT" this to hours:minutes:seconds.." 4130 PRINT" or you could use my built-in routine!" 4140 PRINT"{reverse on}100 print ti$" 4150 PRINT"{down} here,ti$ will give hhmmss like so:":PRINT"{down}{reverse on}015209" 4155 PRINT"{down}{reverse on}01{reverse off}=hours {reverse on}52{reverse off}=minutes {reverse on}09{reverse off}=seconds.":GOSUB63000 4160 PRINT"{clear}{down*7}i'll print out ti$ so you can see him:" 4170 aa$=ti$:h$=LEFT$(aa$,2):m$=MID$(aa$,3,2):s$=RIGHT$(aa$,2) 4175 FORt=1TO500:NEXT 4180 PRINT"{down*2}{space*18}{reverse on}"aa$ 4190 PRINT"{space*22}^ that's him!" 4195 PRINT"{down*2}it's been:" 4196 PRINT"{down}{reverse on}"h$"{reverse off} hours,{reverse on}"m$"{reverse off} minutes & {reverse on}"s$"{reverse off} seconds" 4197 PRINT"{down}since you turned the {reverse on}c64{reverse off} on!" 4200 PRINT"{down*2}{reverse on}return{reverse off}..":GOSUB63001 4240 PRINT"{clear}you can set the correct time by typing:" 4250 PRINT"{down}{reverse on}ti$="CHR$(34)"093{0*3}"CHR$(34) 4260 PRINT"{down}then i'll count jiffies starting with" 4270 PRINT"{down}a count corresponding to 9:30 a.m." 4280 PRINT"{down}({0*6}=midnight!!)":GOSUB63000 4290 PRINT"{clear}the variable {reverse on}ti{reverse off} gives the jiffie-count" 4300 PRINT"{down}i'll print him too:":FORt=1TO500:NEXT:PRINT"{down*2}" 4310 PRINT"{space*17}{reverse on}"ti 4320 PRINT"{space*19}^ that's him!" 4330 PRINT"{down}please, don't use {reverse on}ti${reverse off} or {reverse on}ti{reverse off} for any" 4340 PRINT"{down}of your variable names!" 4350 PRINT"{space*3}{cm y*4} 4361 PRINT"{down*2}{reverse on}return{reverse off}..":GOSUB63001 4400 PRINT"{clear}{cm +*9}{reverse on}input/output{reverse off*2}{cm +*8}" 4410 PRINT"{down}Qto write data on tape you " 4420 PRINT"{down} {reverse on}open a write channel to the cassette" 4430 PRINT"Qyou'll want to give the data a {reverse on}name{reverse off},too" 4440 PRINT" and you'll want to distinguish between" 4450 PRINT" {reverse on}writing{reverse off} to tape and {reverse on}reading{reverse off} from tape." 4460 PRINT"{down}{reverse on}200 open3,1,1,"CHR$(34)"data"CHR$(34)"{reverse off}" 4470 PRINT"{down}open a channel(#3)to the tape drive(#1)" 4480 PRINT" for {reverse on}writing{reverse off} (the last #1 means {reverse on}write{reverse off})" 4490 PRINT"{down}{reverse on}210 for i=1to10" 4500 PRINT"{reverse on}220 print#3,i{space*2}" 4510 PRINT"{reverse on}230 next{space*7}" 4520 PRINT"{reverse on}240 close 3{space*4}" 4530 PRINT"{down}Qthis writes the numbers 1,2,..10" 4540 PRINT" on the tape-file called "CHR$(34)"data"CHR$(34) 4560 GOSUB63000 4570 PRINT"{clear}it's very important to {reverse on}close{reverse off} the " 4580 PRINT"{down}write channel after printing to tape!!" 4590 PRINT"{down}(else i won't print an end-marker" 4600 PRINT"and may not write the last bit of data)." 4620 PRINT"Qto {reverse on}read{reverse off} a file(called,say,'data')" 4630 PRINT"{down}{reverse on}300 open2,1,0,"CHR$(34)"data"CHR$(34) 4635 PRINT"{reverse on}310 for i=1to10{space*5}" 4640 PRINT"{reverse on}320 input#2,a(i){space*4}" 4650 PRINT"{reverse on}330 next{space*12}" 4660 PRINT"{down}here the {reverse on}read{reverse off} channel is #2" 4670 PRINT"..the last #0 means {reverse on}read{reverse off}" 4680 PRINT"{down}it is assumed there are 10 no's to read." 4700 GOSUB63000 4710 PRINT"{clear}a print# statement:" 4720 PRINT"{down}{reverse on}220 print#3,i" 4730 PRINT"{down}will write the value of i,followed by" 4740 PRINT"{down}a {reverse on}return{reverse off} & {reverse on}spaces{reverse off}!" 4745 PRINT"{down}{reverse on}you don't want the 'spaces'{reverse off}!" 4750 PRINT"{down}the correct way is:" 4760 PRINT"{down}{reverse on}220 print#3,i;chr$(13);" 4770 PRINT"{down}here {reverse on}you{reverse off} specify the {reverse on}return{reverse off}=chr$(13)" 4775 PRINT"{down}..without spaces{.*4}" 4780 PRINT"{down}the {reverse on};{reverse off} at the end avoids 'line feed' too!":GOSUB63000 4790 PRINT"{clear}the statement:" 4800 PRINT"{down}{reverse on}240 close 3" 4810 PRINT"{down}writes an end-of-file marker on tape." 4820 PRINT"{down}when {reverse on}read{reverse off}ing data you check for this:" 4830 PRINT"{down}{reverse on}if st=64 then {reverse off}{.*3}" 4840 ms$="{space*3}{reverse on}close{reverse off}!":GOSUB63100 4850 GOSUB63000 4860 PRINT"{clear}the {reverse on}write to tape{reverse off} routine is then:" 4870 PRINT"{down}{reverse on}200 open3,1,1,"CHR$(34)"data"CHR$(34)"{space*3}" 4880 PRINT"{reverse on}210 for i=1to10{space*8}" 4890 PRINT"{reverse on}220 print#3,i;chr$(13);" 4900 PRINT"{reverse on}230 next{space*15}" 4910 PRINT"{reverse on}240 close 3{space*12}" 4920 PRINT"{down}the {reverse on}read from tape{reverse off} routine is:" 4930 PRINT"{down}{reverse on}300 open2,1,0,"CHR$(34)"data"CHR$(34)"{space*10}" 4940 PRINT"{reverse on}310 input#2,a(j){space*14}" 4950 PRINT"{reverse on}320 if st<>64thenj=j+1:goto310" 4960 PRINT"{reverse on}330 close2{space*20}" 4970 GOSUB63000:sn$="05{0*3}":GOSUB63600 5000 GOSUB60000 5005 PRINT"{clear}{reverse on}to create a file{reverse off}:" 5010 PRINT"{down}{reverse on}10 open15,8,15,"CHR$(34)"i"CHR$(34)"+dr${space*9}" 5020 PRINT"{reverse on}20 open2,8,2,dr$+"CHR$(34)":"CHR$(34)"+nm$+"CHR$(34)",s,w"CHR$(34) 5030 PRINT"{reverse on}30 print#2,a;chr$(13);{space*9}" 5040 PRINT"{down}{reverse on}dr${reverse off} is drive #{space*3}Ipreviously" 5050 PRINT"{reverse on}nm${reverse off} is file name Kdefined!" 5060 PRINT"{down}{reverse on}10{reverse off} opens the command channel #15" 5070 PRINT"and {reverse on}i{reverse off}nitializes the drive dr$." 5075 PRINT"(not necessary on 'newer' drives)." 5080 PRINT"{down}{reverse on}20{reverse off} opens a {reverse on}w{reverse off}rite channel,#2," 5090 PRINT"for a {reverse on}s{reverse off}equential(data) file called nm$" 5100 PRINT"{down}{reverse on}30{reverse off} prints a number,{reverse on}a{reverse off},to the data file." 5110 PRINT"{down}Qyou may repeat statement 30":PRINT"{down}with various {reverse on}a{reverse off}'s,then.." 5120 PRINT"{down}{reverse on}40 close2:close15":PRINT 5130 GOSUB63000 5140 PRINT"{clear}{reverse on}to read from a file{reverse off}:" 5150 PRINT"{down}{reverse on}60 open15,8,15,"CHR$(34)"i"CHR$(34)"+dr${space*9}" 5160 PRINT"{reverse on}70 open2,8,2,dr$+"CHR$(34)":"CHR$(34)"+nm$+"CHR$(34)",s,r"CHR$(34) 5170 PRINT"{reverse on}80 input#2,a(j){space*16}" 5180 PRINT"{reverse on}90 ifst<>64thenj=j+1:goto80{space*4}" 5190 PRINT"{reverse on}100 close2:close15{space*13}" 5195 PRINT"{down}{reverse on}60{reverse off} initializes etc." 5200 PRINT"{reverse on}70{reverse off} opens a {reverse on}r{reverse off}ead channel to file nm$." 5210 PRINT"{reverse on}90{reverse off} checks for end-of-file(status=64)." 5216 GOSUB63000 5218 PRINT"{clear}{reverse on}to reiterate{reverse off}: when writing data{down}":PRINT"do {reverse on}not{reverse off} use:" 5219 PRINT"{down}{reverse on}print#1,a,b$,c{reverse off} or {reverse on}print#1,a;b$;c;{reverse off}" 5220 PRINT"{down}instead use:" 5221 PRINT"{down}{reverse on}print#1,a;chr$(13);b$;chr$(13);..etc" 5222 PRINT"{down}if it's painfull to type 'chr$(13)' then" 5223 PRINT"{down}define{space*2}cr$=chr$(13) and use:" 5224 PRINT"{down}{reverse on}print#1,a;cr$;b$;cr$;c;cr$;{reverse off}" 5226 GOSUB63000 5340 PRINT"{clear}{cm +*8}{reverse on}random numbers{reverse off}{cm +*11}" 5350 PRINT"{down}Qi have a {reverse on}random number generator{reverse off}." 5360 PRINT"{down}{reverse on}10 x=rnd(k)" 5365 PRINT"{down}Qeach {reverse on}negative{reverse off} k determines a" 5370 PRINT" unique {reverse on}seed{reverse off}. then:" 5375 PRINT"{down}{reverse on}20 x1=rnd(1)" 5380 PRINT"{reverse on}30 x2=rnd(1)" 5385 PRINT"{reverse on}40 x3=rnd(1)" 5390 PRINT"{down}Qhere x1,x2,x3,..is a 'random sequence'" 5391 PRINT" of numbers in 0 10 keys!" 9085 PRINT"{down}(else i won't get them all)" 9090 PRINT"{down}try it? then:" 9100 PRINT"{down}{reverse on}type @ {reverse off}":sn$="1{0*4}":GOTO63300 10000 GOSUB60000:PRINT"{clear}{cm +*6}{reverse on}6{reverse off}{cm +*6}" 10010 PRINT"{down}memory location 198 (decimal) holds" 10020 PRINT"{down}the number of characters in the " 10030 PRINT"{down}keyboard buffer." 10040 PRINT"{down}you can clear the buffer with:" 10050 PRINT"{down}{reverse on}10 fori=1to10:geta$:next" 10060 PRINT"{down}or{down}" 10070 PRINT"{reverse on}10 geta$:ifa$<>"CHR$(34)CHR$(34)"then10" 10080 PRINT"{down}or{down}" 10090 PRINT"{reverse on}10 poke198,0" 10100 GOSUB63000 11000 PRINT"{clear}{cm +*6}{reverse on}7{reverse off}{cm +*6}" 11010 PRINT"{down}memory locations 55 and 56 hold the" 11020 PRINT"{down}location of the 'end of basic memory'." 11030 PRINT"{down}print it out by typing:" 11040 PRINT"{down}{reverse on}?peek(55)+256*peek(56)" 11050 PRINT"{down*2}then{space*3}{reverse on}type @" 11060 PRINT"{down*3}?peek(55)+256*peek(56){up}":sn$="12{0*3}":GOTO63300 12000 GOSUB60000:x=32768 12020 PRINT"{clear}{cm +*6}{reverse on}8{reverse off}{cm +*6}suppose top="x 12030 PRINT"{down}if you want to store some numbers" 12040 PRINT"{down}for safe keeping, you can change the" 12050 PRINT"{down}top of basic memory, by poking a new{down}{left*3}{cm u*3}" 12060 PRINT"'top' into 55 & 56, so the new top is":x$=MID$(STR$(x-100),2) 12070 PRINT"{down}say, "x$", giving you 100 places" 12080 PRINT"{down}to store your numbers." 12090 PRINT"{down}how to store them? {reverse on}poke{reverse off} them into ram!" 12100 PRINT"{down}{reverse on}10 fori=0to99:poke"x$"{reverse on}+i,a(i):next":GOSUB63000 13000 PRINT"{clear}{cm +*6}{reverse on}9{reverse off}{cm +*6}" 13010 PRINT"{down}every jiffy (60 times/second) i" 13020 PRINT"{down}stop what i'm doing and update the" 13030 PRINT"{down}jiffy clock,and..among other things.." 13040 PRINT"{down}check to see if you pressed the" 13050 PRINT"{down}{reverse on}run/stop{reverse off} key{.*3}" 13060 PRINT"{down}..and, if so, then i will stop!{down}{left*5}{cm u*4}" 13070 PRINT"{down}i do these things (60 times/second)" 13080 PRINT"{down}by jumping to a magic memory location." 13090 GOSUB63000 13100 PRINT"{clear}this magic location is stored in" 13110 PRINT"{down}memory locations 788 & 789." 13120 PRINT"{down}i jump to {reverse on}peek(788)+256*peek(789)" 13130 PRINT"{down*2}hold on..i'll tell you where i jump{.*3}":GOSUB63000 13140 PRINT"{clear}{down*2}{.*4}it's to"; 13150 a9=7*4096+15*256+14*16+10:ml=PEEK(a9)+256*PEEK(a9+1):PRINT"{reverse on}"ml 13160 PRINT"{down}at location"ml" are instructions" 13170 PRINT"{down}which check for {reverse on}stop{reverse off}, etc.." 13180 PRINT"{down}you can bypass the 'check for stop'" 13190 PRINT"{down}by having me jump to {reverse on}"ml+3"{reverse off}!!" 13200 PRINT"{down}..simply {reverse on}poke788,peek(788)+3" 13210 PRINT"{down}in a program and {reverse on}stop{reverse off} will be ignored!" 13220 GOSUB63000 13230 PRINT"{clear}{reverse on}but remember to {reverse on}poke788,peek(788)-3" 13240 PRINT"{down}later in the program.." 13250 PRINT"{down*2}care (dare) to try it??" 13260 PRINT"{down}remember:" 13270 PRINT"{down}{reverse on}poke788,peek(788)+3" 13280 PRINT"{down}then write a program like:" 13290 PRINT"{down}10 fori=1to1{0*4}:next" 13300 PRINT"{down}and try to stop it." 13400 PRINT"{down}eventually..type:" 13410 PRINT"{down}{reverse on}poke788,peek(788)-3" 13420 PRINT"{down}..come to think of it.." 13430 PRINT"{down}try it {reverse on}after{reverse off} you've ended {reverse on}tutor{reverse off}!":GOSUB63000 14000 PRINT"{clear}{reverse on}the sys command" 14010 PRINT"{down}i don't understand 'basic'." 14020 PRINT"{down}i understand 'machine language'." 14030 PRINT"{down}however i have a built-in interpreter" 14040 PRINT"{down}who understands both!" 14050 PRINT"{down}he translates your basic commands" 14060 PRINT"{down}into machine language commands for me." 14070 PRINT"{down}this 'basic interpreter' is a set of" 14080 PRINT"{down}machine language instructions which" 14090 PRINT"{down}reside in memory from 40960." 14105 PRINT"{down}that is: $a{0*3}" 14110 GOSUB63000 14120 PRINT"{clear}machine language instructions are" 14130 PRINT"{down}numbers from 0 to 255..and each means" 14140 PRINT"{down}something special." 14150 PRINT"{down}for example the sequence of numbers:" 14160 PRINT"{down}{reverse on}169{reverse off} {reverse on}170{reverse off} {reverse on}141{reverse off} {reverse on}0{reverse off} {reverse on}4{reverse off}" 14170 PRINT"{down}says to put an asterisk in the upper" 14180 PRINT"{down}left corner of the screen." 14190 PRINT"{down*2}here are some 'instructions' taken from" 14200 PRINT"the interpreter 'himself' (herself?):":GOSUB63000:PRINT"{up*7}" 14210 FORi=0TO15:PRINTPEEK(40960+i);:FORj=1TO100:NEXT:NEXT 14230 GOSUB63000 14240 PRINT"{clear}ok{.*3}if you can talk machine language" 14250 PRINT"{down}then you can put your m-l program" 14260 PRINT"{down}into memory starting at some" 14270 PRINT"{down}location, say 2{0*4}, then {reverse on}sys 2{0*4}" 14280 PRINT"{down}will send me there to obey." 14290 PRINT"{down}you might stick your program up at the" 14300 PRINT"{down}'top of basic ram' somewhere and" 14310 PRINT"{down}protect it from being overwritten" 14320 PRINT"{down}by changing 'top' (at 55/56 remember?)" 14330 GOSUB63000 14340 PRINT"{clear}{down*2}" 14350 PRINT"10 fori=25{0*3}to25024:readk:pokei,k:next:end" 14360 PRINT"20 data 162,4,160,4,132,177,160,0,132,176,177,176,73,128" 14370 PRINT"30 data 145,176,200,208,247,230,177,202,208,242,96" 14371 PRINT"run10" 14372 PRINT"{down*2}sys25{0*3}" 14375 PRINT"{down*2}{reverse on}here's a m-l program you can try" 14380 PRINT"{down*2}enter these, then {reverse on}run10{reverse off}, then {reverse on}sys25{0*3}" 14390 PRINT"{down*2}(then {reverse on}type @{reverse off} to continue)" 14400 PRINT"{home}{down*2}":sn$="15{0*3}":GOTO63300 15000 GOSUB60000:PRINT"{clear}":ms$=" {reverse on}slick eh?{reverse off}":GOSUB63100 15010 PRINT"{clear}one m-l instruction which is nice" 15020 PRINT"{down}is zero (i mean 0)." 15030 PRINT"{down}this instruction tells me to jump to the" 15040 PRINT"{down}'{reverse on}m{reverse off}achine {reverse on}l{reverse off}anguage {reverse on}m{reverse off}onitor'." 15050 PRINT"{down}(i like the {reverse on}mlm{reverse off} so much i sometimes" 15060 PRINT"{down}jump there on my own!)" 15070 PRINT"{down}to get out of the mlm just type an 'x'" 15080 PRINT"{down}and hit the 'return' key." 15085 GOSUB63000 15086 PRINT"{clear}the 'standard' c64 doesn't have a {reverse on}mlm{reverse off}." 15087 PRINT"{down}you can use jim butterfield's{.*3}":PRINT"{down}just:" 15088 PRINT"{down}load"CHR$(34)"buttermon*"CHR$(34)",8,1" 15089 PRINT"{down}new":PRINT"{down}sys5{0*4}":PRINT"{down}x and {reverse on}return{reverse off}.":GOSUB63000 15090 PRINT"{clear}let's try jumping to the mlm." 15100 PRINT"{down}hit a key when you're ready to try." 15110 PRINT"{down}{reverse on} remember how to get out! " 15115 PRINT"{down}{reverse on} type 'x' then hit 'return' " 15120 PRINT"{down*4}then {reverse on}@{reverse off} to continue..":sn$="16{0*3}":GOSUB63600 15130 GOSUB63001:sn$="16{0*3}":GOSUB63600 15140 SYS2048:GOSUB63000 16000 GOSUB60000:PRINT"{clear}ok..if you{down}{left*3}{cm u*3}{up} want to enter the mlm" 16010 PRINT"{down}you can find any memory location which" 16020 PRINT"{down}contains '0' and send me there with {reverse on}sys{reverse off}." 16030 PRINT"{down}one good place is 2048. it always.." 16040 PRINT"{down}{.*5}well , almost always{.*4}" 16050 PRINT"{down}contains '0'." 16060 PRINT"{down*2}try {reverse on}sys2048{reverse off}. (remember 'x' to exit)" 16070 PRINT"{down*2}then {reverse on}type @{reverse off} to continue..":sn$="17{0*3}":GOTO63300 17000 GOSUB60000:PRINT"{clear}once in the mlm you can display the" 17010 PRINT"{down}contents of memory more easily than" 17020 PRINT"{down}with peek(this) and peek(that)." 17030 PRINT"{down}having done your {reverse on}sys2048{reverse off} i'll give{down}" 17040 PRINT"b*" 17050 PRINT"{space*5}pc{space*2}sr ac xr yr sp 17060 PRINT".;{space*2}0801 30 30 3a 2a f7 17070 PRINT". 17080 PRINT"{down}now if you type :" 17090 PRINT"{down}.{reverse on}m a{0*3} a00f" 17100 PRINT"{down}so it looks like:" 17105 GOSUB63000 17110 PRINT"{clear}{down}b*" 17120 PRINT"{space*5}pc{space*2}sr ac xr yr sp 17130 PRINT".;{space*2}0801 32 04 5e 00 f8 17140 PRINT".m a{0*3} a00f 17150 PRINT"{down*2}then hit 'return'{.*3}i'll display memory" 17160 PRINT"{down}from a{0*3} to a00f (that's hexadecimal!)" 17170 PRINT"{down}try it! (remember 'x' to exit mlm)":PRINT"{down*2}then {reverse on}type @{reverse off}" 17180 sn$="18{0*3}":GOTO63300 18000 GOSUB60000:PRINT"{up*2}{cm +*38}" 18005 PRINT"{down}notice that the numbers i display are" 18010 PRINT"{down}in {reverse on}hexadecimal{reverse off}!" 18020 PRINT"{down}in fact you've seen them before." 18030 PRINT"{down}they're from 'the interpreter'." 18040 PRINT"{down}i last gave them to you in 'decimal'." 18050 PRINT"{down}({reverse on}peek{reverse off} always gives decimal){down}" 18060 GOSUB63000:PRINT"{clear}" 18070 ms$="{reverse on}au revoir!{reverse off}":GOSUB63100:GOSUB63500:END 59000 PRINT"{clear}":GOSUB63100 59001 PRINT"{home}during the tutorial you may wish" 59002 PRINT"{down}to return to an earlier 'page'." 59003 PRINT"{down}just {reverse on}hit the @-key{reverse off}, at any time," 59004 PRINT"{down}and the tutorial will back up" 59005 PRINT"{down}a page or two." 59006 PRINT"{down}also, you have an opportunity to" 59007 PRINT"{down}compose your own programs." 59008 PRINT"{down}when you wish to continue with" 59009 PRINT"{down}the tutorial, {reverse on}hit the @-key{reverse off}!":GOSUB63000 59010 ms$="{reverse on}@{reverse off}{arrow left}remember":GOSUB63100 59020 GOSUB63000:RETURN 60000 POKE204,1:REM initialize 60001 bt$="{home}":FORi=1TO24:bt$=bt$+"{down}":NEXT 60002 pt$="{red}{cm a}{sh asterisk*10}{cm s}{down}{left*12}{sh -}{right*10}{sh -}{down}{left*12}{cm z}{cm r}{sh asterisk*8}{cm r}{cm x}" 60003 pt$=pt$+"{down}{left*13}N{cm t*12}M{down}{left*14}{cm g}{=*12}{cm m}" 60004 pt$=pt$+"{down}{left*14}PO{cm t*10}PO{up*4}{left*12}" 60005 pt$=bt$+"{up*6}{right*26}"+pt$+"{black}" 60007 ml$="{home}{down*9}{right*27}" 60008 wd=40:crt=1024:PRINTCHR$(142) 60009 w2=wd/2:w3=wd-1:w1$=MID$(STR$(wd),2): 60010 w2$=MID$(STR$(w2),2):w3$=MID$(STR$(w3),2) 60020 PRINT"{clear}":POKE53281,15:POKE53280,12:PRINT"{black}" 60998 IFPEEK(789)<>7*16+15THENSYS(7*4096+15*256+12*16+3) 60999 RETURN 61000 REM*new workspace 61001 m=7*4096+15*256+15*16 61002 RESTORE 61003 FORi=mTOm+15:READk:POKEi,k:NEXT 61004 DATA 1,96,3,96,3,96,3,96 61005 DATA 144,127,0,0,144,127,0,0 61006 m=6*4096:FORi=0TO2:POKEm+i,0:NEXT 61007 RETURN 63000 PRINT"{home}{down*24}hit {reverse on}return{reverse off} to continue"; 63001 GETa$:IFa$<>""THEN63001 63002 GETa$:IFa$=""THEN63002 63003 RETURN 63100 FORt=1TO5:PRINTpt$ms$; 63101 PRINTpt$"{space*10}"; 63102 PRINTpt$ms$;:NEXT 63103 PRINT:RETURN 63200 POKE56,96:POKE52,96:POKE55,0:POKE51,0:GOSUB61000 63201 wd=40:crt=1024:POKEcrt,96:IFPEEK(crt+1024)<>96THENwd=80:PRINTCHR$(142) 63202 m=7*4096+15*256+9*16 63203 FORi=mTOm+91:READk:POKEi,k:NEXT 63204 DATA165,203,201,46,208,83,32,195,127,165,44,201,8,240,3,32,177,127,32 63205 DATA142,166,165,44,201,8,240,3,76,128,164,76,174,167,162,16,189,239 63206 DATA127,72,181,42,157,239,127,104,149,42,202,208,241,96,120,173,238,127 63207 DATA77,20,3,141,20,3,173,239,127,77,21,3,141,21,3,88,96,173,20,3,73 63208 DATA144,141,238,127,173,21,3,73,127,141,239,127,96,76,255,255 63216 POKEm+90,PEEK(788):POKEm+91,PEEK(789) 63220 key=7*4096+15*256+13*16+8 63221 SYS(key):REM key for irq swap 63299 RETURN 63300 REM*switch to new workspace 63301 GOSUB63600:REM run number 63302 GOSUB61000:REM new the workspace 63303 GOTO63403 63400 REM*switch to old workspace 63401 GOSUB63600 63403 swtch=7*4096+15*256+9*16+15 63404 SYS(swtch):REM swap pointers 63405 POKE204,2:END 63500 REM*restore pet 63501 sn$="100":GOSUB63600 63502 m=7*4096+15*256+12*16+3:IFPEEK(789)=7*16+15THENSYSm 63503 RETURN 63600 REM*insert run number 63601 m=2059:sn$="{0*5}"+sn$ 63602 FORi=1TO5:POKEm-i,ASC(RIGHT$(sn$,i)):NEXT:RETURN stop tok64 (bastext 1.0)