start bastext 1025 start tok64 d64-ap5t9n 1 RUN00010 10 GOSUB63100:sn$="00100" 100 POKE53281,15:POKE53280,12:PRINT"{black}":PRINT"{clear}{space*11}{reverse on}{blue}micros'n'chips-5" 101 PRINT"{red}{cm a}{sh asterisk*37}{cm s}":GOSUB63100 102 PRINT"{sh -} {reverse on}{blue}{space*10}more on memory{space*11}{red}{reverse off} {sh -}":ms$="ponzotutor" 103 PRINT"{red}{cm z}{sh asterisk*37}{cm x}{black}":GOSUB63200 104 ms$=" welcome! ":GOSUB63200:POKE53280,15 105 PRINT"{home}{down*10}Qnote{down}{left*4}{cm u*4}{up}:hit the @-key at any" 106 PRINT"{down}{space*6}time to return to an":PRINT"{down}{space*6}earlier section{.*3}":GOSUB50000 1000 GOSUB63100:REM micros-1 1001 sn$="01{0*3}" 1005 t$="dynamic ram":GOSUB63000 1010 PRINT"{down*2}Qyou may recall in the first of this" 1020 PRINT"{down} series of tutorials that we talked" 1030 PRINT"{down} about static{down}{left*6}{cm u*6}{up} {reverse on}r{reverse off}andom {reverse on}a{reverse off}ccess {reverse on}m{reverse off}emory." 1040 PRINT"{down}Qa 2k-byte ram chip would have 11 wires" 1050 PRINT"{down} from the address bus go to the" 1060 PRINT"{down} ram chip (to identify one of 2^11" 1070 PRINT"{down} internal memory locations) and the " 1080 PRINT"{down} remaining 5 wires would go to the" 1090 PRINT"{down} address decoder.":GOSUB50000:GOSUB54000:ms$="remember?":GOSUB50000 1095 GOSUB63300 1100 PRINT"{clear}{down}Qalthough convenient, static ram is" 1110 PRINT"{down} rarely used in a micro{.*3}it's a bigger" 1120 PRINT"{down} and more expensive chip (for the same" 1130 PRINT"{down} amount of memory) than {.*3}":t$="{space*2}dynamic ram{space*2}" 1140 GOSUB63001:GOSUB50000 1150 PRINT"{down*2}Qlet's build a dynamic ram memory chip!":ms$="yes! yes!" 1160 GOSUB50000:GOSUB63300 1170 PRINT"{clear}{down}Qif we use all 16 bits of the address" 1180 PRINT"{down} bus to address one of 2^16=64k" 1190 PRINT"{down} internal memory locations that will" 1200 PRINT"{down} require 16 pins." 1210 PRINT"{down}Qif each memory location holds 8 bits" 1220 PRINT"{down} then we'll need 8 more pins to connect" 1230 PRINT"{down} to the data bus." 1240 PRINT"{down}Qwith chip enable, read/write, +5 volts" 1250 PRINT"{down} and ground pins we're up to":PRINT"{down} {reverse on}27 pins{reverse off}!":GOSUB50000 1260 PRINT"{down}Qlet's do it differently!":GOSUB50000 1270 PRINT"{clear}Qwe'll build a 64k {reverse on}bit{reverse off} memory chip!" 1280 PRINT"{down} (each internal memory location will" 1290 PRINT"{down} hold a single bit{.*3}{reverse on}1{reverse off} or {reverse on}0{reverse off})." 1300 PRINT"{down}Qwe'll then need eight of these 64k bit" 1310 PRINT"{down} chips to make 64k {reverse on}bytes{reverse off}!" 1315 PRINT"{down}Qeach chip will supply one bit for" 1316 PRINT"{down} the 8-bit data bus." 1317 PRINT"{down}Qwhen a chip enable goes out..it goes" 1318 PRINT"{down} to {reverse on}all{reverse off} eight 64k-bit memory chips!" 1319 PRINT"{down}{.*3}and read/write too{.*3}":GOSUB50000:PRINT"{clear}" 1320 PRINT"{sh asterisk*30}Q{sh asterisk*2} 1321 PRINT"{sh asterisk*2}data{sh asterisk*20}Q{sh asterisk*3}{sh +}{sh asterisk*2} 1322 PRINT"{sh asterisk*3}bus{sh asterisk*16}Q{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*2} 1323 PRINT"{sh asterisk*18}Q{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*2} 1324 PRINT"{sh asterisk*14}Q{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*2} 1325 PRINT"{sh asterisk*10}Q{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*2} 1326 PRINT"{sh asterisk*6}Q{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*2} 1327 PRINT"{sh asterisk*2}Q{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*3}{sh +}{sh asterisk*2} 1328 PRINT"{space*2}{sh -}{space*3}{sh -}{sh space*2} {sh -}{sh space} {sh space}{sh -}{sh space*2} {sh -}{sh space*2} {sh -}{sh space*2} {sh -}{sh space*2} {sh -} 1329 FORi=1TO8:PRINT"{cm a}{sh asterisk}{cm e}{cm s}";:NEXT:PRINT 1330 FORj=1TO2:FORi=1TO8:PRINT"{sh -}{sh space} {sh -}";:NEXT:PRINT:NEXT 1332 FORi=1TO8:PRINT"{cm z}{cm r*2}{cm x}";:NEXT:PRINT 1333 FORi=1TO8:PRINT" ^{sh -} ";:NEXT:PRINT 1334 FORi=1TO8:PRINT"{sh asterisk}Q{sh +}{sh asterisk}";:NEXT:PRINT"{sh asterisk*2}ce{up}{left*2}FF{down}" 1335 FORi=1TO8:PRINT"{sh asterisk*2}Q{sh asterisk}";:NEXT:PRINT"{sh asterisk*3}r/w{up}{left}F{down}" 1340 PRINT"{down}Qand all 16 bits of the address bus" 1350 PRINT"{down} are connected to each chip too!":GOSUB50000 1360 PRINT"{clear}{down}Qthat will require how many pins?" 1370 PRINT"{down}16(address)+1(data)+1(r/w{up}{left}F{down})+1(ce{up}{left*2}FF{down})" 1375 PRINT"{down}+1(+5 volts)+1(ground){.*3}" 1380 PRINT"{down}Qthat makes 21 pins which is better{.*3}":GOSUB50000 1390 PRINT"{down}Qlet's do it differently!":ms$="{reverse on}{space*2}again?{space*2}{reverse off}":GOSUB63300 1400 PRINT"{clear}{down}Qwe won't connect all 16 address bus" 1410 PRINT"{down} bits to the chip at one time." 1420 PRINT"{down}Qwe'll give the chip 8 bits (a0 to a7)" 1430 PRINT"{down} and tell it to remember those." 1440 PRINT"{down}Qthen we'll give it 8 more (a8 to a15)." 1450 PRINT"{down}Qthen we'll expect the chip to " 1460 PRINT"{down} identify the internal memory" 1470 PRINT"{down} location from the 16 bits that" 1480 PRINT"{down} we gave it (8-at-a-time).":ms$="oh yeah!":GOSUB50000:GOSUB63300 2000 GOSUB63100:REM micros-2 2001 sn$="02{0*3}" 2010 t$="inside the dynamic ram":GOSUB63000:PRINT"{down*3}" 2100 PRINT"{space*8}{sh -} {sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{space*2}.{space*2}{sh -} {sh -}{sh space}{sh -} 2101 PRINT"{space*8}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space} .{sh space} {sh -}{sh space}{sh -}{sh space}{sh -} 2102 PRINT"{space*5}U {sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk} . {sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk} 2103 PRINT"{space*5}{sh -}{space*2}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space*2}.{sh space} {sh -}{sh space}{sh -}{sh space}{sh -} 2104 PRINT"{space*5}{sh -} {sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}{sh space}.{sh space}{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk} 2105 PRINT"{space*5}{sh -}{space*2}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space*2}.{space*2}{sh -}{sh space}{sh -}{sh space}{sh -} 2106 PRINT"256{space*2}K{space*2}. . . . . {sh space}. {sh space}. . . 2107 PRINT"rows I{space*2}. . . . . {sh space}. {sh space}. . . 2108 PRINT"{space*5}{sh -}{space*2}{sh -} {sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space*2}. {sh space}{sh -}{sh space}{sh -}{sh space}{sh -} 2109 PRINT"{space*5}{sh -} {sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}{sh space}.{sh space}{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk} 2110 PRINT"{space*5}{sh -}{space*2}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space*2}. {sh space}{sh -}{sh space}{sh -}{sh space}{sh -} 2111 PRINT"{space*5}J {sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}{sh space}. {sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk} 2112 PRINT"{space*8}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space}{sh -}{sh space*2}.{space*2}{sh -}{sh space}{sh -}{sh space}{sh -} 2113 PRINT" 2114 PRINT"{space*8}J{sh asterisk*8}IU{sh asterisk*7}K 2115 PRINT"{space*17}256" 2116 PRINT"{space*16}columns" 2120 GOSUB50000:l$="":FORi=1TO39:l$=l$+"{sh asterisk}":NEXT 2130 PRINT"{home}Qwhen we give the 64k-bit chip the" 2140 PRINT"address bus bits a0-a7, the chip" 2150 PRINT"selects one of 2^8=256 {reverse on}rows{reverse off}.":PRINTl$:GOSUB50000 2160 PRINT"{home}{down*10}{right*7}{reverse on}{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}{sh space}.{sh space}{sh asterisk}Q{sh asterisk}Q{sh asterisk}Q{sh asterisk}":GOSUB50000 2170 PRINT"{home}Qwhen we give the 64k-bit chip the" 2180 PRINT"address bus bits {reverse on}a8-a15{reverse off}, the chip" 2190 PRINT"selects one of 2^8=256 {reverse on}columns{reverse off}.":GOSUB50000 2200 PRINT"{home}{down*6}{right*12}{reverse on}{sh -}{down}{left}{sh -}{down}{left}Q{down}{left}{sh -}{down}{left}Q{down}{left}{sh -}{down}{left}.{down}{left}.{down}{left}{sh -}{down}{left}Q{down}{left}{sh -}{down}{left}Q{down}{left}{sh -}" 2210 GOSUB50000:d$="{home}{down*10}{right*12}":FORi=1TO6 2220 PRINTd$"Q":FORt=1TO100:NEXT:PRINTd$"{reverse on}Q":FORt=1TO100:NEXT:NEXT 2230 PRINT"{home}Qnow the chip has found {reverse on}one{reverse off}{space*8}" 2240 PRINT"of 65536 memory locations.{space*12}" 2250 PRINT"{space*37}":GOSUB50000 2260 PRINT"{home}Qnote that 256*256=65536=64k{.*3}{space*6}" 2270 FORi=1TO2:PRINT"{space*38}":NEXT:GOSUB50000 2290 PRINT"{home}Qbut there's something missing{.*3}{space*4}":GOSUB50000 2300 PRINT"{clear}{down}Qhow's the chip to know when 8 bits" 2310 PRINT"{down} from the address bus is for the" 2320 PRINT"{down} {reverse on}row{reverse off} and when for the {reverse on}column{reverse off}?":GOSUB50000 2330 PRINT"{down}Qwe'll have to use two pins for:" 2350 PRINT"{down} {reverse on}r{reverse off}ow{space*4}{reverse on}a{reverse off}ddress {reverse on}s{reverse off}elect (ras{up}{left*3}{F*3}{down})" 2360 PRINT"{down} {reverse on}c{reverse off}olumn {reverse on}a{reverse off}ddress {reverse on}s{reverse off}elect (cas{up}{left*3}{F*3}{down})." 2370 PRINT"{down}Qwhen ras{up}{left*3}{F*3}{down}=0 then the chip will" 2380 PRINT"{down} take the 8 bits on its address pins" 2390 PRINT"{down} to identify the {reverse on}row{reverse off}.":GOSUB50000 2400 PRINT"{down}Qwhen cas{up}{left*3}{F*3}{down}=0 then the chip will" 2410 PRINT"{down} take the 8 bits on its address pins" 2420 PRINT"{down} to identify the {reverse on}column{reverse off}.":GOSUB50000 3000 GOSUB63100:REM micros-3 3001 sn$="03{0*3}" 3005 t$="talking to a dynamic ram":GOSUB63000 3010 PRINT"{down*2} to write:":PRINT" {cm u*8}" 3020 p$="{right*25}" 3030 GOSUB3500 3040 PRINT"{home}{down*8}Qput a0-a7 on the":PRINT" address pins.":PRINTp$"{right*2}{up}"; 3050 FORi=7TO0STEP-1:PRINT"a"CHR$(48+i)"{down}{left*2}";:NEXT:GOSUB50000 3060 PRINT"{home}{down*10}Qset ras=0":q$="{home}":FORi=1TO18:q$=q$+"{down}":NEXT 3070 FORi=1TO26:q$=q$+"{right}":NEXT:PRINTq$"ras{up}{left*3}{F*3}":GOSUB50000 3080 PRINT"{home}{down*11}Qset r/w=0" 3090 PRINTq$"{right*6}{down*5}r/w{up}{left}F":GOSUB50000 3100 PRINT"{home}{down*12}Qput a8-a15 on the":PRINT" address pins.{up*5}" 3110 PRINTp$" ";:FORi=15TO8STEP-1:x$=MID$(STR$(i),2):IFi<10THENx$=x$+" " 3115 PRINT"a"x$"{down}{left*3}";:NEXT 3120 GOSUB50000:PRINT"{home}{down*14}Qset cas=0":PRINTq$"{down*2}cas{up}{left*3}{F*3}" 3125 GOSUB50000:PRINT"{home}{down*15}Qand we're done!" 3130 GOSUB50000:PRINT"{clear}{down}Q..and if we build our chip" 3140 PRINT"{down} right, we won't need a chip enable" 3150 PRINT"{down} since the 1/0-states of the ras/cas" 3160 PRINT"{down} pins will tell the chip if it is" 3170 PRINT"{down} being spoken to!":GOSUB50000 3180 PRINT"{down}Qand why is it called {reverse on}dynamic{reverse off} ram?":GOSUB50000 3190 PRINT"{down}Qbecause it forgets its bits and" 3200 PRINT"{down} must constantly be refreshed.{down}{left*10}{cm u*9}":GOSUB50000 3210 PRINT"{clear}{down}Qevery 2 milliseconds or so the" 3220 PRINT"{down} dynamic ram must be accessed else" 3230 PRINT"{down} {reverse on}it loses its bits{reverse off}!" 3240 PRINT"{down}Qto refresh a dynamic ram each row" 3250 PRINT"{down} (at least) must be addressed every" 3260 PRINT"{down} couple of milliseconds." 3270 PRINT"{down}Qjust cycle thru' the 256 rows (by" 3280 PRINT"{down} changing a0-a7 from {0*4} {0*4} to" 3290 PRINT"{down} {1*4} {1*4}) and do the whole thing" 3295 PRINT"{down} in 2 milliseconds!":GOSUB50000 3300 PRINT"{clear}{down*9}Qand who looks after the ras{up}{left*3}{F*3}{down} and cas{up}{left*3}{F*3}{down}" 3305 PRINT"{down} and refresh{down}{left*7}{cm u*7}{up}?":GOSUB50000:PRINT"{clear}{down*10}" 3310 t$="the video chip !!":ms$="nice chip!":GOSUB63001:GOSUB63300 3320 PRINT"{clear}{down*2}Qand it does all this when the {reverse on}6510{reverse off}" 3330 PRINT"{down} isn't looking!":GOSUB50000 3340 PRINT"{down} (or at least when the {reverse on}6510{reverse off} isn't" 3350 PRINT"{down} using the busses so the micro" 3360 PRINT"{down} isn't slowed down).":GOSUB50000:GOTO4000 3500 PRINTp$"data {sh asterisk*2}Q{sh asterisk*2}bit 3501 PRINTp$"{space*7}{sh -} 3502 PRINTp$"{space*5}{cm a}{sh asterisk}{cm e}{sh asterisk}{cm s} 3503 FORu=1TO8:PRINTp$"{space*4}{sh asterisk}{cm w}{space*3}{sh -}":NEXT 3512 PRINTp$"{space*5}{sh -}{reverse on}ram{reverse off}{sh -} 3513 PRINTp$"{space*4}{sh asterisk}{cm w}{space*3}{sh -} 3514 PRINTp$"{space*5}{sh -}{sh space*3}{sh -} 3515 PRINTp$"{space*4}{sh asterisk}{cm w}{sh space*3}{sh -} 3516 PRINTp$"{space*5}{cm z}{cm r}{sh asterisk}{cm r}{cm x} 3517 PRINTp$"{space*3}{sh space}{space*2}{sh -} {sh -}{home}" 3518 RETURN 4000 GOSUB63100:REM micros-4 4001 sn$="04{0*3}" 4005 t$="the bit switch":GOSUB63000 4010 GOSUB56000:f$="{home}{down*11}{right*11}":g$="select":nt=2:GOSUB55000 4020 f$=f$+"{down*10}":GOSUB55000 4080 PRINTp$"Qin order to feed ram" 4090 PRINTp$"{down} the appropriate 8 bits" 4100 PRINTp$"{down*2} from the address bus, we":PRINTp$"{down*3}"; 4120 PRINT" use another magic chip.":PRINTp$"{down*4}Qthe {reverse on}74257{reverse off} data selector."; 4121 PRINT"{down}{left*14}{cm u*13}":p$="":FORi=1TO15:p$=p$+"{right}":NEXT 4125 PRINT"{down*3}"p$"Qit directs 4 inputs" 4126 PRINTp$" to the output." 4127 PRINTp$"Qwhich 4? depends upon" 4128 PRINTp$" a {reverse on}select{reverse off} pin." 4129 PRINTp$"Qtry it!":PRINTp$" {reverse on}type 'q' to quit{space*2}" 4130 tt$="{home}{down*5}{right*11}":bb$=tt$+"{down*10}" 4135 st$="{home}{down*11}{right*17}":sb$=st$+"{down*10}":GOSUB50000 4150 PRINTtt$;:FORi=4TO7:PRINT"a"MID$(t$,2*i+1,2)"{down}{left*3}";:NEXT 4160 PRINTbb$;:FORi=4TO7:PRINT"a"MID$(b$,2*i+1,2)"{down}{left*3}";:NEXT 4180 PRINTst$"={reverse on}1{reverse off} {reverse on}{red}(send x thru){black}":PRINTsb$"={reverse on}1{reverse off} {reverse on}{red}(send x thru){black}" 4185 GOSUB50000:IFa$="q"THEN4300 4190 PRINTtt$;:FORi=1TO4:PRINT"a"MID$(t$,2*i-1,2)"{down}{left*3}";:NEXT 4200 PRINTbb$;:FORi=1TO4:PRINT"a"MID$(b$,2*i-1,2)"{down}{left*3}";:NEXT 4210 PRINTst$"={reverse on}0{reverse off} {reverse on}{red}(send y thru){black}":PRINTsb$"={reverse on}0{reverse off} {reverse on}{red}(send y thru){black}" 4215 GOSUB50000:IFa$="q"THEN4300 4220 GOTO4150 4300 f$=f$+"{down}":g$="{?*6}":nt=10:GOSUB55000:GOSUB50000 4301 PRINT"{clear}{down*7}{.*3}but that's another story.":ms$="patience!":GOSUB63200 4305 GOSUB50000:PRINT"{clear}{down}Qthe 8 output wires go to the ram" 4310 PRINT"{down} address pins." 4320 PRINT"{down}Qthe {reverse on}select{reverse off} pin just goes up & down" 4330 PRINT"{down} and sends the dynamic ram a0-a7.." 4340 PRINT"{down} then a8-a15{.*3}then a0-a7..etc." 4350 PRINT"{down}Qwhen {reverse on}select{reverse off}=0 the top 8 bits (a8-a15)" 4360 PRINT"{down} go to the dynamic ram address pins." 4370 PRINT"{down}Qso{.*4}guess who {reverse on}select{reverse off} is{?*3}":GOSUB50000 4375 t$="column address select":GOSUB63001 4380 ms$="{reverse on}{space*3}cas!{space*3}{reverse off}":GOSUB63200:GOSUB50000 5000 GOSUB63100:REM micros-5 5001 sn$="05{0*3}" 5005 t$="{.*6}and here's vic!":GOSUB63000:ms$="{space*2}ready?":GOSUB63200:GOSUB50000 5010 PRINT"{clear}";:GOSUB53200:nt=2 5020 f$="{home}{down*8}{right*15}" 5030 g$="Q{space*2}Q{down}{left*4} {cm n}{space*2}{down}{left*4} MN ":GOSUB55000 5040 PRINTf$"{space*4}{down}{left*4}{space*4}{down}{left*4}{space*4}":nt=10 5125 p$="{home}{down*8}":FORi=1TO25:p$=p$+"{right}":NEXT 5126 f$="{home}{down*18}{right*7}":g$="ce":GOSUB55000 5130 PRINTp$"Qwhere does ce{up}{left*2}FF{down}" 5131 PRINTp$"{down*2}(chip enable)":PRINTp$"{down*4} come from?":GOSUB50000 5132 PRINT"{clear}";:GOSUB53000:ms$="remember?" 5133 f$="{home}{down}{right*15}":g$="video":GOSUB55000:GOSUB50000:GOSUB63200 5140 GOSUB50000:PRINT"{clear}";:GOSUB53200 5141 f$="{home}{down*4}{right*2}":g$="14":GOSUB55000 5155 PRINTp$"Qnote{down}{left*4}{cm u*4}{up}:only 14" 5156 PRINTp$"{down*2} wires of the" 5157 PRINTp$"{down*4} address bus!":GOSUB50000 5160 PRINT"{clear}{down}Qalthough the vic chip can address" 5170 PRINT"{down} memory (like the {reverse on}6510{reverse off}), it has access" 5180 PRINT"{down} to only the bottom 14 bits of the" 5190 PRINT"{down} address bus." 5200 PRINT"{down}Qsince 2^14=16k, ol' vic can only talk" 5210 PRINT"{down} to 16k of memory." 5220 PRINT"{down}Qwhen vic puts on 14 bits who puts on" 5230 PRINT"{down} the last 2 bits?":GOSUB50000:ms$="{reverse on} cia #2 ! ":GOSUB63300 5235 PRINT"{clear}{down*6}{.*3}but that's another story..":ms$="patience!":GOSUB63200 5340 GOSUB50000:PRINT"{clear}{down}Qwhen does the {reverse on}6510{reverse off} get on the" 5350 PRINT"{down} address bus{.*4}and when does {reverse on}vic{reverse off}?" 5351 PRINT"{down}Qremember the phase 2 clock?" 5352 PRINT"{down}Qonly when this signal from the {reverse on}6510{reverse off}" 5353 PRINT"{down} is high (=1) will the {reverse on}6510{reverse off} address" 5354 PRINT"{down} memory.":PRINT"{down}Qwe need a similar clock for ol' {reverse on}vic{reverse off}!":GOSUB50000 5360 PRINT"{down}Qlet's look at these clocks..":ms$="let's look":GOSUB63200 5370 GOSUB50000:PRINT"{clear}{down}" 5380 PRINT"phase 2 clock {cm @*3}O{cm t*2}P{cm @*5}O{cm t*2}P{cm @*5}O{cm t*2}P{down*2}" 5390 PRINT"phase 1 clock {cm t*2}P{cm @*4}O{cm t*3}P{cm @*4}O{cm t*3}P{cm @*3}{sh @}" 5400 PRINT"{down*3}Qwhen the phase 2 clock is high (=1)" 5410 PRINT"{down} the {reverse on}6510{reverse off} will address memory." 5420 PRINT"{down}Qwhen the phase 1 clock is high (=1)" 5430 PRINT"{down} ol' {reverse on}vic{reverse off} will address memory!":ms$="how nice!":GOSUB63200 5440 GOSUB50000:PRINT"{clear}{down*2}Q..and ol' vic makes sure" 5450 PRINT"{down} that {reverse on}6510{reverse off} is cut off{down}{left*7}{cm u*7}{up} from memory" 5460 PRINT"{down} access.":GOSUB50000 5470 PRINT"{down}Qfrom one of the 40 pins of ol' {reverse on}vic" 5480 PRINT"{down} comes an:" 5490 PRINT"{down} {reverse on}a{reverse off}ddress {reverse on}e{reverse off}nable {reverse on}c{reverse off}ontrol (aec).":GOSUB50000 5500 PRINT"{clear}";:GOSUB53200 5510 f$="{home}{down*19}{right*23}":g$="aec":nt=10:GOSUB55000 5520 GOSUB50000:PRINT"{clear}{down*8}Qand how does {reverse on}aec{reverse off} cut off" 5530 PRINT"{down} the {reverse on}6510{reverse off} from access to memory?":ms$="i give up!":GOSUB63200 5600 GOSUB50000:PRINT"{clear}";:GOSUB56000 5610 f$="{home}":g$="address bits"+CHR$(13)+"from 6510"+CHR$(13):nt=5 5620 g$=g$+"{sh -*2}"+CHR$(13)+"vv":GOSUB55000:GOSUB50000 5700 f$="{home}{down*12}{right*11}":g$="(aec)=cut off the output!" 5710 GOSUB55000:f$=f$+"{down*10}":GOSUB55000:GOSUB50000 5720 PRINT"{clear}{down}Qwhen aec{up}{left*3}{F*3}{down}=1 these outputs" 5730 PRINT"{down} are disconnected from the address pins" 5740 PRINT"{down} of the ram chips." 5750 PRINT"{down}Qwhen the {reverse on}6510{reverse off} is cut off (phase 1)" 5760 PRINT"{down} ol' {reverse on}vic{reverse off} talks to ram!":GOSUB50000 5770 PRINT"{down}Qand it does so by giving the ram chips" 5780 PRINT"{down} a0-a7 while ras{up}{left*3}{F*3}{down}=0 (row select)" 5790 PRINT"{down}Qand a8-a13 while cas{up}{left*3}{F*3}{down}=0 (column select).":GOSUB50000 5800 PRINT"{down}Q{.*3}which is easy for ol' vic because" 5810 PRINT"{down} it's {reverse on}vic{reverse off} who generates ras{up}{left*3}{F*3}{down} & cas{up}{left*3}{F*3}{down}!!":GOSUB50000 5900 PRINT"{clear}{down}Qbut ol' vic still only supplies the" 5910 PRINT"{down} bottom 14 bits of the address{.*3}" 5920 PRINT"{down} first a0-a7 = 8 bits (for row select)" 5930 PRINT"{down} then{space*2}a8-a13= {reverse on}6{reverse off} bits!" 5940 PRINT"{down}Qwe said {reverse on}cia #2{reverse off} supplies the top two:" 5950 PRINT"{down} (a14 & a15).":ms$="{reverse on}{space*3}how?{space*3}{reverse off*2}":GOSUB63200:GOSUB50000 6000 GOSUB63100:REM micros-6 6001 sn$="06{0*3}" 6005 t$="the cia and the great bank switch":GOSUB63000:GOSUB57000 6010 ms$="remember?":GOSUB63200:GOSUB50000 6020 f$="{home}{down*14}{right*11}":PRINTf$"{sh asterisk*5}":PRINTf$"{down}{sh asterisk*5}" 6030 f$=f$+"{right*5}":g$="a14 ":nt=5:GOSUB55000 6040 f$=f$+"{down}":g$="a15 ":GOSUB55000 6050 GOSUB50000:PRINT"{clear}{down}Qnote that the two 'top' bits" 6060 PRINT"{down} of the address bus (when 'ol vic" 6065 PRINT"{down} talks to memory) come from the" 6070 PRINT"{down} 'bottom' two bits of port a in {reverse on}cia #2{reverse off}." 6080 PRINT"{down}Qthis {reverse on}cia{reverse off} chip starts at $dd00 and" 6090 PRINT"{down} the very first internal register is" 6100 PRINT"{down} port a{.*3}and $dd00 (hex)=56576 (dec)" 6110 PRINT"{down} so we can {reverse on}poke56576{reverse off} to change the" 6120 PRINT"{down} 16k bank which 'ol vic can see!":GOSUB50000 6130 PRINT"{clear}{down}Qif the top two bits of the address bus" 6135 PRINT"{down} (supplied via port a by cia #2)" 6140 PRINT"{down} are {reverse on}00{reverse off} then {reverse on}vic{reverse off} can talk to memory" 6150 PRINT"{down} from {reverse on}00{reverse off}00 {0*4} {0*4} {0*4}=${0*4}" 6160 PRINT"{down}{space*2}to{space*2}{reverse on}00{reverse off}11 {1*4} {1*4} {1*4}=$3{f*3}" 6170 PRINT"{down}Qif the top two bits of the address bus" 6180 PRINT"{down} are {reverse on}10{reverse off} then {reverse on}vic{reverse off} can talk to memory" 6190 PRINT"{down} from {reverse on}10{reverse off}00 {0*4} {0*4} {0*4}=$8{0*3}$ 6200 PRINT"{down}{space*2}to{space*2}{reverse on}10{reverse off}11 {1*4} {1*4} {1*4}=$b{f*3}$ 6210 PRINT"{down*2}{space*7}..etc..":GOSUB50000:ms$="sounds ok":GOSUB63200:GOSUB50000 6220 PRINT"{clear}{down}Qnow you would think that to point" 6230 PRINT"{down} 'ol vic to the top 16k bank{down}{left*12}{cm u*12}" 6240 PRINT" we should change the port a register" 6250 PRINT"{down} in cia #2 so it has {x*4} xx{reverse on}11{reverse off}":PRINT"{down}..right?":GOSUB63200 6260 ms$="{space*2}right!{space*2}":GOSUB63200:GOSUB50000 6270 PRINT"{clear}{down}Qand you would think that to point" 6280 PRINT"{down} 'ol vic to the bottom 16k bank{down}{left*15}{cm u*15}" 6290 PRINT" we should change the port a register" 6300 PRINT"{down} in cia #2 so it has {x*4} xx{reverse on}00{reverse off}":PRINT"{down}..right?" 6310 ms$="{reverse on}{space*2}right!{space*2}{reverse off}":GOSUB63200:GOSUB50000 6320 PRINT"{clear}{down*2}Qwrong on both counts!":ms$="{reverse on}!#$%'&{pound}*+?{reverse off}":GOSUB50000:GOSUB63300 6330 PRINT"{clear}{down*3}Qin fact the lowest two bits in the" 6340 PRINT"{down} port a register are {reverse on}complemented" 6350 PRINT"{down} before they're put on the address bus!" 6360 PRINT"{down}Qso {reverse on}poke56576,(peek(56576)and252)or x)" 6370 PRINT"{down} gives the bottom bank when x=3" 6380 PRINT"{down} and the top bank when x=0!":ms$="{reverse on}not{reverse off}a15 etc" 6390 GOSUB63200:GOSUB50000 7000 GOSUB63100:REM micros-7 7001 sn$="07{0*3}" 7005 t$="two bits worth of address":GOSUB63000:PRINT"{home}{down*9}":ee=1 7010 PRINT"{space*13}{cm a}{sh asterisk*3}{cm s} 7011 PRINT"{space*12}{sh asterisk}{cm w}y3 {cm q}{sh asterisk} 7012 PRINT"{space*12}{sh asterisk}{cm w}y2 {cm q}{sh asterisk}" 7013 PRINT"{space*12}{sh asterisk}{cm w}y1 {cm q}{sh asterisk}" 7014 PRINT"{space*12}{sh asterisk}{cm w}y0 {cm q}{sh asterisk} 7015 PRINT"{space*13}{sh -}{space*3}{sh -}" 7016 PRINT"{space*12}{sh asterisk}{cm w}x3 {sh -} 7017 PRINT"{sh space}{space*11}{sh asterisk}{cm w}x2 {sh -} 7018 PRINT"{space*8}{sh space}{space*3}{sh asterisk}{cm w}x1 {cm q}{arrow left}select x or y" 7019 PRINT"{sh space}{space*11}{sh asterisk}{cm w}x0 {cm q}{arrow left}cut off output" 7020 PRINT"{space*13}{cm z}{sh asterisk*3}{cm x} 7030 PRINT"{home}{down*3}Qremember the data selector chip?" 7040 PRINT"{down}Qto get the top two bits of the":PRINT" address bus for 'ol vic we" 7050 PRINT" connect one up like this{.*3}" 7060 GOSUB50000:PRINT"{clear}{down*7}":nt=5 7108 PRINT"{space*10}{cm a}{sh asterisk*9}{cm s} 7109 PRINT"{space*10}{sh -}{cm a}{sh asterisk*7}{cm s}{sh -} 7110 PRINT"{space*10}{sh -*2} {cm a}{sh asterisk*3}{cm s} {sh -*2} 7111 PRINT"a7{sh asterisk*2}Q{sh asterisk*5}{sh +*2}{sh asterisk}{cm w}y3 {cm q}{sh asterisk}{cm x}{sh -} 7112 PRINT"a6{sh asterisk}Q{sh +}{sh asterisk*5}{sh +*2}{sh asterisk}{cm w}y2 {cm q}{sh asterisk*2}{cm x} 7113 PRINT"{space*3}{sh -*2}{space*5}{sh -}{cm z}{sh asterisk}{cm w}y1 {cm q}{sh asterisk*4}{space*3}to" 7114 PRINT"{space*3}{sh -*2}{space*5}{cm z}{sh asterisk*2}{cm w}y0 {cm q}{sh asterisk*4}{space*3}ram" 7115 PRINT"{space*3}{sh -*2}{space*8}{sh -}{space*3}{sh -}" 7116 PRINT"{space*3}{sh -}{cm z}{sh asterisk*8}{cm w}x3 {sh -} 7117 PRINT"{sh space}{space*2}{cm z}{sh asterisk*9}{cm w}x2 {sh -} 7118 PRINT"port a:a15{space*2}{sh asterisk}{cm w}x1 {cm q}{arrow left}select{space*10}" 7119 PRINT"port a:a14{space*2}{sh asterisk}{cm w}x0 {cm q}{arrow left}cut off output" 7120 PRINT"{space*13}{cm z}{sh asterisk*3}{cm x} 7121 IFee=2THENPRINT"{home}{down*18}{space*4}{reverse on}not{reverse off}":PRINT"{space*4}{reverse on}not{reverse off}" 7200 d$="{home}{down*18}":r$="{right*31}" 7201 xx=18:yy=12:GOSUB58000:f1$=ff$:g1$="a7" 7202 xx=18:yy=13:GOSUB58000:f2$=ff$:g2$="a6" 7203 xx=22:yy=14:GOSUB58000:f3$=ff$:g3$="a15" 7204 xx=22:yy=15:GOSUB58000:f4$=ff$:g4$="a14" 7205 xx=26:yy=19:GOSUB58000:f5$=ff$:g5$="{reverse off}x:{reverse on}cas=0":g6$="{reverse off}y:{reverse on}cas=1" 7210 PRINT"{home}{reverse on}return{reverse off} to see the top bits for 'ol vic.":b0$=f3$+"{space*3}" 7211 PRINT"{down}hit {reverse on}q{reverse off} to quit.":f$=f5$:g$=g6$:GOSUB55000:b1$=f4$+"{space*3}" 7212 PRINTb0$:PRINTb1$:f$=f1$:g$=g1$:GOSUB55000 7213 f$=f2$:g$=g2$:GOSUB55000 7214 f$=f3$:g$=g1$:GOSUB55000 7215 f$=f4$:g$=g2$:GOSUB55000:GOSUB50000:IFa$="q"THEN ON ee GOTO8000,9000 7220 PRINTb0$:PRINTb1$:f$=f5$:g$=g5$:GOSUB55000 7221 f$=f1$:g$=g1$:GOSUB55000 7222 f$=f2$:g$=g2$:GOSUB55000 7223 f$=f3$:g$=g3$:GOSUB55000 7224 f$=f4$:g$=g4$:GOSUB55000:GOSUB50000:IFa$="q"THEN ON ee GOTO8000,9000 7225 PRINTf5$"x":GOTO7210 8000 PRINT"{clear}{down*5}Qand this{down}{left*4}{cm u*4}{up} data selector" 8010 PRINT"{down} unlike the last{down}{left*4}{cm u*4}{up} one, {reverse on}inverts{reverse off} outputs" 8020 PRINT"{down} so we need to feed it a15{up}{left*3}{F*3}{down} & a14{up}{left*3}{F*3}{down}!":ee=2:GOTO7060 9000 PRINT"{clear}{down*7}Qand that's{down}{left*6}{cm u*6}{up} why we poke" 9010 PRINT"{down} port a with the {reverse on}complements{reverse off} of the" 9020 PRINT"{down} top two address bits!" 10000 GOSUB50000:PRINT"{clear}":ms$="au revoir!":GOSUB63200:PRINT"{up*2}":sn$="{0*3}10" 10010 GOSUB63520:END 50000 GETa$:IFa$<>""THEN50000 50001 GETa$:IFa$=""THEN50001 50002 IFa$="@"THEN63500 50003 RETURN 51000 n=3 51001 x$="":FORu=nTO0STEP-1:x%=x/(2^u):x=x-x%*(2^u):x$=x$+CHR$(48+x%) 51002 NEXT:RETURN 52000 m=3 52001 y$="":FORv=mTO0STEP-1:y%=y/(16^v):y=y-y%*(16^v) 52002 y$=y$+CHR$(48+y%-7*(y%>9)):NEXT:RETURN 53000 PRINT"{space*6}{cm a}{sh asterisk*4}{cm s} 53010 PRINT" a11{sh asterisk*2}{cm w}{space*4}{cm q}{sh asterisk*3}video 53020 PRINT" a10{sh asterisk*2}{cm w}{space*4}{cm q}{sh asterisk*3}sound 53030 PRINT"{space*6}{sh -}{reverse on}2to4{reverse off}{cm q}{sh asterisk*3}colour 53040 PRINT"{space*6}{sh -}{space*4}{cm q}{sh asterisk}{cm s} 53050 PRINT"{space*6}{cm z}{sh asterisk}{cm r}{sh asterisk*2}{cm x} {sh -} 53060 PRINT" {F*3}{space*4}^{space*4}{sh -} {cm a}{sh asterisk*4}{cm s} 53070 PRINT" ce1{sh asterisk*4}{cm x}{space*4}{sh -} {sh -}{space*4}{cm q}{sh asterisk*2}to cia #1 53080 PRINT"{space*10}a9{sh asterisk}{sh +}{sh asterisk}{cm w}{space*4}{cm q}{sh asterisk*2}to cia #2 53090 PRINT"{space*10}a8{sh asterisk}{sh +}{sh asterisk}{cm w}{reverse on}2to4{reverse off}{cm q}{sh asterisk*2}{cm s} 53100 PRINT"{space*13}{sh -} {sh -}{space*4}{cm q}{sh asterisk}{cm s}{sh -} 53110 PRINT"{space*13}{sh -} {cm z}{sh asterisk}{cm r}{sh asterisk*2}{cm x} {sh -*2} 53120 PRINT"{space*10}{F*3}{sh -}{space*3}^{space*4}{sh -*2} 53130 PRINT"{space*10}ce2{cm z}{sh asterisk*3}{cm x}{space*4}{sh -*2} 53140 PRINT"{space*15}{reverse on}{cm e*10}" 53150 PRINT"{space*15}{reverse on}cartridge" 53160 PRINT"{space*15}{reverse on}{space*3}port{space*2}" 53170 RETURN 53200 PRINT"{space*6}8 wires{space*2}{sh asterisk}Q{sh asterisk}" 53201 PRINT"{space*2}of data bus{sh asterisk}Q{sh +*2} {cm a}{sh asterisk*2}+12 volts" 53202 PRINT"{space*14}{sh -}.{sh -} {sh -}{cm a}{sh asterisk}+5 volts" 53203 PRINT"{space*12}{cm a}{sh asterisk}{cm e*3}{sh asterisk}{cm e*2}{sh asterisk}{cm s} 53204 PRINT"{space*2}14 wires {sh asterisk}{cm w}{sh space*8}{cm q}{sh asterisk}luminance 53205 PRINT"{space*4}of{space*3}{.*3}{cm w}{sh space*8}{sh -} 53206 PRINT"address bus{sh asterisk}{cm w}{sh space*8}{cm q}{sh asterisk}colour 53207 PRINT"{space*6}{F*3}{space*3}{sh -}{space*8}{sh -} 53208 PRINT"{space*6}ras {arrow left}{sh asterisk}{cm w}{space*8}{sh -} 53209 PRINT"{space*6}{F*3}{space*3}{sh -}{space*8}{sh -} 53210 PRINT"{space*6}cas {arrow left}{sh asterisk}{cm w}{space*8}{sh -} 53211 PRINT"{space*6}{F*3}{space*3}{sh -}{space*8}{sh -} 53212 PRINT"{space*6}irq {arrow left}{sh asterisk}{cm w}{space*8}{sh -} 53213 PRINT"{space*8}F{space*3}{sh -}{space*8}{sh -} 53214 PRINT"{space*6}r/w {sh asterisk*2}{cm w}{space*8}{sh -} 53215 PRINT"{space*12}{sh -}{space*8}{sh -} 53216 PRINT"light pen!{sh asterisk*2}{cm w}{space*8}{sh -} 53217 PRINT"{space*7}FF{space*3}{sh -}{space*8}{sh -} 53218 PRINT"{space*7}ce {sh asterisk*2}{cm w}{space*8}{sh -} 53219 PRINT"{space*12}{sh -}{space*8}{cm q}{sh asterisk}aec" 53220 PRINT" clock in {sh asterisk*2}{cm w}{space*8}{sh -} 53221 PRINT"{space*12}{sh -}{space*8}{sh -} 53222 PRINT"clock out {arrow left}{sh asterisk}{cm w}{space*8}{cm q}{sh asterisk}ground" 53223 PRINT"{space*12}{cm z}{sh asterisk*8}{cm x} 53224 RETURN 54000 PRINT"{clear}{down} {sh asterisk*2}Q{sh asterisk*11}" 54010 PRINT" {sh asterisk*2}{sh +}Q{sh asterisk*9}" 54020 PRINT" {sh asterisk*2}{sh +*2}Q{sh asterisk*8}{reverse on}address" 54030 PRINT" {sh asterisk*2}{sh +*3}Q{sh asterisk*7}{reverse on}bus{space*4}" 54040 PRINT" {sh asterisk*2}{sh +*4}Q{sh asterisk*6}" 54050 PRINT" {sh asterisk*2}{sh +*5}{sh asterisk*5}Q{sh asterisk*3}" 54060 PRINT" ..{sh -*5}{.*5}{sh -}{.*3}" 54070 PRINT" {sh asterisk*2}{sh +*5}{sh asterisk*5}{sh +*2}{sh asterisk}Q" 54080 PRINT"{space*2}{cm a}{cm e*5}{sh asterisk*3}{cm s} {sh -*2}.{sh -}" 54090 PRINT"{space*2}{sh -}decoder1{sh -} {sh -*2}.{sh -}" 54100 PRINT"{space*2}{cm z}{sh asterisk*4}{cm r}{sh asterisk*3}{cm x} {sh -*2}.{sh -}{arrow left}11" 54110 PRINT" r/w{sh asterisk}{cm s} {sh -}{space*5}{sh -*2}.{sh -}wires" 54120 PRINT"{space*2}{cm a}{sh asterisk*2}{cm e}{sh asterisk}{cm e}{sh asterisk*3}{cm s} {sh -*2}.{sh -}" 54130 PRINT"{space*2}{sh -}memory 1{cm q}{arrow left}{cm x*2}-{cm x}" 54140 PRINT"{space*2}{cm z}{cm r*8}{cm x}" 54150 PRINT" {sh asterisk*2}Q{sh +*7}{sh asterisk*3}" 54160 PRINT" {sh asterisk*3}Q{sh +*6}{sh asterisk*3}" 54170 PRINT" {sh asterisk*4}Q{sh +*5}{sh asterisk*3}" 54180 PRINT" {sh asterisk*5}Q{sh +*4}{sh asterisk*3}{reverse on}data" 54190 PRINT" {sh asterisk*6}Q{sh +*3}{sh asterisk*3}{reverse on}bus " 54200 PRINT" {sh asterisk*7}Q{sh +*2}{sh asterisk*3}" 54210 PRINT" {sh asterisk*8}Q{sh +}{sh asterisk*3}" 54220 PRINT" {sh asterisk*9}Q{sh asterisk*3}{home}" 54230 RETURN 55000 FORi=1TOnt:PRINTf$g$;:FORo=1TOLEN(g$):PRINT"{left}";:NEXT 55001 FORt=1TO50:NEXT:PRINTf$"{reverse on}"g$"{reverse off}";:FORo=1TOLEN(g$):PRINT"{left}";:NEXT 55002 FORt=1TO50:NEXT:NEXT:RETURN 56000 PRINT"{home}{down*3}":FORi=1TO2 56001 PRINT"{space*5}{cm a}{sh asterisk*3}{cm s} 56002 PRINT"a{space*3}{sh asterisk}{cm w}y3 {cm q}{sh asterisk} 56003 PRINT"a{space*3}{sh asterisk}{cm w}y2 {cm q}{sh asterisk}{reverse on}to {reverse off}" 56004 PRINT"a{space*3}{sh asterisk}{cm w}y1 {cm q}{sh asterisk}{reverse on}ram{reverse off}" 56005 PRINT"a{space*3}{sh asterisk}{cm w}y0 {cm q}{sh asterisk} 56006 PRINT"a{space*3}{sh asterisk}{cm w}x3 {sh -} 56007 PRINT"a{space*3}{sh asterisk}{cm w}x2 {sh -} 56008 PRINT"a{space*3}{sh asterisk}{cm w}x1 {cm q}{arrow left}select{reverse off}" 56009 PRINT"a{space*3}{sh asterisk}{cm w}x0 {cm q}{arrow left}? 56010 PRINT"{space*5}{cm z}{sh asterisk*3}{cm x} 56011 NEXT:PRINT"{home}{down*4}":t$="151413127 6 5 4 ":FORi=1TO8 56012 PRINT"{right}"MID$(t$,2*i-1,2):NEXT 56013 PRINT"{down}":b$="{1*3}09 8 3 2 1 0 ":FORi=1TO8 56014 PRINT"{right}"MID$(b$,2*i-1,2):NEXT:p$="{home}{down*5}":FORi=1TO15:p$=p$+"{right}":NEXT 56100 RETURN 57000 PRINT"{home}{down*3}{sh asterisk*9}Q{sh asterisk} 57010 PRINT"{sh asterisk*8}Q{sh +}{sh asterisk} 57020 PRINT"{sh asterisk}data{sh asterisk*2}Q{sh +*2}{sh asterisk} 57030 PRINT"{sh asterisk}bus {sh asterisk}Q{sh +*3}{sh asterisk} 57040 PRINT"{sh asterisk*5}Q{sh +*4}{sh asterisk} 57050 PRINT"{sh asterisk*4}Q{sh +*5}{sh asterisk} 57060 PRINT"{sh asterisk*3}Q{sh +*6}{sh asterisk} 57070 PRINT"{sh asterisk*2}Q{sh +*7}{sh asterisk} 57080 PRINT" {cm a}{cm e*8}{cm s} 57090 PRINT" {sh -}FF{space*6}{cm q}{sh asterisk*2} 57100 PRINT"{sh asterisk}{cm w}ceR{space*5}{cm q}.. {reverse on}port a" 57110 PRINT"{sh asterisk}{cm w}r/w{space*5}{cm q}{sh asterisk*2} 8 pins 57120 PRINT"{sh asterisk}{cm w}clock{space*3}{cm q}{sh asterisk*2} 57130 PRINT" {sh -}{space*8}{sh -} 57140 PRINT" {sh -}{space*3}{reverse on}cia{reverse off}{space*2}{sh -} 57150 PRINT"{sh asterisk}{cm w}a3{space*6}{cm q}{sh asterisk*2} 57160 PRINT"{sh asterisk}{cm w}a2{space*6}{cm q}{sh asterisk*2} {reverse on}port b 57170 PRINT"{sh asterisk}{cm w}a1{space*6}{cm q}.. 8 pins 57180 PRINT"{sh asterisk}{cm w}a0{space*6}{cm q}{sh asterisk*2} 57190 PRINT" {cm z}{sh asterisk*8}{cm x} 57200 RETURN 58000 ff$=LEFT$(d$,yy)+LEFT$(r$,xx):RETURN 63000 PRINT"{clear}"; 63001 l=LEN(t$):uu$="":FORi=1TOl:uu$=uu$+" ":NEXT:tt$=uu$+t$ 63002 PRINT" {cm a}";:FORi=1TOl:PRINT"{sh asterisk}";:NEXT:PRINT"{cm s}" 63003 PRINT" {sh -}";:FORi=1TOl:PRINT" ";:NEXT:PRINT"{reverse off}{sh -}" 63004 PRINT" {cm z}";:FORi=1TOl:PRINT"{sh asterisk}";:NEXT:PRINT"{cm x}":PRINT"{up*2}{right*2}{reverse on}{red}"; 63005 FORi=1TOl:PRINTMID$(tt$,i+1,l):PRINT"{up}{right*2}{reverse on}";:FORt=1TO50:NEXT 63006 NEXT:PRINT"{black}":RETURN 63100 bt$="{home}{down*24}" 63101 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}" 63102 pt$=pt$+"{down}{left*13}N{cm t*12}M{down}{left*14}{cm g}{=*12}{cm m}" 63103 pt$=pt$+"{down}{left*14}PO{cm t*10}PO{up*4}{left*12}" 63104 pt$=bt$+"{up*6}{right*26}"+pt$+"{black}" 63105 sn=1030:IFPEEK(0)=47THENsn=2054 63199 RETURN 63200 FORi=1TO2:PRINTpt$"{space*10}" 63201 FORt=1TO50:NEXT 63202 PRINTpt$ms$ 63203 FORt=1TO50:NEXT:NEXT:RETURN 63300 GOSUB63200:FORt=1TO1000:NEXT:RETURN 63500 vs=VAL(sn$):vs=vs-1000:IFvs<1000THENvs=100 63510 sn$=MID$(STR$(vs),2):sn$=RIGHT$("{0*5}"+sn$,5):GOSUB63520:RUN 63520 FORi=1TO5:POKEsn+i-1,ASC(MID$(sn$,i,1)):NEXT:RETURN stop tok64 (bastext 1.0)