Home » CEEFAX disks » telesoftware5.adl » 30-01-88/T\SWR14
30-01-88/T\SWR14
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » CEEFAX disks » telesoftware5.adl |
Filename: | 30-01-88/T\SWR14 |
Read OK: | ✔ |
File size: | 3B8D bytes |
Load address: | 0000 |
Exec address: | FFFFFFFF |
Duplicates
There is 1 duplicate copy of this file in the archive:
- CEEFAX disks » telesoftware10.adl » 08-10-88/T\SWR14
- CEEFAX disks » telesoftware5.adl » 30-01-88/T\SWR14
File contents
Mastering Sideways ROM & RAM - Module 14 - Unrecognised Interupts ----------------------------------------------------------------- An interupt is a signal to the 6502 processor informing it that a hardware device somewhere in the system requires immediate attention. Interupts not recognised by the operating system are first offered to the paged roms and then to the user via the IRQ2 vector. Service call 5 is used to offer unrecognised interupts to the paged roms but, because an interupt could be generated by almost any device, it is not possible to identify the source of an interupt without directly interrogating the hardware that might be responsible for generating it. If you want to design a SWR program to process interupts it must intercept service call 5 and poll the hardware that it expects to generate an interupt to see if that device was responsible for the unrecognised interupt, and if so process it. If you do not want the interupt to be offered to the other roms the accumulator should be reset to zero before returning. Always return from an unrecognised interupt with RTS and not RTI. One way of connecting hardware to the BBC Micro is to use the 6522 versatile interface adaptor (VIA). There are two 6522 VIAs in the BBC B. VIA-A is used for internal functions and the joystick fire buttons. VIA-B provides the parallel printer interface and the user port. Printers are the most commonly used device connected to VIA-B, and a printer buffer will be used to demonstrate how interupts generated by external hardware can be intercepted and processed in sideways ram. The program BUFFER is used to generate an object code file just under &100 bytes long. When the object code is loaded into SWR it uses the remaining 15.75k in the ram bank as a parallel printer buffer. When sideways ram is used in this way the size of the object code needs to be as small as possible. For this reason a number of techniques have been used in the source code to make the object code fit into just one page of memory. The SWR header used by the buffer is as small as it can be. All the optional coding has been left out. There is no binary version number, title string, version string, copyright message or tube relocation address. Just the essential jump to the service entry point, rom type byte, copyright offset pointer and minimum copyright string (lines 250-340). Reseting the user print vector is done with the minimum of coding by taking the Osbyte &A8 call out of the object code (lines 180-210). The service call interpreter does not implement * commands to enable the buffer but instead intercepts service call &FE (tube system post initialisation) to set up the user print extended vector to point to the printer buffer code (lines 470-710). To use the buffer load the object code into SWR and press the Break key. Service call &FE is always issued on reset and so the buffer will be initialised every time you press Break. After pressing the Break key type *FX5,3 to enable the buffer. The printer can then be used as normal but with a 15.75k buffer. Type *FX5,1 or press Ctrl+Break to disable the buffer after printing has been completed. The buffer was designed to be used with an Epson parallel printer and may not be suitable for other parallel printers unless they use the same Centronics protocol as the Epson range (most parallel printers use the Centronics protocol). It is unsuitable for all serial printers and I suspect that the early versions of the Solidisk sideways ram boards may not allow this program to work properly, although I have not been able to test the program with one to confirm this suspicion. The user print vector is normally used to provide a printer driver for printers which do not have either a Centronics parallel or a standard serial interface. With this printer buffer program the user print vector interfaces the printer buffer with the SWR buffer and the printer hardware. The buffer program reads data from the printer buffer using Osbyte &91 (lines 1020-1040) and writes it into the SWR buffer using a pointer (line 1080) to indicate the position in SWR to store each individual byte. The data is read from the SWR buffer using another pointer (line 1540) to indicate the byte to be written into the VIA-B printer output register. When a byte is recieved by the printer the acknowledge line goes low and generates an IRQ interupt. This is the source of the interupt processed by the program. The pointers are updated with every read and write of the SWR buffer and when a pointer reaches &C000 it is reset to &8100 (lines 900-920 and lines 1620-1640). When the last character in the buffer has been printed the printer driver declares itself dormant and the MOS is informed using Osbyte &7B (lines 1350-1470). When all the data is either printed or in the SWR buffer the computer is released to continue with other tasks but you must not press the Break key or use *FX5 until all printing has been completed. You can continue with any task such as word processing or programming while the printer is using the data in SWR printer buffer. The 6522 VIA used to control the parallel printer interface is quite a complex device controled by 16 registers. The VIA-B registers are mapped onto Sheila addresses &60 to &6F as shown in figure 14.1 +-------------------------------------+ &FE6F ! A Input/Output (no handshake) ! +-------------------------------------+ &FE6E ! Interupt control ! +-------------------------------------+ &FE6D ! Interupt status ! +-------------------------------------+ &FE6C ! Peripheral control (handshake) ! +-------------------------------------+ &FE6B ! Auxiliary (timer/shift reg) control ! +-------------------------------------+ &FE6A ! Shift register ! +-------------------------------------+ &FE69 ! Timer 2 MSB counter ! +-------------------------------------+ &FE68 ! Timer 2 LSB latch/counter ! +-------------------------------------+ &FE67 ! Timer 1 MSB latch ! +-------------------------------------+ &FE66 ! Timer 1 LSB latch ! +-------------------------------------+ &FE65 ! Timer 1 MSB latch/counter ! +-------------------------------------+ &FE64 ! Timer 1 LSB latch/counter ! +-------------------------------------+ &FE63 ! Direction register A ! +-------------------------------------+ &FE62 ! Direction register B ! +-------------------------------------+ &FE61 ! A Input/Output ! +-------------------------------------+ &FE60 ! B Input/Output ! +-------------------------------------+ Figure 14.1 The VIA-B registers ----------- ------------------- Both VIAs have 20 I/O lines grouped into an A side and a B side of 10 lines each. These 10 lines are divided into 8 data lines and 2 handshake lines. The data lines are called PA0 to PA7 on the A side and PB0 to PB7 on the B side. The handshake lines are called CA1 and CA2 on the A side and CB1 and CB2 on the B side. The BBC Micro uses the A side of VIA-B for the printer interface and the B side of VIA-B for the user port. PA0 to PA7 are used as the output data lines for the parallel printer, CA1 is used for the printer acknowledge and CA2 for the printer strobe. The printer buffer program uses the output register at &FE61, the peripheral control register at &FE6C, the interupt status register at &FE6D and the interupt control register at &FE6E. The peripheral control register is used to set up the handshaking with the printer (lines 1490-1510 and line 1550). The number &0A is stored in the least significant nybble of this register and this has the effect of sending a strobe pulse (CA2 low) to the printer for 1 cycle of the 1 MHz clock following a write to the output register at &FE61. The Centronics interface requires a strobe pulse width of at least 0.5 micro seconds at the recieving terminal. The peripheral control register is shown in figure 14.2 with bits 1 and 3 set (see also program lines 1490-1510 and line 1550). 7 6 5 4 3 2 1 0 +-------+-------+-------+-------+-------+-------+-------+-------+ ! CB2 ! CB1 ! CA2 ! CA1 ! ! control !control! control !control! +-------+-------+-------+-------+-------+-------+-------+-------+ 1 0 1 0 &0A Figure 14.2 The peripheral control (handshake) register. ----------- -------------------------------------------- The acknowledge line is connected to CA1 and is used to generate an interupt when the printer has recieved data and is ready to accept more data from the printer buffer. The Centronics protocol takes the acknowledge line low for about 12 micro seconds. CA1 is reset to zero in the peripheral control register (lines 1490-1510 and line 1550) and its corresponding bit in the interupt status register will be set to 1 when the voltage on the CA1 input line goes from high to low. CA1 will set a bit in the interupt status register and generate an IRQ interupt if the CA1 bit in the status register has been set. Bit 2 (CA1) is set by setting bits 7 and 2, ie. by storing &82 in the control register as shown in figure 14.3 (line 1520 and line 1560). Bit 2 of the control register can be cleared by clearing bit 7 and setting bit 2, ie. by storing 2 in the control register (lines 1420-1430). 7 6 5 4 3 2 1 0 +---------+-----+-----+-----+-----+-----+-----+-----+ ! IRQ ! T1 ! T2 ! CB1 ! CB2 ! SR ! CA1 ! CA2 ! Interupt status +---------+-----+-----+-----+-----+-----+-----+-----+ !Set/Clear! T1 ! T2 ! CB1 ! CB2 ! SR ! CA1 ! CA2 ! Interupt control +---------+-----+-----+-----+-----+-----+-----+-----+ 1 0 0 0 0 0 1 0 &82 Figure 14.3 Interupt status and control registers. ----------- -------------------------------------- The control and status registers work as a pair and the status register is interrogated by the buffer program to see if the printer is the source of an interupt (lines 1140-1160). If bits 1 and 7 of the status register are not set then the printer was not the source of the interupt and control is returned to the MOS with all the register preserved (line 1160, lines 1280-1300 and lines 640-710). If the buffer has not been enabled with *FX5,3 control is also returned to the MOS (lines 1170-1190, lines 1280-1300 and lines 640-710). 10 REM: BUFFER 20 REM: (C) Gordon Horsington 1987 30 MODE7 40 HIMEM=&3C00 50 DIM save 50 60 diff=&8000-HIMEM 70 romnumber=&F4 80 stack=&103 90 uptv=&222 100 starfx5=&285 110 pointer=&8100 120 printout=&FE61 130 handshake=&FE6C 140 status=&FE6D 150 control=&FE6E 160 osbyte=&FFF4 170 oscli=&FFF7 180 A%=&A8 190 X%=0 200 Y%=&FF 210 extvec=(USR(osbyte)AND&FFFF00)DIV256 220 FOR pass = 0 TO 2 STEP 2 230 P%=HIMEM 240 [ OPT pass 250 BRK 260 BRK 270 BRK 280 JMP service+diff 290 OPT FNequb(&82) 300 OPT FNequb((copyright+diff) MOD 256) 310 .copyright 320 BRK 330 OPT FNequs("(C)") 340 BRK 350 .flag 360 BRK 370 .service 380 PHA 390 TXA 400 PHA 410 TYA 420 PHA 430 TSX 440 LDA stack,X 450 CMP #5 460 BEQ interupt 470 CMP #&FE 480 BNE exit 490 LDA #(buffer+diff) MOD 256 500 STA extvec+&33 510 LDA #(buffer+diff) DIV 256 520 STA extvec+&34 530 LDA romnumber 540 STA extvec+&35 550 LDA #&81 560 STA datin+diff+1 570 STA datin+diff+2 580 STA datout+diff+1 590 STA datout+diff+2 600 LDX #&33 610 LDY #&FF 620 STX uptv 630 STY uptv+1 640 .exit 650 PLA 660 TAY 670 PLA 680 TAX 690 PLA 700 .return 710 RTS 720 .buffer 730 CPY #3 740 BNE return 750 CMP #1 760 BNE active 770 STA flag+diff 780 .active 790 PHA 800 TXA 810 PHA 820 TYA 830 PHA 840 .outerloop 850 LDY datin+diff+2 860 LDX datin+diff+1 870 INX 880 BNE nottop 890 INY 900 CPY #&C0 910 BNE nottop 920 LDY #&81 930 .nottop 940 CPX datout+diff+1 950 BNE morespace 960 CPY datout+diff+2 970 BEQ innerloop 980 SEC 990 .morespace 1000 TYA 1010 PHA 1020 LDA #&91 1030 LDX #3 1040 JSR osbyte 1050 PLA 1060 BCS innerloop 1070 .datin 1080 STY pointer 1090 INC datin+diff+1 1100 STA datin+diff+2 1110 CLC 1120 BCC innerloop 1130 .interupt 1140 LDA #&82 1150 BIT status 1160 BEQ restore 1170 LDA starfx5 1180 CMP #3 1190 BNE restore 1200 .innerloop 1210 LDA flag+diff 1220 BNE notpoll 1230 LDA #&82 1240 BIT status 1250 BNE notpoll 1260 .step 1270 BCC outerloop 1280 .restore 1290 CLC 1300 BCC exit 1310 .notpoll 1320 PHP 1330 LDA #0 1340 STA flag+diff 1350 LDA datin+diff+1 1360 CMP datout+diff+1 1370 BNE output 1380 LDA datin+diff+2 1390 CMP datout+diff+2 1400 BNE output 1410 PLP 1420 LDX #2 1430 STX control 1440 LDA #&7B 1450 INX 1460 JSR osbyte 1470 JMP restore+diff 1480 .output 1490 LDA handshake 1500 AND #&F0 1510 ORA #&0A 1520 LDX #&82 1530 .datout 1540 LDY pointer 1550 STA handshake 1560 STX control 1570 STY printout 1580 INC datout+diff+1 1590 BNE notpage 1600 LDY datout+diff+2 1610 INY 1620 CPY #&C0 1630 BNE moreroom 1640 LDY #&81 1650 .moreroom 1660 STY datout+diff+2 1670 .notpage 1680 PLP 1690 BCS innerloop 1700 BCC step 1710 .lastbyte 1720 ] 1730 NEXT 1740 INPUT'"Save filename = "filename$ 1750 IF filename$="" END 1760 $save="SAVE "+filename$+" "+STR$~(HIMEM)+" "+STR$~(las tbyte)+" FFFF8000 FFFF8000" 1770 X%=save MOD 256 1780 Y%=save DIV 256 1790 *OPT1,2 1800 CALL oscli 1810 *OPT1,0 1820 END 1830 DEFFNequb(byte) 1840 ?P%=byte 1850 P%=P%+1 1860 =pass 1870 DEFFNequw(word) 1880 ?P%=word MOD 256 1890 P%?1=word DIV 256 1900 P%=P%+2 1910 =pass 1920 DEFFNequd(double) 1930 !P%=double 1940 P%=P%+4 1950 =pass 1960 DEFFNequs(string$) 1970 $P%=string$ 1980 P%=P%+LEN(string$) 1990 =pass
00000000 0d 4d 61 73 74 65 72 69 6e 67 20 53 69 64 65 77 |.Mastering Sidew| 00000010 61 79 73 20 52 4f 4d 20 26 20 52 41 4d 20 2d 20 |ays ROM & RAM - | 00000020 4d 6f 64 75 6c 65 20 31 34 20 2d 20 55 6e 72 65 |Module 14 - Unre| 00000030 63 6f 67 6e 69 73 65 64 20 49 6e 74 65 72 75 70 |cognised Interup| 00000040 74 73 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |ts.-------------| 00000050 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00000080 2d 2d 2d 2d 0d 0d 20 20 41 6e 20 69 6e 74 65 72 |----.. An inter| 00000090 75 70 74 20 69 73 20 61 20 73 69 67 6e 61 6c 20 |upt is a signal | 000000a0 74 6f 20 74 68 65 20 36 35 30 32 20 70 72 6f 63 |to the 6502 proc| 000000b0 65 73 73 6f 72 20 69 6e 66 6f 72 6d 69 6e 67 20 |essor informing | 000000c0 69 74 20 74 68 61 74 20 61 0d 68 61 72 64 77 61 |it that a.hardwa| 000000d0 72 65 20 64 65 76 69 63 65 20 73 6f 6d 65 77 68 |re device somewh| 000000e0 65 72 65 20 69 6e 20 74 68 65 20 73 79 73 74 65 |ere in the syste| 000000f0 6d 20 72 65 71 75 69 72 65 73 20 69 6d 6d 65 64 |m requires immed| 00000100 69 61 74 65 20 61 74 74 65 6e 74 69 6f 6e 2e 0d |iate attention..| 00000110 49 6e 74 65 72 75 70 74 73 20 6e 6f 74 20 72 65 |Interupts not re| 00000120 63 6f 67 6e 69 73 65 64 20 62 79 20 74 68 65 20 |cognised by the | 00000130 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 65 6d |operating system| 00000140 20 61 72 65 20 66 69 72 73 74 20 6f 66 66 65 72 | are first offer| 00000150 65 64 20 74 6f 0d 74 68 65 20 70 61 67 65 64 20 |ed to.the paged | 00000160 72 6f 6d 73 20 61 6e 64 20 74 68 65 6e 20 74 6f |roms and then to| 00000170 20 74 68 65 20 75 73 65 72 20 76 69 61 20 74 68 | the user via th| 00000180 65 20 49 52 51 32 20 76 65 63 74 6f 72 2e 0d 0d |e IRQ2 vector...| 00000190 20 20 53 65 72 76 69 63 65 20 63 61 6c 6c 20 35 | Service call 5| 000001a0 20 69 73 20 75 73 65 64 20 74 6f 20 6f 66 66 65 | is used to offe| 000001b0 72 20 75 6e 72 65 63 6f 67 6e 69 73 65 64 20 69 |r unrecognised i| 000001c0 6e 74 65 72 75 70 74 73 20 74 6f 20 74 68 65 20 |nterupts to the | 000001d0 70 61 67 65 64 0d 72 6f 6d 73 20 62 75 74 2c 20 |paged.roms but, | 000001e0 62 65 63 61 75 73 65 20 61 6e 20 69 6e 74 65 72 |because an inter| 000001f0 75 70 74 20 63 6f 75 6c 64 20 62 65 20 67 65 6e |upt could be gen| 00000200 65 72 61 74 65 64 20 62 79 20 61 6c 6d 6f 73 74 |erated by almost| 00000210 20 61 6e 79 20 64 65 76 69 63 65 2c 0d 69 74 20 | any device,.it | 00000220 69 73 20 6e 6f 74 20 70 6f 73 73 69 62 6c 65 20 |is not possible | 00000230 74 6f 20 69 64 65 6e 74 69 66 79 20 74 68 65 20 |to identify the | 00000240 73 6f 75 72 63 65 20 6f 66 20 61 6e 20 69 6e 74 |source of an int| 00000250 65 72 75 70 74 20 77 69 74 68 6f 75 74 0d 64 69 |erupt without.di| 00000260 72 65 63 74 6c 79 20 69 6e 74 65 72 72 6f 67 61 |rectly interroga| 00000270 74 69 6e 67 20 74 68 65 20 68 61 72 64 77 61 72 |ting the hardwar| 00000280 65 20 74 68 61 74 20 6d 69 67 68 74 20 62 65 20 |e that might be | 00000290 72 65 73 70 6f 6e 73 69 62 6c 65 20 66 6f 72 0d |responsible for.| 000002a0 67 65 6e 65 72 61 74 69 6e 67 20 69 74 2e 0d 0d |generating it...| 000002b0 20 20 49 66 20 79 6f 75 20 77 61 6e 74 20 74 6f | If you want to| 000002c0 20 64 65 73 69 67 6e 20 61 20 53 57 52 20 70 72 | design a SWR pr| 000002d0 6f 67 72 61 6d 20 74 6f 20 70 72 6f 63 65 73 73 |ogram to process| 000002e0 20 69 6e 74 65 72 75 70 74 73 20 69 74 20 6d 75 | interupts it mu| 000002f0 73 74 0d 69 6e 74 65 72 63 65 70 74 20 73 65 72 |st.intercept ser| 00000300 76 69 63 65 20 63 61 6c 6c 20 35 20 61 6e 64 20 |vice call 5 and | 00000310 70 6f 6c 6c 20 74 68 65 20 68 61 72 64 77 61 72 |poll the hardwar| 00000320 65 20 74 68 61 74 20 69 74 20 65 78 70 65 63 74 |e that it expect| 00000330 73 20 74 6f 0d 67 65 6e 65 72 61 74 65 20 61 6e |s to.generate an| 00000340 20 69 6e 74 65 72 75 70 74 20 74 6f 20 73 65 65 | interupt to see| 00000350 20 69 66 20 74 68 61 74 20 64 65 76 69 63 65 20 | if that device | 00000360 77 61 73 20 72 65 73 70 6f 6e 73 69 62 6c 65 20 |was responsible | 00000370 66 6f 72 20 74 68 65 0d 75 6e 72 65 63 6f 67 6e |for the.unrecogn| 00000380 69 73 65 64 20 69 6e 74 65 72 75 70 74 2c 20 61 |ised interupt, a| 00000390 6e 64 20 69 66 20 73 6f 20 70 72 6f 63 65 73 73 |nd if so process| 000003a0 20 69 74 2e 20 49 66 20 79 6f 75 20 64 6f 20 6e | it. If you do n| 000003b0 6f 74 20 77 61 6e 74 20 74 68 65 0d 69 6e 74 65 |ot want the.inte| 000003c0 72 75 70 74 20 74 6f 20 62 65 20 6f 66 66 65 72 |rupt to be offer| 000003d0 65 64 20 74 6f 20 74 68 65 20 6f 74 68 65 72 20 |ed to the other | 000003e0 72 6f 6d 73 20 74 68 65 20 61 63 63 75 6d 75 6c |roms the accumul| 000003f0 61 74 6f 72 20 73 68 6f 75 6c 64 20 62 65 0d 72 |ator should be.r| 00000400 65 73 65 74 20 74 6f 20 7a 65 72 6f 20 62 65 66 |eset to zero bef| 00000410 6f 72 65 20 72 65 74 75 72 6e 69 6e 67 2e 20 41 |ore returning. A| 00000420 6c 77 61 79 73 20 72 65 74 75 72 6e 20 66 72 6f |lways return fro| 00000430 6d 20 61 6e 20 75 6e 72 65 63 6f 67 6e 69 73 65 |m an unrecognise| 00000440 64 0d 69 6e 74 65 72 75 70 74 20 77 69 74 68 20 |d.interupt with | 00000450 52 54 53 20 61 6e 64 20 6e 6f 74 20 52 54 49 2e |RTS and not RTI.| 00000460 0d 0d 20 20 4f 6e 65 20 77 61 79 20 6f 66 20 63 |.. One way of c| 00000470 6f 6e 6e 65 63 74 69 6e 67 20 68 61 72 64 77 61 |onnecting hardwa| 00000480 72 65 20 74 6f 20 74 68 65 20 42 42 43 20 4d 69 |re to the BBC Mi| 00000490 63 72 6f 20 69 73 20 74 6f 20 75 73 65 20 74 68 |cro is to use th| 000004a0 65 20 36 35 32 32 0d 76 65 72 73 61 74 69 6c 65 |e 6522.versatile| 000004b0 20 69 6e 74 65 72 66 61 63 65 20 61 64 61 70 74 | interface adapt| 000004c0 6f 72 20 28 56 49 41 29 2e 20 54 68 65 72 65 20 |or (VIA). There | 000004d0 61 72 65 20 74 77 6f 20 36 35 32 32 20 56 49 41 |are two 6522 VIA| 000004e0 73 20 69 6e 20 74 68 65 20 42 42 43 0d 42 2e 20 |s in the BBC.B. | 000004f0 56 49 41 2d 41 20 69 73 20 75 73 65 64 20 66 6f |VIA-A is used fo| 00000500 72 20 69 6e 74 65 72 6e 61 6c 20 66 75 6e 63 74 |r internal funct| 00000510 69 6f 6e 73 20 61 6e 64 20 74 68 65 20 6a 6f 79 |ions and the joy| 00000520 73 74 69 63 6b 20 66 69 72 65 20 62 75 74 74 6f |stick fire butto| 00000530 6e 73 2e 0d 56 49 41 2d 42 20 70 72 6f 76 69 64 |ns..VIA-B provid| 00000540 65 73 20 74 68 65 20 70 61 72 61 6c 6c 65 6c 20 |es the parallel | 00000550 70 72 69 6e 74 65 72 20 69 6e 74 65 72 66 61 63 |printer interfac| 00000560 65 20 61 6e 64 20 74 68 65 20 75 73 65 72 20 70 |e and the user p| 00000570 6f 72 74 2e 0d 50 72 69 6e 74 65 72 73 20 61 72 |ort..Printers ar| 00000580 65 20 74 68 65 20 6d 6f 73 74 20 63 6f 6d 6d 6f |e the most commo| 00000590 6e 6c 79 20 75 73 65 64 20 64 65 76 69 63 65 20 |nly used device | 000005a0 63 6f 6e 6e 65 63 74 65 64 20 74 6f 20 56 49 41 |connected to VIA| 000005b0 2d 42 2c 20 61 6e 64 20 61 0d 70 72 69 6e 74 65 |-B, and a.printe| 000005c0 72 20 62 75 66 66 65 72 20 77 69 6c 6c 20 62 65 |r buffer will be| 000005d0 20 75 73 65 64 20 74 6f 20 64 65 6d 6f 6e 73 74 | used to demonst| 000005e0 72 61 74 65 20 68 6f 77 20 69 6e 74 65 72 75 70 |rate how interup| 000005f0 74 73 20 67 65 6e 65 72 61 74 65 64 20 62 79 0d |ts generated by.| 00000600 65 78 74 65 72 6e 61 6c 20 68 61 72 64 77 61 72 |external hardwar| 00000610 65 20 63 61 6e 20 62 65 20 69 6e 74 65 72 63 65 |e can be interce| 00000620 70 74 65 64 20 61 6e 64 20 70 72 6f 63 65 73 73 |pted and process| 00000630 65 64 20 69 6e 20 73 69 64 65 77 61 79 73 20 72 |ed in sideways r| 00000640 61 6d 2e 0d 0d 20 20 54 68 65 20 70 72 6f 67 72 |am... The progr| 00000650 61 6d 20 42 55 46 46 45 52 20 69 73 20 75 73 65 |am BUFFER is use| 00000660 64 20 74 6f 20 67 65 6e 65 72 61 74 65 20 61 6e |d to generate an| 00000670 20 6f 62 6a 65 63 74 20 63 6f 64 65 20 66 69 6c | object code fil| 00000680 65 20 6a 75 73 74 0d 75 6e 64 65 72 20 26 31 30 |e just.under &10| 00000690 30 20 62 79 74 65 73 20 6c 6f 6e 67 2e 20 57 68 |0 bytes long. Wh| 000006a0 65 6e 20 74 68 65 20 6f 62 6a 65 63 74 20 63 6f |en the object co| 000006b0 64 65 20 69 73 20 6c 6f 61 64 65 64 20 69 6e 74 |de is loaded int| 000006c0 6f 20 53 57 52 20 69 74 20 75 73 65 73 0d 74 68 |o SWR it uses.th| 000006d0 65 20 72 65 6d 61 69 6e 69 6e 67 20 31 35 2e 37 |e remaining 15.7| 000006e0 35 6b 20 69 6e 20 74 68 65 20 72 61 6d 20 62 61 |5k in the ram ba| 000006f0 6e 6b 20 61 73 20 61 20 70 61 72 61 6c 6c 65 6c |nk as a parallel| 00000700 20 70 72 69 6e 74 65 72 20 62 75 66 66 65 72 2e | printer buffer.| 00000710 0d 57 68 65 6e 20 73 69 64 65 77 61 79 73 20 72 |.When sideways r| 00000720 61 6d 20 69 73 20 75 73 65 64 20 69 6e 20 74 68 |am is used in th| 00000730 69 73 20 77 61 79 20 74 68 65 20 73 69 7a 65 20 |is way the size | 00000740 6f 66 20 74 68 65 20 6f 62 6a 65 63 74 20 63 6f |of the object co| 00000750 64 65 0d 6e 65 65 64 73 20 74 6f 20 62 65 20 61 |de.needs to be a| 00000760 73 20 73 6d 61 6c 6c 20 61 73 20 70 6f 73 73 69 |s small as possi| 00000770 62 6c 65 2e 20 46 6f 72 20 74 68 69 73 20 72 65 |ble. For this re| 00000780 61 73 6f 6e 20 61 20 6e 75 6d 62 65 72 20 6f 66 |ason a number of| 00000790 0d 74 65 63 68 6e 69 71 75 65 73 20 68 61 76 65 |.techniques have| 000007a0 20 62 65 65 6e 20 75 73 65 64 20 69 6e 20 74 68 | been used in th| 000007b0 65 20 73 6f 75 72 63 65 20 63 6f 64 65 20 74 6f |e source code to| 000007c0 20 6d 61 6b 65 20 74 68 65 20 6f 62 6a 65 63 74 | make the object| 000007d0 20 63 6f 64 65 0d 66 69 74 20 69 6e 74 6f 20 6a | code.fit into j| 000007e0 75 73 74 20 6f 6e 65 20 70 61 67 65 20 6f 66 20 |ust one page of | 000007f0 6d 65 6d 6f 72 79 2e 0d 0d 20 20 54 68 65 20 53 |memory... The S| 00000800 57 52 20 68 65 61 64 65 72 20 75 73 65 64 20 62 |WR header used b| 00000810 79 20 74 68 65 20 62 75 66 66 65 72 20 69 73 20 |y the buffer is | 00000820 61 73 20 73 6d 61 6c 6c 20 61 73 20 69 74 20 63 |as small as it c| 00000830 61 6e 20 62 65 2e 20 41 6c 6c 20 74 68 65 0d 6f |an be. All the.o| 00000840 70 74 69 6f 6e 61 6c 20 63 6f 64 69 6e 67 20 68 |ptional coding h| 00000850 61 73 20 62 65 65 6e 20 6c 65 66 74 20 6f 75 74 |as been left out| 00000860 2e 20 54 68 65 72 65 20 69 73 20 6e 6f 20 62 69 |. There is no bi| 00000870 6e 61 72 79 20 76 65 72 73 69 6f 6e 20 6e 75 6d |nary version num| 00000880 62 65 72 2c 0d 74 69 74 6c 65 20 73 74 72 69 6e |ber,.title strin| 00000890 67 2c 20 76 65 72 73 69 6f 6e 20 73 74 72 69 6e |g, version strin| 000008a0 67 2c 20 63 6f 70 79 72 69 67 68 74 20 6d 65 73 |g, copyright mes| 000008b0 73 61 67 65 20 6f 72 20 74 75 62 65 20 72 65 6c |sage or tube rel| 000008c0 6f 63 61 74 69 6f 6e 0d 61 64 64 72 65 73 73 2e |ocation.address.| 000008d0 20 4a 75 73 74 20 74 68 65 20 65 73 73 65 6e 74 | Just the essent| 000008e0 69 61 6c 20 6a 75 6d 70 20 74 6f 20 74 68 65 20 |ial jump to the | 000008f0 73 65 72 76 69 63 65 20 65 6e 74 72 79 20 70 6f |service entry po| 00000900 69 6e 74 2c 20 72 6f 6d 20 74 79 70 65 0d 62 79 |int, rom type.by| 00000910 74 65 2c 20 63 6f 70 79 72 69 67 68 74 20 6f 66 |te, copyright of| 00000920 66 73 65 74 20 70 6f 69 6e 74 65 72 20 61 6e 64 |fset pointer and| 00000930 20 6d 69 6e 69 6d 75 6d 20 63 6f 70 79 72 69 67 | minimum copyrig| 00000940 68 74 20 73 74 72 69 6e 67 20 28 6c 69 6e 65 73 |ht string (lines| 00000950 0d 32 35 30 2d 33 34 30 29 2e 20 52 65 73 65 74 |.250-340). Reset| 00000960 69 6e 67 20 74 68 65 20 75 73 65 72 20 70 72 69 |ing the user pri| 00000970 6e 74 20 76 65 63 74 6f 72 20 69 73 20 64 6f 6e |nt vector is don| 00000980 65 20 77 69 74 68 20 74 68 65 20 6d 69 6e 69 6d |e with the minim| 00000990 75 6d 20 6f 66 0d 63 6f 64 69 6e 67 20 62 79 20 |um of.coding by | 000009a0 74 61 6b 69 6e 67 20 74 68 65 20 4f 73 62 79 74 |taking the Osbyt| 000009b0 65 20 26 41 38 20 63 61 6c 6c 20 6f 75 74 20 6f |e &A8 call out o| 000009c0 66 20 74 68 65 20 6f 62 6a 65 63 74 20 63 6f 64 |f the object cod| 000009d0 65 20 28 6c 69 6e 65 73 0d 31 38 30 2d 32 31 30 |e (lines.180-210| 000009e0 29 2e 20 54 68 65 20 73 65 72 76 69 63 65 20 63 |). The service c| 000009f0 61 6c 6c 20 69 6e 74 65 72 70 72 65 74 65 72 20 |all interpreter | 00000a00 64 6f 65 73 20 6e 6f 74 20 69 6d 70 6c 65 6d 65 |does not impleme| 00000a10 6e 74 20 2a 20 63 6f 6d 6d 61 6e 64 73 0d 74 6f |nt * commands.to| 00000a20 20 65 6e 61 62 6c 65 20 74 68 65 20 62 75 66 66 | enable the buff| 00000a30 65 72 20 62 75 74 20 69 6e 73 74 65 61 64 20 69 |er but instead i| 00000a40 6e 74 65 72 63 65 70 74 73 20 73 65 72 76 69 63 |ntercepts servic| 00000a50 65 20 63 61 6c 6c 20 26 46 45 20 28 74 75 62 65 |e call &FE (tube| 00000a60 0d 73 79 73 74 65 6d 20 70 6f 73 74 20 69 6e 69 |.system post ini| 00000a70 74 69 61 6c 69 73 61 74 69 6f 6e 29 20 74 6f 20 |tialisation) to | 00000a80 73 65 74 20 75 70 20 74 68 65 20 75 73 65 72 20 |set up the user | 00000a90 70 72 69 6e 74 20 65 78 74 65 6e 64 65 64 20 76 |print extended v| 00000aa0 65 63 74 6f 72 0d 74 6f 20 70 6f 69 6e 74 20 74 |ector.to point t| 00000ab0 6f 20 74 68 65 20 70 72 69 6e 74 65 72 20 62 75 |o the printer bu| 00000ac0 66 66 65 72 20 63 6f 64 65 20 28 6c 69 6e 65 73 |ffer code (lines| 00000ad0 20 34 37 30 2d 37 31 30 29 2e 0d 0d 20 20 54 6f | 470-710)... To| 00000ae0 20 75 73 65 20 74 68 65 20 62 75 66 66 65 72 20 | use the buffer | 00000af0 6c 6f 61 64 20 74 68 65 20 6f 62 6a 65 63 74 20 |load the object | 00000b00 63 6f 64 65 20 69 6e 74 6f 20 53 57 52 20 61 6e |code into SWR an| 00000b10 64 20 70 72 65 73 73 20 74 68 65 20 42 72 65 61 |d press the Brea| 00000b20 6b 0d 6b 65 79 2e 20 53 65 72 76 69 63 65 20 63 |k.key. Service c| 00000b30 61 6c 6c 20 26 46 45 20 69 73 20 61 6c 77 61 79 |all &FE is alway| 00000b40 73 20 69 73 73 75 65 64 20 6f 6e 20 72 65 73 65 |s issued on rese| 00000b50 74 20 61 6e 64 20 73 6f 20 74 68 65 20 62 75 66 |t and so the buf| 00000b60 66 65 72 20 77 69 6c 6c 0d 62 65 20 69 6e 69 74 |fer will.be init| 00000b70 69 61 6c 69 73 65 64 20 65 76 65 72 79 20 74 69 |ialised every ti| 00000b80 6d 65 20 79 6f 75 20 70 72 65 73 73 20 42 72 65 |me you press Bre| 00000b90 61 6b 2e 0d 0d 20 20 41 66 74 65 72 20 70 72 65 |ak... After pre| 00000ba0 73 73 69 6e 67 20 74 68 65 20 42 72 65 61 6b 20 |ssing the Break | 00000bb0 6b 65 79 20 74 79 70 65 20 2a 46 58 35 2c 33 20 |key type *FX5,3 | 00000bc0 74 6f 20 65 6e 61 62 6c 65 20 74 68 65 20 62 75 |to enable the bu| 00000bd0 66 66 65 72 2e 20 54 68 65 0d 70 72 69 6e 74 65 |ffer. The.printe| 00000be0 72 20 63 61 6e 20 74 68 65 6e 20 62 65 20 75 73 |r can then be us| 00000bf0 65 64 20 61 73 20 6e 6f 72 6d 61 6c 20 62 75 74 |ed as normal but| 00000c00 20 77 69 74 68 20 61 20 31 35 2e 37 35 6b 20 62 | with a 15.75k b| 00000c10 75 66 66 65 72 2e 20 54 79 70 65 0d 2a 46 58 35 |uffer. Type.*FX5| 00000c20 2c 31 20 6f 72 20 70 72 65 73 73 20 43 74 72 6c |,1 or press Ctrl| 00000c30 2b 42 72 65 61 6b 20 74 6f 20 64 69 73 61 62 6c |+Break to disabl| 00000c40 65 20 74 68 65 20 62 75 66 66 65 72 20 61 66 74 |e the buffer aft| 00000c50 65 72 20 70 72 69 6e 74 69 6e 67 20 68 61 73 0d |er printing has.| 00000c60 62 65 65 6e 20 63 6f 6d 70 6c 65 74 65 64 2e 0d |been completed..| 00000c70 0d 20 20 54 68 65 20 62 75 66 66 65 72 20 77 61 |. The buffer wa| 00000c80 73 20 64 65 73 69 67 6e 65 64 20 74 6f 20 62 65 |s designed to be| 00000c90 20 75 73 65 64 20 77 69 74 68 20 61 6e 20 45 70 | used with an Ep| 00000ca0 73 6f 6e 20 70 61 72 61 6c 6c 65 6c 20 70 72 69 |son parallel pri| 00000cb0 6e 74 65 72 0d 61 6e 64 20 6d 61 79 20 6e 6f 74 |nter.and may not| 00000cc0 20 62 65 20 73 75 69 74 61 62 6c 65 20 66 6f 72 | be suitable for| 00000cd0 20 6f 74 68 65 72 20 70 61 72 61 6c 6c 65 6c 20 | other parallel | 00000ce0 70 72 69 6e 74 65 72 73 20 75 6e 6c 65 73 73 20 |printers unless | 00000cf0 74 68 65 79 20 75 73 65 0d 74 68 65 20 73 61 6d |they use.the sam| 00000d00 65 20 43 65 6e 74 72 6f 6e 69 63 73 20 70 72 6f |e Centronics pro| 00000d10 74 6f 63 6f 6c 20 61 73 20 74 68 65 20 45 70 73 |tocol as the Eps| 00000d20 6f 6e 20 72 61 6e 67 65 20 28 6d 6f 73 74 20 70 |on range (most p| 00000d30 61 72 61 6c 6c 65 6c 0d 70 72 69 6e 74 65 72 73 |arallel.printers| 00000d40 20 75 73 65 20 74 68 65 20 43 65 6e 74 72 6f 6e | use the Centron| 00000d50 69 63 73 20 70 72 6f 74 6f 63 6f 6c 29 2e 20 49 |ics protocol). I| 00000d60 74 20 69 73 20 75 6e 73 75 69 74 61 62 6c 65 20 |t is unsuitable | 00000d70 66 6f 72 20 61 6c 6c 20 73 65 72 69 61 6c 0d 70 |for all serial.p| 00000d80 72 69 6e 74 65 72 73 20 61 6e 64 20 49 20 73 75 |rinters and I su| 00000d90 73 70 65 63 74 20 74 68 61 74 20 74 68 65 20 65 |spect that the e| 00000da0 61 72 6c 79 20 76 65 72 73 69 6f 6e 73 20 6f 66 |arly versions of| 00000db0 20 74 68 65 20 53 6f 6c 69 64 69 73 6b 0d 73 69 | the Solidisk.si| 00000dc0 64 65 77 61 79 73 20 72 61 6d 20 62 6f 61 72 64 |deways ram board| 00000dd0 73 20 6d 61 79 20 6e 6f 74 20 61 6c 6c 6f 77 20 |s may not allow | 00000de0 74 68 69 73 20 70 72 6f 67 72 61 6d 20 74 6f 20 |this program to | 00000df0 77 6f 72 6b 20 70 72 6f 70 65 72 6c 79 2c 0d 61 |work properly,.a| 00000e00 6c 74 68 6f 75 67 68 20 49 20 68 61 76 65 20 6e |lthough I have n| 00000e10 6f 74 20 62 65 65 6e 20 61 62 6c 65 20 74 6f 20 |ot been able to | 00000e20 74 65 73 74 20 74 68 65 20 70 72 6f 67 72 61 6d |test the program| 00000e30 20 77 69 74 68 20 6f 6e 65 20 74 6f 20 63 6f 6e | with one to con| 00000e40 66 69 72 6d 0d 74 68 69 73 20 73 75 73 70 69 63 |firm.this suspic| 00000e50 69 6f 6e 2e 0d 0d 20 20 54 68 65 20 75 73 65 72 |ion... The user| 00000e60 20 70 72 69 6e 74 20 76 65 63 74 6f 72 20 69 73 | print vector is| 00000e70 20 6e 6f 72 6d 61 6c 6c 79 20 75 73 65 64 20 74 | normally used t| 00000e80 6f 20 70 72 6f 76 69 64 65 20 61 20 70 72 69 6e |o provide a prin| 00000e90 74 65 72 20 64 72 69 76 65 72 0d 66 6f 72 20 70 |ter driver.for p| 00000ea0 72 69 6e 74 65 72 73 20 77 68 69 63 68 20 64 6f |rinters which do| 00000eb0 20 6e 6f 74 20 68 61 76 65 20 65 69 74 68 65 72 | not have either| 00000ec0 20 61 20 43 65 6e 74 72 6f 6e 69 63 73 20 70 61 | a Centronics pa| 00000ed0 72 61 6c 6c 65 6c 20 6f 72 20 61 0d 73 74 61 6e |rallel or a.stan| 00000ee0 64 61 72 64 20 73 65 72 69 61 6c 20 69 6e 74 65 |dard serial inte| 00000ef0 72 66 61 63 65 2e 20 57 69 74 68 20 74 68 69 73 |rface. With this| 00000f00 20 70 72 69 6e 74 65 72 20 62 75 66 66 65 72 20 | printer buffer | 00000f10 70 72 6f 67 72 61 6d 20 74 68 65 20 75 73 65 72 |program the user| 00000f20 0d 70 72 69 6e 74 20 76 65 63 74 6f 72 20 69 6e |.print vector in| 00000f30 74 65 72 66 61 63 65 73 20 74 68 65 20 70 72 69 |terfaces the pri| 00000f40 6e 74 65 72 20 62 75 66 66 65 72 20 77 69 74 68 |nter buffer with| 00000f50 20 74 68 65 20 53 57 52 20 62 75 66 66 65 72 20 | the SWR buffer | 00000f60 61 6e 64 20 74 68 65 0d 70 72 69 6e 74 65 72 20 |and the.printer | 00000f70 68 61 72 64 77 61 72 65 2e 0d 0d 20 20 54 68 65 |hardware... The| 00000f80 20 62 75 66 66 65 72 20 70 72 6f 67 72 61 6d 20 | buffer program | 00000f90 72 65 61 64 73 20 64 61 74 61 20 66 72 6f 6d 20 |reads data from | 00000fa0 74 68 65 20 70 72 69 6e 74 65 72 20 62 75 66 66 |the printer buff| 00000fb0 65 72 20 75 73 69 6e 67 20 4f 73 62 79 74 65 0d |er using Osbyte.| 00000fc0 26 39 31 20 28 6c 69 6e 65 73 20 31 30 32 30 2d |&91 (lines 1020-| 00000fd0 31 30 34 30 29 20 61 6e 64 20 77 72 69 74 65 73 |1040) and writes| 00000fe0 20 69 74 20 69 6e 74 6f 20 74 68 65 20 53 57 52 | it into the SWR| 00000ff0 20 62 75 66 66 65 72 20 75 73 69 6e 67 20 61 0d | buffer using a.| 00001000 70 6f 69 6e 74 65 72 20 28 6c 69 6e 65 20 31 30 |pointer (line 10| 00001010 38 30 29 20 74 6f 20 69 6e 64 69 63 61 74 65 20 |80) to indicate | 00001020 74 68 65 20 70 6f 73 69 74 69 6f 6e 20 69 6e 20 |the position in | 00001030 53 57 52 20 74 6f 20 73 74 6f 72 65 20 65 61 63 |SWR to store eac| 00001040 68 0d 69 6e 64 69 76 69 64 75 61 6c 20 62 79 74 |h.individual byt| 00001050 65 2e 20 54 68 65 20 64 61 74 61 20 69 73 20 72 |e. The data is r| 00001060 65 61 64 20 66 72 6f 6d 20 74 68 65 20 53 57 52 |ead from the SWR| 00001070 20 62 75 66 66 65 72 20 75 73 69 6e 67 20 61 6e | buffer using an| 00001080 6f 74 68 65 72 0d 70 6f 69 6e 74 65 72 20 28 6c |other.pointer (l| 00001090 69 6e 65 20 31 35 34 30 29 20 74 6f 20 69 6e 64 |ine 1540) to ind| 000010a0 69 63 61 74 65 20 74 68 65 20 62 79 74 65 20 74 |icate the byte t| 000010b0 6f 20 62 65 20 77 72 69 74 74 65 6e 20 69 6e 74 |o be written int| 000010c0 6f 20 74 68 65 20 56 49 41 2d 42 0d 70 72 69 6e |o the VIA-B.prin| 000010d0 74 65 72 20 6f 75 74 70 75 74 20 72 65 67 69 73 |ter output regis| 000010e0 74 65 72 2e 20 57 68 65 6e 20 61 20 62 79 74 65 |ter. When a byte| 000010f0 20 69 73 20 72 65 63 69 65 76 65 64 20 62 79 20 | is recieved by | 00001100 74 68 65 20 70 72 69 6e 74 65 72 20 74 68 65 0d |the printer the.| 00001110 61 63 6b 6e 6f 77 6c 65 64 67 65 20 6c 69 6e 65 |acknowledge line| 00001120 20 67 6f 65 73 20 6c 6f 77 20 61 6e 64 20 67 65 | goes low and ge| 00001130 6e 65 72 61 74 65 73 20 61 6e 20 49 52 51 20 69 |nerates an IRQ i| 00001140 6e 74 65 72 75 70 74 2e 20 54 68 69 73 20 69 73 |nterupt. This is| 00001150 20 74 68 65 0d 73 6f 75 72 63 65 20 6f 66 20 74 | the.source of t| 00001160 68 65 20 69 6e 74 65 72 75 70 74 20 70 72 6f 63 |he interupt proc| 00001170 65 73 73 65 64 20 62 79 20 74 68 65 20 70 72 6f |essed by the pro| 00001180 67 72 61 6d 2e 0d 0d 20 20 54 68 65 20 70 6f 69 |gram... The poi| 00001190 6e 74 65 72 73 20 61 72 65 20 75 70 64 61 74 65 |nters are update| 000011a0 64 20 77 69 74 68 20 65 76 65 72 79 20 72 65 61 |d with every rea| 000011b0 64 20 61 6e 64 20 77 72 69 74 65 20 6f 66 20 74 |d and write of t| 000011c0 68 65 20 53 57 52 20 62 75 66 66 65 72 0d 61 6e |he SWR buffer.an| 000011d0 64 20 77 68 65 6e 20 61 20 70 6f 69 6e 74 65 72 |d when a pointer| 000011e0 20 72 65 61 63 68 65 73 20 26 43 30 30 30 20 69 | reaches &C000 i| 000011f0 74 20 69 73 20 72 65 73 65 74 20 74 6f 20 26 38 |t is reset to &8| 00001200 31 30 30 20 28 6c 69 6e 65 73 20 39 30 30 2d 39 |100 (lines 900-9| 00001210 32 30 0d 61 6e 64 20 6c 69 6e 65 73 20 31 36 32 |20.and lines 162| 00001220 30 2d 31 36 34 30 29 2e 20 57 68 65 6e 20 74 68 |0-1640). When th| 00001230 65 20 6c 61 73 74 20 63 68 61 72 61 63 74 65 72 |e last character| 00001240 20 69 6e 20 74 68 65 20 62 75 66 66 65 72 20 68 | in the buffer h| 00001250 61 73 20 62 65 65 6e 0d 70 72 69 6e 74 65 64 20 |as been.printed | 00001260 74 68 65 20 70 72 69 6e 74 65 72 20 64 72 69 76 |the printer driv| 00001270 65 72 20 64 65 63 6c 61 72 65 73 20 69 74 73 65 |er declares itse| 00001280 6c 66 20 64 6f 72 6d 61 6e 74 20 61 6e 64 20 74 |lf dormant and t| 00001290 68 65 20 4d 4f 53 20 69 73 0d 69 6e 66 6f 72 6d |he MOS is.inform| 000012a0 65 64 20 75 73 69 6e 67 20 4f 73 62 79 74 65 20 |ed using Osbyte | 000012b0 26 37 42 20 28 6c 69 6e 65 73 20 31 33 35 30 2d |&7B (lines 1350-| 000012c0 31 34 37 30 29 2e 20 57 68 65 6e 20 61 6c 6c 20 |1470). When all | 000012d0 74 68 65 20 64 61 74 61 20 69 73 0d 65 69 74 68 |the data is.eith| 000012e0 65 72 20 70 72 69 6e 74 65 64 20 6f 72 20 69 6e |er printed or in| 000012f0 20 74 68 65 20 53 57 52 20 62 75 66 66 65 72 20 | the SWR buffer | 00001300 74 68 65 20 63 6f 6d 70 75 74 65 72 20 69 73 20 |the computer is | 00001310 72 65 6c 65 61 73 65 64 20 74 6f 0d 63 6f 6e 74 |released to.cont| 00001320 69 6e 75 65 20 77 69 74 68 20 6f 74 68 65 72 20 |inue with other | 00001330 74 61 73 6b 73 20 62 75 74 20 79 6f 75 20 6d 75 |tasks but you mu| 00001340 73 74 20 6e 6f 74 20 70 72 65 73 73 20 74 68 65 |st not press the| 00001350 20 42 72 65 61 6b 20 6b 65 79 20 6f 72 20 75 73 | Break key or us| 00001360 65 0d 2a 46 58 35 20 75 6e 74 69 6c 20 61 6c 6c |e.*FX5 until all| 00001370 20 70 72 69 6e 74 69 6e 67 20 68 61 73 20 62 65 | printing has be| 00001380 65 6e 20 63 6f 6d 70 6c 65 74 65 64 2e 20 59 6f |en completed. Yo| 00001390 75 20 63 61 6e 20 63 6f 6e 74 69 6e 75 65 20 77 |u can continue w| 000013a0 69 74 68 20 61 6e 79 0d 74 61 73 6b 20 73 75 63 |ith any.task suc| 000013b0 68 20 61 73 20 77 6f 72 64 20 70 72 6f 63 65 73 |h as word proces| 000013c0 73 69 6e 67 20 6f 72 20 70 72 6f 67 72 61 6d 6d |sing or programm| 000013d0 69 6e 67 20 77 68 69 6c 65 20 74 68 65 20 70 72 |ing while the pr| 000013e0 69 6e 74 65 72 20 69 73 20 75 73 69 6e 67 0d 74 |inter is using.t| 000013f0 68 65 20 64 61 74 61 20 69 6e 20 53 57 52 20 70 |he data in SWR p| 00001400 72 69 6e 74 65 72 20 62 75 66 66 65 72 2e 0d 0d |rinter buffer...| 00001410 20 20 54 68 65 20 36 35 32 32 20 56 49 41 20 75 | The 6522 VIA u| 00001420 73 65 64 20 74 6f 20 63 6f 6e 74 72 6f 6c 20 74 |sed to control t| 00001430 68 65 20 70 61 72 61 6c 6c 65 6c 20 70 72 69 6e |he parallel prin| 00001440 74 65 72 20 69 6e 74 65 72 66 61 63 65 20 69 73 |ter interface is| 00001450 20 71 75 69 74 65 0d 61 20 63 6f 6d 70 6c 65 78 | quite.a complex| 00001460 20 64 65 76 69 63 65 20 63 6f 6e 74 72 6f 6c 65 | device controle| 00001470 64 20 62 79 20 31 36 20 72 65 67 69 73 74 65 72 |d by 16 register| 00001480 73 2e 20 54 68 65 20 56 49 41 2d 42 20 72 65 67 |s. The VIA-B reg| 00001490 69 73 74 65 72 73 20 61 72 65 0d 6d 61 70 70 65 |isters are.mappe| 000014a0 64 20 6f 6e 74 6f 20 53 68 65 69 6c 61 20 61 64 |d onto Sheila ad| 000014b0 64 72 65 73 73 65 73 20 26 36 30 20 74 6f 20 26 |dresses &60 to &| 000014c0 36 46 20 61 73 20 73 68 6f 77 6e 20 69 6e 20 66 |6F as shown in f| 000014d0 69 67 75 72 65 20 31 34 2e 31 0d 0d 0d 0d 0d 20 |igure 14.1..... | 000014e0 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +----------| 000014f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001500 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 26 46 45 |-----------+.&FE| 00001510 36 46 20 21 20 41 20 49 6e 70 75 74 2f 4f 75 74 |6F ! A Input/Out| 00001520 70 75 74 20 28 6e 6f 20 68 61 6e 64 73 68 61 6b |put (no handshak| 00001530 65 29 20 20 20 20 20 20 20 21 0d 20 20 20 20 20 |e) !. | 00001540 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +--------------| 00001550 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001560 2d 2d 2d 2d 2d 2d 2d 2b 0d 26 46 45 36 45 20 21 |-------+.&FE6E !| 00001570 20 49 6e 74 65 72 75 70 74 20 63 6f 6e 74 72 6f | Interupt contro| 00001580 6c 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |l | 00001590 20 20 20 20 20 21 0d 20 20 20 20 20 20 2b 2d 2d | !. +--| 000015a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000015c0 2d 2d 2d 2b 0d 26 46 45 36 44 20 21 20 49 6e 74 |---+.&FE6D ! Int| 000015d0 65 72 75 70 74 20 73 74 61 74 75 73 20 20 20 20 |erupt status | 000015e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000015f0 20 21 0d 20 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d | !. +------| 00001600 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001610 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b |---------------+| 00001620 0d 26 46 45 36 43 20 21 20 50 65 72 69 70 68 65 |.&FE6C ! Periphe| 00001630 72 61 6c 20 63 6f 6e 74 72 6f 6c 20 28 68 61 6e |ral control (han| 00001640 64 73 68 61 6b 65 29 20 20 20 20 20 20 21 0d 20 |dshake) !. | 00001650 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +----------| 00001660 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001670 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 26 46 45 |-----------+.&FE| 00001680 36 42 20 21 20 41 75 78 69 6c 69 61 72 79 20 28 |6B ! Auxiliary (| 00001690 74 69 6d 65 72 2f 73 68 69 66 74 20 72 65 67 29 |timer/shift reg)| 000016a0 20 63 6f 6e 74 72 6f 6c 20 21 0d 20 20 20 20 20 | control !. | 000016b0 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +--------------| 000016c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000016d0 2d 2d 2d 2d 2d 2d 2d 2b 0d 26 46 45 36 41 20 21 |-------+.&FE6A !| 000016e0 20 53 68 69 66 74 20 72 65 67 69 73 74 65 72 20 | Shift register | 000016f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001700 20 20 20 20 20 21 0d 20 20 20 20 20 20 2b 2d 2d | !. +--| 00001710 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001730 2d 2d 2d 2b 0d 26 46 45 36 39 20 21 20 54 69 6d |---+.&FE69 ! Tim| 00001740 65 72 20 32 20 4d 53 42 20 63 6f 75 6e 74 65 72 |er 2 MSB counter| 00001750 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001760 20 21 0d 20 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d | !. +------| 00001770 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001780 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b |---------------+| 00001790 0d 26 46 45 36 38 20 21 20 54 69 6d 65 72 20 32 |.&FE68 ! Timer 2| 000017a0 20 4c 53 42 20 6c 61 74 63 68 2f 63 6f 75 6e 74 | LSB latch/count| 000017b0 65 72 20 20 20 20 20 20 20 20 20 20 20 21 0d 20 |er !. | 000017c0 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +----------| 000017d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000017e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 26 46 45 |-----------+.&FE| 000017f0 36 37 20 21 20 54 69 6d 65 72 20 31 20 4d 53 42 |67 ! Timer 1 MSB| 00001800 20 6c 61 74 63 68 20 20 20 20 20 20 20 20 20 20 | latch | 00001810 20 20 20 20 20 20 20 20 20 21 0d 20 20 20 20 20 | !. | 00001820 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +--------------| 00001830 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001840 2d 2d 2d 2d 2d 2d 2d 2b 0d 26 46 45 36 36 20 21 |-------+.&FE66 !| 00001850 20 54 69 6d 65 72 20 31 20 4c 53 42 20 6c 61 74 | Timer 1 LSB lat| 00001860 63 68 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |ch | 00001870 20 20 20 20 20 21 0d 20 20 20 20 20 20 2b 2d 2d | !. +--| 00001880 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000018a0 2d 2d 2d 2b 0d 26 46 45 36 35 20 21 20 54 69 6d |---+.&FE65 ! Tim| 000018b0 65 72 20 31 20 4d 53 42 20 6c 61 74 63 68 2f 63 |er 1 MSB latch/c| 000018c0 6f 75 6e 74 65 72 20 20 20 20 20 20 20 20 20 20 |ounter | 000018d0 20 21 0d 20 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d | !. +------| 000018e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000018f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b |---------------+| 00001900 0d 26 46 45 36 34 20 21 20 54 69 6d 65 72 20 31 |.&FE64 ! Timer 1| 00001910 20 4c 53 42 20 6c 61 74 63 68 2f 63 6f 75 6e 74 | LSB latch/count| 00001920 65 72 20 20 20 20 20 20 20 20 20 20 20 21 0d 20 |er !. | 00001930 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +----------| 00001940 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001950 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 26 46 45 |-----------+.&FE| 00001960 36 33 20 21 20 44 69 72 65 63 74 69 6f 6e 20 72 |63 ! Direction r| 00001970 65 67 69 73 74 65 72 20 41 20 20 20 20 20 20 20 |egister A | 00001980 20 20 20 20 20 20 20 20 20 21 0d 20 20 20 20 20 | !. | 00001990 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +--------------| 000019a0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000019b0 2d 2d 2d 2d 2d 2d 2d 2b 0d 26 46 45 36 32 20 21 |-------+.&FE62 !| 000019c0 20 44 69 72 65 63 74 69 6f 6e 20 72 65 67 69 73 | Direction regis| 000019d0 74 65 72 20 42 20 20 20 20 20 20 20 20 20 20 20 |ter B | 000019e0 20 20 20 20 20 21 0d 20 20 20 20 20 20 2b 2d 2d | !. +--| 000019f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00001a10 2d 2d 2d 2b 0d 26 46 45 36 31 20 21 20 41 20 49 |---+.&FE61 ! A I| 00001a20 6e 70 75 74 2f 4f 75 74 70 75 74 20 20 20 20 20 |nput/Output | 00001a30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001a40 20 21 0d 20 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d | !. +------| 00001a50 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001a60 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b |---------------+| 00001a70 0d 26 46 45 36 30 20 21 20 42 20 49 6e 70 75 74 |.&FE60 ! B Input| 00001a80 2f 4f 75 74 70 75 74 20 20 20 20 20 20 20 20 20 |/Output | 00001a90 20 20 20 20 20 20 20 20 20 20 20 20 20 21 0d 20 | !. | 00001aa0 20 20 20 20 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +----------| 00001ab0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00001ac0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 0d 46 69 |-----------+..Fi| 00001ad0 67 75 72 65 20 31 34 2e 31 20 20 54 68 65 20 56 |gure 14.1 The V| 00001ae0 49 41 2d 42 20 72 65 67 69 73 74 65 72 73 0d 2d |IA-B registers.-| 00001af0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 20 2d 2d 2d 2d |---------- ----| 00001b00 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d |---------------.| 00001b10 0d 0d 0d 20 20 42 6f 74 68 20 56 49 41 73 20 68 |... Both VIAs h| 00001b20 61 76 65 20 32 30 20 49 2f 4f 20 6c 69 6e 65 73 |ave 20 I/O lines| 00001b30 20 67 72 6f 75 70 65 64 20 69 6e 74 6f 20 61 6e | grouped into an| 00001b40 20 41 20 73 69 64 65 20 61 6e 64 20 61 20 42 20 | A side and a B | 00001b50 73 69 64 65 20 6f 66 0d 31 30 20 6c 69 6e 65 73 |side of.10 lines| 00001b60 20 65 61 63 68 2e 20 54 68 65 73 65 20 31 30 20 | each. These 10 | 00001b70 6c 69 6e 65 73 20 61 72 65 20 64 69 76 69 64 65 |lines are divide| 00001b80 64 20 69 6e 74 6f 20 38 20 64 61 74 61 20 6c 69 |d into 8 data li| 00001b90 6e 65 73 20 61 6e 64 20 32 0d 68 61 6e 64 73 68 |nes and 2.handsh| 00001ba0 61 6b 65 20 6c 69 6e 65 73 2e 20 54 68 65 20 64 |ake lines. The d| 00001bb0 61 74 61 20 6c 69 6e 65 73 20 61 72 65 20 63 61 |ata lines are ca| 00001bc0 6c 6c 65 64 20 50 41 30 20 74 6f 20 50 41 37 20 |lled PA0 to PA7 | 00001bd0 6f 6e 20 74 68 65 20 41 20 73 69 64 65 0d 61 6e |on the A side.an| 00001be0 64 20 50 42 30 20 74 6f 20 50 42 37 20 6f 6e 20 |d PB0 to PB7 on | 00001bf0 74 68 65 20 42 20 73 69 64 65 2e 20 54 68 65 20 |the B side. The | 00001c00 68 61 6e 64 73 68 61 6b 65 20 6c 69 6e 65 73 20 |handshake lines | 00001c10 61 72 65 20 63 61 6c 6c 65 64 20 43 41 31 20 61 |are called CA1 a| 00001c20 6e 64 0d 43 41 32 20 6f 6e 20 74 68 65 20 41 20 |nd.CA2 on the A | 00001c30 73 69 64 65 20 61 6e 64 20 43 42 31 20 61 6e 64 |side and CB1 and| 00001c40 20 43 42 32 20 6f 6e 20 74 68 65 20 42 20 73 69 | CB2 on the B si| 00001c50 64 65 2e 20 54 68 65 20 42 42 43 20 4d 69 63 72 |de. The BBC Micr| 00001c60 6f 20 75 73 65 73 0d 74 68 65 20 41 20 73 69 64 |o uses.the A sid| 00001c70 65 20 6f 66 20 56 49 41 2d 42 20 66 6f 72 20 74 |e of VIA-B for t| 00001c80 68 65 20 70 72 69 6e 74 65 72 20 69 6e 74 65 72 |he printer inter| 00001c90 66 61 63 65 20 61 6e 64 20 74 68 65 20 42 20 73 |face and the B s| 00001ca0 69 64 65 20 6f 66 20 56 49 41 2d 42 0d 66 6f 72 |ide of VIA-B.for| 00001cb0 20 74 68 65 20 75 73 65 72 20 70 6f 72 74 2e 20 | the user port. | 00001cc0 50 41 30 20 74 6f 20 50 41 37 20 61 72 65 20 75 |PA0 to PA7 are u| 00001cd0 73 65 64 20 61 73 20 74 68 65 20 6f 75 74 70 75 |sed as the outpu| 00001ce0 74 20 64 61 74 61 20 6c 69 6e 65 73 20 66 6f 72 |t data lines for| 00001cf0 0d 74 68 65 20 70 61 72 61 6c 6c 65 6c 20 70 72 |.the parallel pr| 00001d00 69 6e 74 65 72 2c 20 43 41 31 20 69 73 20 75 73 |inter, CA1 is us| 00001d10 65 64 20 66 6f 72 20 74 68 65 20 70 72 69 6e 74 |ed for the print| 00001d20 65 72 20 61 63 6b 6e 6f 77 6c 65 64 67 65 20 61 |er acknowledge a| 00001d30 6e 64 20 43 41 32 0d 66 6f 72 20 74 68 65 20 70 |nd CA2.for the p| 00001d40 72 69 6e 74 65 72 20 73 74 72 6f 62 65 2e 0d 0d |rinter strobe...| 00001d50 20 20 54 68 65 20 70 72 69 6e 74 65 72 20 62 75 | The printer bu| 00001d60 66 66 65 72 20 70 72 6f 67 72 61 6d 20 75 73 65 |ffer program use| 00001d70 73 20 74 68 65 20 6f 75 74 70 75 74 20 72 65 67 |s the output reg| 00001d80 69 73 74 65 72 20 61 74 20 26 46 45 36 31 2c 20 |ister at &FE61, | 00001d90 74 68 65 0d 70 65 72 69 70 68 65 72 61 6c 20 63 |the.peripheral c| 00001da0 6f 6e 74 72 6f 6c 20 72 65 67 69 73 74 65 72 20 |ontrol register | 00001db0 61 74 20 26 46 45 36 43 2c 20 74 68 65 20 69 6e |at &FE6C, the in| 00001dc0 74 65 72 75 70 74 20 73 74 61 74 75 73 20 72 65 |terupt status re| 00001dd0 67 69 73 74 65 72 20 61 74 0d 26 46 45 36 44 20 |gister at.&FE6D | 00001de0 61 6e 64 20 74 68 65 20 69 6e 74 65 72 75 70 74 |and the interupt| 00001df0 20 63 6f 6e 74 72 6f 6c 20 72 65 67 69 73 74 65 | control registe| 00001e00 72 20 61 74 20 26 46 45 36 45 2e 0d 0d 20 20 54 |r at &FE6E... T| 00001e10 68 65 20 70 65 72 69 70 68 65 72 61 6c 20 63 6f |he peripheral co| 00001e20 6e 74 72 6f 6c 20 72 65 67 69 73 74 65 72 20 69 |ntrol register i| 00001e30 73 20 75 73 65 64 20 74 6f 20 73 65 74 20 75 70 |s used to set up| 00001e40 20 74 68 65 20 68 61 6e 64 73 68 61 6b 69 6e 67 | the handshaking| 00001e50 0d 77 69 74 68 20 74 68 65 20 70 72 69 6e 74 65 |.with the printe| 00001e60 72 20 28 6c 69 6e 65 73 20 31 34 39 30 2d 31 35 |r (lines 1490-15| 00001e70 31 30 20 61 6e 64 20 6c 69 6e 65 20 31 35 35 30 |10 and line 1550| 00001e80 29 2e 20 54 68 65 20 6e 75 6d 62 65 72 20 26 30 |). The number &0| 00001e90 41 20 69 73 0d 73 74 6f 72 65 64 20 69 6e 20 74 |A is.stored in t| 00001ea0 68 65 20 6c 65 61 73 74 20 73 69 67 6e 69 66 69 |he least signifi| 00001eb0 63 61 6e 74 20 6e 79 62 62 6c 65 20 6f 66 20 74 |cant nybble of t| 00001ec0 68 69 73 20 72 65 67 69 73 74 65 72 20 61 6e 64 |his register and| 00001ed0 20 74 68 69 73 20 68 61 73 0d 74 68 65 20 65 66 | this has.the ef| 00001ee0 66 65 63 74 20 6f 66 20 73 65 6e 64 69 6e 67 20 |fect of sending | 00001ef0 61 20 73 74 72 6f 62 65 20 70 75 6c 73 65 20 28 |a strobe pulse (| 00001f00 43 41 32 20 6c 6f 77 29 20 74 6f 20 74 68 65 20 |CA2 low) to the | 00001f10 70 72 69 6e 74 65 72 20 66 6f 72 20 31 0d 63 79 |printer for 1.cy| 00001f20 63 6c 65 20 6f 66 20 74 68 65 20 31 20 4d 48 7a |cle of the 1 MHz| 00001f30 20 63 6c 6f 63 6b 20 66 6f 6c 6c 6f 77 69 6e 67 | clock following| 00001f40 20 61 20 77 72 69 74 65 20 74 6f 20 74 68 65 20 | a write to the | 00001f50 6f 75 74 70 75 74 20 72 65 67 69 73 74 65 72 20 |output register | 00001f60 61 74 0d 26 46 45 36 31 2e 20 54 68 65 20 43 65 |at.&FE61. The Ce| 00001f70 6e 74 72 6f 6e 69 63 73 20 69 6e 74 65 72 66 61 |ntronics interfa| 00001f80 63 65 20 72 65 71 75 69 72 65 73 20 61 20 73 74 |ce requires a st| 00001f90 72 6f 62 65 20 70 75 6c 73 65 20 77 69 64 74 68 |robe pulse width| 00001fa0 20 6f 66 20 61 74 0d 6c 65 61 73 74 20 30 2e 35 | of at.least 0.5| 00001fb0 20 6d 69 63 72 6f 20 73 65 63 6f 6e 64 73 20 61 | micro seconds a| 00001fc0 74 20 74 68 65 20 72 65 63 69 65 76 69 6e 67 20 |t the recieving | 00001fd0 74 65 72 6d 69 6e 61 6c 2e 20 54 68 65 20 70 65 |terminal. The pe| 00001fe0 72 69 70 68 65 72 61 6c 0d 63 6f 6e 74 72 6f 6c |ripheral.control| 00001ff0 20 72 65 67 69 73 74 65 72 20 69 73 20 73 68 6f | register is sho| 00002000 77 6e 20 69 6e 20 66 69 67 75 72 65 20 31 34 2e |wn in figure 14.| 00002010 32 20 77 69 74 68 20 62 69 74 73 20 31 20 61 6e |2 with bits 1 an| 00002020 64 20 33 20 73 65 74 20 28 73 65 65 0d 61 6c 73 |d 3 set (see.als| 00002030 6f 20 70 72 6f 67 72 61 6d 20 6c 69 6e 65 73 20 |o program lines | 00002040 31 34 39 30 2d 31 35 31 30 20 61 6e 64 20 6c 69 |1490-1510 and li| 00002050 6e 65 20 31 35 35 30 29 2e 0d 0d 0d 0d 0d 0d 0d |ne 1550)........| 00002060 20 20 20 20 37 20 20 20 20 20 20 20 36 20 20 20 | 7 6 | 00002070 20 20 20 20 35 20 20 20 20 20 20 20 34 20 20 20 | 5 4 | 00002080 20 20 20 20 33 20 20 20 20 20 20 20 32 20 20 20 | 3 2 | 00002090 20 20 20 20 31 20 20 20 20 20 20 20 30 0d 2b 2d | 1 0.+-| 000020a0 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2d 2d 2b 2d |------+-------+-| * 000020d0 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2d 2d 2b 0d |------+-------+.| 000020e0 21 20 20 20 20 20 20 20 20 20 20 43 42 32 20 20 |! CB2 | 000020f0 20 20 20 20 20 20 20 20 21 20 20 43 42 31 20 20 | ! CB1 | 00002100 21 20 20 20 20 20 20 20 20 20 20 43 41 32 20 20 |! CA2 | 00002110 20 20 20 20 20 20 20 20 21 20 20 43 41 31 20 20 | ! CA1 | 00002120 21 0d 21 20 20 20 20 20 20 20 20 63 6f 6e 74 72 |!.! contr| 00002130 6f 6c 20 20 20 20 20 20 20 20 21 63 6f 6e 74 72 |ol !contr| 00002140 6f 6c 21 20 20 20 20 20 20 20 20 63 6f 6e 74 72 |ol! contr| 00002150 6f 6c 20 20 20 20 20 20 20 20 21 63 6f 6e 74 72 |ol !contr| 00002160 6f 6c 21 0d 2b 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d |ol!.+-------+---| 00002170 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d |----+-------+---| * 000021a0 2d 2d 2d 2d 2b 0d 20 20 20 20 20 20 20 20 20 20 |----+. | 000021b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000021c0 20 20 20 20 20 20 20 20 20 20 31 20 20 20 20 20 | 1 | 000021d0 20 20 30 20 20 20 20 20 20 20 31 20 20 20 20 20 | 0 1 | 000021e0 20 20 30 20 20 20 20 20 26 30 41 0d 0d 46 69 67 | 0 &0A..Fig| 000021f0 75 72 65 20 31 34 2e 32 20 20 54 68 65 20 70 65 |ure 14.2 The pe| 00002200 72 69 70 68 65 72 61 6c 20 63 6f 6e 74 72 6f 6c |ripheral control| 00002210 20 28 68 61 6e 64 73 68 61 6b 65 29 20 72 65 67 | (handshake) reg| 00002220 69 73 74 65 72 2e 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d |ister..---------| 00002230 2d 2d 20 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |-- ------------| 00002240 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00002260 0d 0d 0d 0d 20 20 54 68 65 20 61 63 6b 6e 6f 77 |.... The acknow| 00002270 6c 65 64 67 65 20 6c 69 6e 65 20 69 73 20 63 6f |ledge line is co| 00002280 6e 6e 65 63 74 65 64 20 74 6f 20 43 41 31 20 61 |nnected to CA1 a| 00002290 6e 64 20 69 73 20 75 73 65 64 20 74 6f 20 67 65 |nd is used to ge| 000022a0 6e 65 72 61 74 65 20 61 6e 0d 69 6e 74 65 72 75 |nerate an.interu| 000022b0 70 74 20 77 68 65 6e 20 74 68 65 20 70 72 69 6e |pt when the prin| 000022c0 74 65 72 20 68 61 73 20 72 65 63 69 65 76 65 64 |ter has recieved| 000022d0 20 64 61 74 61 20 61 6e 64 20 69 73 20 72 65 61 | data and is rea| 000022e0 64 79 20 74 6f 20 61 63 63 65 70 74 0d 6d 6f 72 |dy to accept.mor| 000022f0 65 20 64 61 74 61 20 66 72 6f 6d 20 74 68 65 20 |e data from the | 00002300 70 72 69 6e 74 65 72 20 62 75 66 66 65 72 2e 20 |printer buffer. | 00002310 54 68 65 20 43 65 6e 74 72 6f 6e 69 63 73 20 70 |The Centronics p| 00002320 72 6f 74 6f 63 6f 6c 20 74 61 6b 65 73 20 74 68 |rotocol takes th| 00002330 65 0d 61 63 6b 6e 6f 77 6c 65 64 67 65 20 6c 69 |e.acknowledge li| 00002340 6e 65 20 6c 6f 77 20 66 6f 72 20 61 62 6f 75 74 |ne low for about| 00002350 20 31 32 20 6d 69 63 72 6f 20 73 65 63 6f 6e 64 | 12 micro second| 00002360 73 2e 20 43 41 31 20 69 73 20 72 65 73 65 74 20 |s. CA1 is reset | 00002370 74 6f 20 7a 65 72 6f 0d 69 6e 20 74 68 65 20 70 |to zero.in the p| 00002380 65 72 69 70 68 65 72 61 6c 20 63 6f 6e 74 72 6f |eripheral contro| 00002390 6c 20 72 65 67 69 73 74 65 72 20 28 6c 69 6e 65 |l register (line| 000023a0 73 20 31 34 39 30 2d 31 35 31 30 20 61 6e 64 20 |s 1490-1510 and | 000023b0 6c 69 6e 65 20 31 35 35 30 29 20 61 6e 64 0d 69 |line 1550) and.i| 000023c0 74 73 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 |ts corresponding| 000023d0 20 62 69 74 20 69 6e 20 74 68 65 20 69 6e 74 65 | bit in the inte| 000023e0 72 75 70 74 20 73 74 61 74 75 73 20 72 65 67 69 |rupt status regi| 000023f0 73 74 65 72 20 77 69 6c 6c 20 62 65 20 73 65 74 |ster will be set| 00002400 20 74 6f 20 31 0d 77 68 65 6e 20 74 68 65 20 76 | to 1.when the v| 00002410 6f 6c 74 61 67 65 20 6f 6e 20 74 68 65 20 43 41 |oltage on the CA| 00002420 31 20 69 6e 70 75 74 20 6c 69 6e 65 20 67 6f 65 |1 input line goe| 00002430 73 20 66 72 6f 6d 20 68 69 67 68 20 74 6f 20 6c |s from high to l| 00002440 6f 77 2e 20 43 41 31 20 77 69 6c 6c 0d 73 65 74 |ow. CA1 will.set| 00002450 20 61 20 62 69 74 20 69 6e 20 74 68 65 20 69 6e | a bit in the in| 00002460 74 65 72 75 70 74 20 73 74 61 74 75 73 20 72 65 |terupt status re| 00002470 67 69 73 74 65 72 20 61 6e 64 20 67 65 6e 65 72 |gister and gener| 00002480 61 74 65 20 61 6e 20 49 52 51 20 69 6e 74 65 72 |ate an IRQ inter| 00002490 75 70 74 0d 69 66 20 74 68 65 20 43 41 31 20 62 |upt.if the CA1 b| 000024a0 69 74 20 69 6e 20 74 68 65 20 73 74 61 74 75 73 |it in the status| 000024b0 20 72 65 67 69 73 74 65 72 20 68 61 73 20 62 65 | register has be| 000024c0 65 6e 20 73 65 74 2e 20 42 69 74 20 32 20 28 43 |en set. Bit 2 (C| 000024d0 41 31 29 20 69 73 20 73 65 74 0d 62 79 20 73 65 |A1) is set.by se| 000024e0 74 74 69 6e 67 20 62 69 74 73 20 37 20 61 6e 64 |tting bits 7 and| 000024f0 20 32 2c 20 69 65 2e 20 62 79 20 73 74 6f 72 69 | 2, ie. by stori| 00002500 6e 67 20 26 38 32 20 69 6e 20 74 68 65 20 63 6f |ng &82 in the co| 00002510 6e 74 72 6f 6c 20 72 65 67 69 73 74 65 72 20 61 |ntrol register a| 00002520 73 0d 73 68 6f 77 6e 20 69 6e 20 66 69 67 75 72 |s.shown in figur| 00002530 65 20 31 34 2e 33 20 28 6c 69 6e 65 20 31 35 32 |e 14.3 (line 152| 00002540 30 20 61 6e 64 20 6c 69 6e 65 20 31 35 36 30 29 |0 and line 1560)| 00002550 2e 20 42 69 74 20 32 20 6f 66 20 74 68 65 20 63 |. Bit 2 of the c| 00002560 6f 6e 74 72 6f 6c 0d 72 65 67 69 73 74 65 72 20 |ontrol.register | 00002570 63 61 6e 20 62 65 20 63 6c 65 61 72 65 64 20 62 |can be cleared b| 00002580 79 20 63 6c 65 61 72 69 6e 67 20 62 69 74 20 37 |y clearing bit 7| 00002590 20 61 6e 64 20 73 65 74 74 69 6e 67 20 62 69 74 | and setting bit| 000025a0 20 32 2c 20 69 65 2e 20 62 79 0d 73 74 6f 72 69 | 2, ie. by.stori| 000025b0 6e 67 20 32 20 69 6e 20 74 68 65 20 63 6f 6e 74 |ng 2 in the cont| 000025c0 72 6f 6c 20 72 65 67 69 73 74 65 72 20 28 6c 69 |rol register (li| 000025d0 6e 65 73 20 31 34 32 30 2d 31 34 33 30 29 2e 0d |nes 1420-1430)..| 000025e0 0d 0d 0d 0d 0d 20 20 20 20 20 37 20 20 20 20 20 |..... 7 | 000025f0 20 20 36 20 20 20 20 20 35 20 20 20 20 20 34 20 | 6 5 4 | 00002600 20 20 20 20 33 20 20 20 20 20 32 20 20 20 20 20 | 3 2 | 00002610 31 20 20 20 20 20 30 0d 2b 2d 2d 2d 2d 2d 2d 2d |1 0.+-------| 00002620 2d 2d 2b 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2b 2d |--+-----+-----+-| 00002630 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d |----+-----+-----| 00002640 2b 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2b 0d 21 20 |+-----+-----+.! | 00002650 20 20 49 52 51 20 20 20 21 20 54 31 20 20 21 20 | IRQ ! T1 ! | 00002660 54 32 20 20 21 20 43 42 31 20 21 20 43 42 32 20 |T2 ! CB1 ! CB2 | 00002670 21 20 53 52 20 20 21 20 43 41 31 20 21 20 43 41 |! SR ! CA1 ! CA| 00002680 32 20 21 20 49 6e 74 65 72 75 70 74 20 73 74 61 |2 ! Interupt sta| 00002690 74 75 73 0d 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d |tus.+---------+-| 000026a0 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d |----+-----+-----| 000026b0 2b 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2b 2d 2d 2d |+-----+-----+---| 000026c0 2d 2d 2b 2d 2d 2d 2d 2d 2b 0d 21 53 65 74 2f 43 |--+-----+.!Set/C| 000026d0 6c 65 61 72 21 20 54 31 20 20 21 20 54 32 20 20 |lear! T1 ! T2 | 000026e0 21 20 43 42 31 20 21 20 43 42 32 20 21 20 53 52 |! CB1 ! CB2 ! SR| 000026f0 20 20 21 20 43 41 31 20 21 20 43 41 32 20 21 20 | ! CA1 ! CA2 ! | 00002700 49 6e 74 65 72 75 70 74 20 63 6f 6e 74 72 6f 6c |Interupt control| 00002710 0d 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d |.+---------+----| 00002720 2d 2b 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2b 2d 2d |-+-----+-----+--| 00002730 2d 2d 2d 2b 2d 2d 2d 2d 2d 2b 2d 2d 2d 2d 2d 2b |---+-----+-----+| 00002740 2d 2d 2d 2d 2d 2b 0d 20 20 20 20 20 31 20 20 20 |-----+. 1 | 00002750 20 20 20 20 30 20 20 20 20 20 30 20 20 20 20 20 | 0 0 | 00002760 30 20 20 20 20 20 30 20 20 20 20 20 30 20 20 20 |0 0 0 | 00002770 20 20 31 20 20 20 20 20 30 20 20 20 20 26 38 32 | 1 0 &82| 00002780 0d 0d 46 69 67 75 72 65 20 31 34 2e 33 20 20 49 |..Figure 14.3 I| 00002790 6e 74 65 72 75 70 74 20 73 74 61 74 75 73 20 61 |nterupt status a| 000027a0 6e 64 20 63 6f 6e 74 72 6f 6c 20 72 65 67 69 73 |nd control regis| 000027b0 74 65 72 73 2e 0d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |ters..----------| 000027c0 2d 20 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |- -------------| 000027d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000027e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0d 0d 0d 0d 20 54 |---------..... T| 000027f0 68 65 20 63 6f 6e 74 72 6f 6c 20 61 6e 64 20 73 |he control and s| 00002800 74 61 74 75 73 20 72 65 67 69 73 74 65 72 73 20 |tatus registers | 00002810 77 6f 72 6b 20 61 73 20 61 20 70 61 69 72 20 61 |work as a pair a| 00002820 6e 64 20 74 68 65 20 73 74 61 74 75 73 0d 72 65 |nd the status.re| 00002830 67 69 73 74 65 72 20 69 73 20 69 6e 74 65 72 72 |gister is interr| 00002840 6f 67 61 74 65 64 20 62 79 20 74 68 65 20 62 75 |ogated by the bu| 00002850 66 66 65 72 20 70 72 6f 67 72 61 6d 20 74 6f 20 |ffer program to | 00002860 73 65 65 20 69 66 20 74 68 65 20 70 72 69 6e 74 |see if the print| 00002870 65 72 0d 69 73 20 74 68 65 20 73 6f 75 72 63 65 |er.is the source| 00002880 20 6f 66 20 61 6e 20 69 6e 74 65 72 75 70 74 20 | of an interupt | 00002890 28 6c 69 6e 65 73 20 31 31 34 30 2d 31 31 36 30 |(lines 1140-1160| 000028a0 29 2e 20 49 66 20 62 69 74 73 20 31 20 61 6e 64 |). If bits 1 and| 000028b0 20 37 20 6f 66 20 74 68 65 0d 73 74 61 74 75 73 | 7 of the.status| 000028c0 20 72 65 67 69 73 74 65 72 20 61 72 65 20 6e 6f | register are no| 000028d0 74 20 73 65 74 20 74 68 65 6e 20 74 68 65 20 70 |t set then the p| 000028e0 72 69 6e 74 65 72 20 77 61 73 20 6e 6f 74 20 74 |rinter was not t| 000028f0 68 65 20 73 6f 75 72 63 65 20 6f 66 20 74 68 65 |he source of the| 00002900 0d 69 6e 74 65 72 75 70 74 20 61 6e 64 20 63 6f |.interupt and co| 00002910 6e 74 72 6f 6c 20 69 73 20 72 65 74 75 72 6e 65 |ntrol is returne| 00002920 64 20 74 6f 20 74 68 65 20 4d 4f 53 20 77 69 74 |d to the MOS wit| 00002930 68 20 61 6c 6c 20 74 68 65 20 72 65 67 69 73 74 |h all the regist| 00002940 65 72 0d 70 72 65 73 65 72 76 65 64 20 28 6c 69 |er.preserved (li| 00002950 6e 65 20 31 31 36 30 2c 20 6c 69 6e 65 73 20 31 |ne 1160, lines 1| 00002960 32 38 30 2d 31 33 30 30 20 61 6e 64 20 6c 69 6e |280-1300 and lin| 00002970 65 73 20 36 34 30 2d 37 31 30 29 2e 20 49 66 20 |es 640-710). If | 00002980 74 68 65 0d 62 75 66 66 65 72 20 68 61 73 20 6e |the.buffer has n| 00002990 6f 74 20 62 65 65 6e 20 65 6e 61 62 6c 65 64 20 |ot been enabled | 000029a0 77 69 74 68 20 2a 46 58 35 2c 33 20 63 6f 6e 74 |with *FX5,3 cont| 000029b0 72 6f 6c 20 69 73 20 61 6c 73 6f 20 72 65 74 75 |rol is also retu| 000029c0 72 6e 65 64 20 74 6f 0d 74 68 65 20 4d 4f 53 20 |rned to.the MOS | 000029d0 28 6c 69 6e 65 73 20 31 31 37 30 2d 31 31 39 30 |(lines 1170-1190| 000029e0 2c 20 6c 69 6e 65 73 20 31 32 38 30 2d 31 33 30 |, lines 1280-130| 000029f0 30 20 61 6e 64 20 6c 69 6e 65 73 20 36 34 30 2d |0 and lines 640-| 00002a00 37 31 30 29 2e 0d 0d 0d 0d 0d 20 20 20 31 30 20 |710)...... 10 | 00002a10 52 45 4d 3a 20 42 55 46 46 45 52 0d 20 20 20 32 |REM: BUFFER. 2| 00002a20 30 20 52 45 4d 3a 20 28 43 29 20 47 6f 72 64 6f |0 REM: (C) Gordo| 00002a30 6e 20 48 6f 72 73 69 6e 67 74 6f 6e 20 31 39 38 |n Horsington 198| 00002a40 37 0d 20 20 20 33 30 20 4d 4f 44 45 37 0d 20 20 |7. 30 MODE7. | 00002a50 20 34 30 20 48 49 4d 45 4d 3d 26 33 43 30 30 0d | 40 HIMEM=&3C00.| 00002a60 20 20 20 35 30 20 44 49 4d 20 73 61 76 65 20 35 | 50 DIM save 5| 00002a70 30 0d 20 20 20 36 30 20 64 69 66 66 3d 26 38 30 |0. 60 diff=&80| 00002a80 30 30 2d 48 49 4d 45 4d 0d 20 20 20 37 30 20 72 |00-HIMEM. 70 r| 00002a90 6f 6d 6e 75 6d 62 65 72 3d 26 46 34 0d 20 20 20 |omnumber=&F4. | 00002aa0 38 30 20 73 74 61 63 6b 3d 26 31 30 33 0d 20 20 |80 stack=&103. | 00002ab0 20 39 30 20 75 70 74 76 3d 26 32 32 32 0d 20 20 | 90 uptv=&222. | 00002ac0 31 30 30 20 73 74 61 72 66 78 35 3d 26 32 38 35 |100 starfx5=&285| 00002ad0 0d 20 20 31 31 30 20 70 6f 69 6e 74 65 72 3d 26 |. 110 pointer=&| 00002ae0 38 31 30 30 0d 20 20 31 32 30 20 70 72 69 6e 74 |8100. 120 print| 00002af0 6f 75 74 3d 26 46 45 36 31 0d 20 20 31 33 30 20 |out=&FE61. 130 | 00002b00 68 61 6e 64 73 68 61 6b 65 3d 26 46 45 36 43 0d |handshake=&FE6C.| 00002b10 20 20 31 34 30 20 73 74 61 74 75 73 3d 26 46 45 | 140 status=&FE| 00002b20 36 44 0d 20 20 31 35 30 20 63 6f 6e 74 72 6f 6c |6D. 150 control| 00002b30 3d 26 46 45 36 45 0d 20 20 31 36 30 20 6f 73 62 |=&FE6E. 160 osb| 00002b40 79 74 65 3d 26 46 46 46 34 0d 20 20 31 37 30 20 |yte=&FFF4. 170 | 00002b50 6f 73 63 6c 69 3d 26 46 46 46 37 0d 20 20 31 38 |oscli=&FFF7. 18| 00002b60 30 20 41 25 3d 26 41 38 0d 20 20 31 39 30 20 58 |0 A%=&A8. 190 X| 00002b70 25 3d 30 0d 20 20 32 30 30 20 59 25 3d 26 46 46 |%=0. 200 Y%=&FF| 00002b80 0d 20 20 32 31 30 20 65 78 74 76 65 63 3d 28 55 |. 210 extvec=(U| 00002b90 53 52 28 6f 73 62 79 74 65 29 41 4e 44 26 46 46 |SR(osbyte)AND&FF| 00002ba0 46 46 30 30 29 44 49 56 32 35 36 0d 20 20 32 32 |FF00)DIV256. 22| 00002bb0 30 20 46 4f 52 20 70 61 73 73 20 3d 20 30 20 54 |0 FOR pass = 0 T| 00002bc0 4f 20 32 20 53 54 45 50 20 32 0d 20 20 32 33 30 |O 2 STEP 2. 230| 00002bd0 20 50 25 3d 48 49 4d 45 4d 0d 20 20 32 34 30 20 | P%=HIMEM. 240 | 00002be0 5b 20 20 20 20 20 20 20 4f 50 54 20 70 61 73 73 |[ OPT pass| 00002bf0 0d 20 20 32 35 30 20 20 20 20 20 20 20 20 20 42 |. 250 B| 00002c00 52 4b 0d 20 20 32 36 30 20 20 20 20 20 20 20 20 |RK. 260 | 00002c10 20 42 52 4b 0d 20 20 32 37 30 20 20 20 20 20 20 | BRK. 270 | 00002c20 20 20 20 42 52 4b 0d 20 20 32 38 30 20 20 20 20 | BRK. 280 | 00002c30 20 20 20 20 20 4a 4d 50 20 73 65 72 76 69 63 65 | JMP service| 00002c40 2b 64 69 66 66 0d 20 20 32 39 30 20 20 20 20 20 |+diff. 290 | 00002c50 20 20 20 20 4f 50 54 20 46 4e 65 71 75 62 28 26 | OPT FNequb(&| 00002c60 38 32 29 0d 20 20 33 30 30 20 20 20 20 20 20 20 |82). 300 | 00002c70 20 20 4f 50 54 20 46 4e 65 71 75 62 28 28 63 6f | OPT FNequb((co| 00002c80 70 79 72 69 67 68 74 2b 64 69 66 66 29 20 4d 4f |pyright+diff) MO| 00002c90 44 20 32 35 36 29 0d 20 20 33 31 30 20 2e 63 6f |D 256). 310 .co| 00002ca0 70 79 72 69 67 68 74 0d 20 20 33 32 30 20 20 20 |pyright. 320 | 00002cb0 20 20 20 20 20 20 42 52 4b 0d 20 20 33 33 30 20 | BRK. 330 | 00002cc0 20 20 20 20 20 20 20 20 4f 50 54 20 46 4e 65 71 | OPT FNeq| 00002cd0 75 73 28 22 28 43 29 22 29 0d 20 20 33 34 30 20 |us("(C)"). 340 | 00002ce0 20 20 20 20 20 20 20 20 42 52 4b 0d 20 20 33 35 | BRK. 35| 00002cf0 30 20 2e 66 6c 61 67 0d 20 20 33 36 30 20 20 20 |0 .flag. 360 | 00002d00 20 20 20 20 20 20 42 52 4b 0d 20 20 33 37 30 20 | BRK. 370 | 00002d10 2e 73 65 72 76 69 63 65 0d 20 20 33 38 30 20 20 |.service. 380 | 00002d20 20 20 20 20 20 20 20 50 48 41 0d 20 20 33 39 30 | PHA. 390| 00002d30 20 20 20 20 20 20 20 20 20 54 58 41 0d 20 20 34 | TXA. 4| 00002d40 30 30 20 20 20 20 20 20 20 20 20 50 48 41 0d 20 |00 PHA. | 00002d50 20 34 31 30 20 20 20 20 20 20 20 20 20 54 59 41 | 410 TYA| 00002d60 0d 20 20 34 32 30 20 20 20 20 20 20 20 20 20 50 |. 420 P| 00002d70 48 41 0d 20 20 34 33 30 20 20 20 20 20 20 20 20 |HA. 430 | 00002d80 20 54 53 58 0d 20 20 34 34 30 20 20 20 20 20 20 | TSX. 440 | 00002d90 20 20 20 4c 44 41 20 73 74 61 63 6b 2c 58 0d 20 | LDA stack,X. | 00002da0 20 34 35 30 20 20 20 20 20 20 20 20 20 43 4d 50 | 450 CMP| 00002db0 20 23 35 0d 20 20 34 36 30 20 20 20 20 20 20 20 | #5. 460 | 00002dc0 20 20 42 45 51 20 69 6e 74 65 72 75 70 74 0d 20 | BEQ interupt. | 00002dd0 20 34 37 30 20 20 20 20 20 20 20 20 20 43 4d 50 | 470 CMP| 00002de0 20 23 26 46 45 0d 20 20 34 38 30 20 20 20 20 20 | #&FE. 480 | 00002df0 20 20 20 20 42 4e 45 20 65 78 69 74 0d 20 20 34 | BNE exit. 4| 00002e00 39 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 23 |90 LDA #| 00002e10 28 62 75 66 66 65 72 2b 64 69 66 66 29 20 4d 4f |(buffer+diff) MO| 00002e20 44 20 32 35 36 20 0d 20 20 35 30 30 20 20 20 20 |D 256 . 500 | 00002e30 20 20 20 20 20 53 54 41 20 65 78 74 76 65 63 2b | STA extvec+| 00002e40 26 33 33 0d 20 20 35 31 30 20 20 20 20 20 20 20 |&33. 510 | 00002e50 20 20 4c 44 41 20 23 28 62 75 66 66 65 72 2b 64 | LDA #(buffer+d| 00002e60 69 66 66 29 20 44 49 56 20 32 35 36 20 0d 20 20 |iff) DIV 256 . | 00002e70 35 32 30 20 20 20 20 20 20 20 20 20 53 54 41 20 |520 STA | 00002e80 65 78 74 76 65 63 2b 26 33 34 0d 20 20 35 33 30 |extvec+&34. 530| 00002e90 20 20 20 20 20 20 20 20 20 4c 44 41 20 72 6f 6d | LDA rom| 00002ea0 6e 75 6d 62 65 72 0d 20 20 35 34 30 20 20 20 20 |number. 540 | 00002eb0 20 20 20 20 20 53 54 41 20 65 78 74 76 65 63 2b | STA extvec+| 00002ec0 26 33 35 0d 20 20 35 35 30 20 20 20 20 20 20 20 |&35. 550 | 00002ed0 20 20 4c 44 41 20 23 26 38 31 0d 20 20 35 36 30 | LDA #&81. 560| 00002ee0 20 20 20 20 20 20 20 20 20 53 54 41 20 64 61 74 | STA dat| 00002ef0 69 6e 2b 64 69 66 66 2b 31 0d 20 20 35 37 30 20 |in+diff+1. 570 | 00002f00 20 20 20 20 20 20 20 20 53 54 41 20 64 61 74 69 | STA dati| 00002f10 6e 2b 64 69 66 66 2b 32 0d 20 20 35 38 30 20 20 |n+diff+2. 580 | 00002f20 20 20 20 20 20 20 20 53 54 41 20 64 61 74 6f 75 | STA datou| 00002f30 74 2b 64 69 66 66 2b 31 0d 20 20 35 39 30 20 20 |t+diff+1. 590 | 00002f40 20 20 20 20 20 20 20 53 54 41 20 64 61 74 6f 75 | STA datou| 00002f50 74 2b 64 69 66 66 2b 32 0d 20 20 36 30 30 20 20 |t+diff+2. 600 | 00002f60 20 20 20 20 20 20 20 4c 44 58 20 23 26 33 33 0d | LDX #&33.| 00002f70 20 20 36 31 30 20 20 20 20 20 20 20 20 20 4c 44 | 610 LD| 00002f80 59 20 23 26 46 46 0d 20 20 36 32 30 20 20 20 20 |Y #&FF. 620 | 00002f90 20 20 20 20 20 53 54 58 20 75 70 74 76 0d 20 20 | STX uptv. | 00002fa0 36 33 30 20 20 20 20 20 20 20 20 20 53 54 59 20 |630 STY | 00002fb0 75 70 74 76 2b 31 0d 20 20 36 34 30 20 2e 65 78 |uptv+1. 640 .ex| 00002fc0 69 74 0d 20 20 36 35 30 20 20 20 20 20 20 20 20 |it. 650 | 00002fd0 20 50 4c 41 0d 20 20 36 36 30 20 20 20 20 20 20 | PLA. 660 | 00002fe0 20 20 20 54 41 59 0d 20 20 36 37 30 20 20 20 20 | TAY. 670 | 00002ff0 20 20 20 20 20 50 4c 41 0d 20 20 36 38 30 20 20 | PLA. 680 | 00003000 20 20 20 20 20 20 20 54 41 58 0d 20 20 36 39 30 | TAX. 690| 00003010 20 20 20 20 20 20 20 20 20 50 4c 41 0d 20 20 37 | PLA. 7| 00003020 30 30 20 2e 72 65 74 75 72 6e 0d 20 20 37 31 30 |00 .return. 710| 00003030 20 20 20 20 20 20 20 20 20 52 54 53 0d 20 20 37 | RTS. 7| 00003040 32 30 20 2e 62 75 66 66 65 72 0d 20 20 37 33 30 |20 .buffer. 730| 00003050 20 20 20 20 20 20 20 20 20 43 50 59 20 23 33 0d | CPY #3.| 00003060 20 20 37 34 30 20 20 20 20 20 20 20 20 20 42 4e | 740 BN| 00003070 45 20 72 65 74 75 72 6e 0d 20 20 37 35 30 20 20 |E return. 750 | 00003080 20 20 20 20 20 20 20 43 4d 50 20 23 31 0d 20 20 | CMP #1. | 00003090 37 36 30 20 20 20 20 20 20 20 20 20 42 4e 45 20 |760 BNE | 000030a0 61 63 74 69 76 65 0d 20 20 37 37 30 20 20 20 20 |active. 770 | 000030b0 20 20 20 20 20 53 54 41 20 66 6c 61 67 2b 64 69 | STA flag+di| 000030c0 66 66 0d 20 20 37 38 30 20 2e 61 63 74 69 76 65 |ff. 780 .active| 000030d0 0d 20 20 37 39 30 20 20 20 20 20 20 20 20 20 50 |. 790 P| 000030e0 48 41 0d 20 20 38 30 30 20 20 20 20 20 20 20 20 |HA. 800 | 000030f0 20 54 58 41 20 0d 20 20 38 31 30 20 20 20 20 20 | TXA . 810 | 00003100 20 20 20 20 50 48 41 20 0d 20 20 38 32 30 20 20 | PHA . 820 | 00003110 20 20 20 20 20 20 20 54 59 41 0d 20 20 38 33 30 | TYA. 830| 00003120 20 20 20 20 20 20 20 20 20 50 48 41 0d 20 20 38 | PHA. 8| 00003130 34 30 20 2e 6f 75 74 65 72 6c 6f 6f 70 0d 20 20 |40 .outerloop. | 00003140 38 35 30 20 20 20 20 20 20 20 20 20 4c 44 59 20 |850 LDY | 00003150 64 61 74 69 6e 2b 64 69 66 66 2b 32 0d 20 20 38 |datin+diff+2. 8| 00003160 36 30 20 20 20 20 20 20 20 20 20 4c 44 58 20 64 |60 LDX d| 00003170 61 74 69 6e 2b 64 69 66 66 2b 31 0d 20 20 38 37 |atin+diff+1. 87| 00003180 30 20 20 20 20 20 20 20 20 20 49 4e 58 20 0d 20 |0 INX . | 00003190 20 38 38 30 20 20 20 20 20 20 20 20 20 42 4e 45 | 880 BNE| 000031a0 20 6e 6f 74 74 6f 70 0d 20 20 38 39 30 20 20 20 | nottop. 890 | 000031b0 20 20 20 20 20 20 49 4e 59 20 0d 20 20 39 30 30 | INY . 900| 000031c0 20 20 20 20 20 20 20 20 20 43 50 59 20 23 26 43 | CPY #&C| 000031d0 30 0d 20 20 39 31 30 20 20 20 20 20 20 20 20 20 |0. 910 | 000031e0 42 4e 45 20 6e 6f 74 74 6f 70 0d 20 20 39 32 30 |BNE nottop. 920| 000031f0 20 20 20 20 20 20 20 20 20 4c 44 59 20 23 26 38 | LDY #&8| 00003200 31 0d 20 20 39 33 30 20 2e 6e 6f 74 74 6f 70 0d |1. 930 .nottop.| 00003210 20 20 39 34 30 20 20 20 20 20 20 20 20 20 43 50 | 940 CP| 00003220 58 20 64 61 74 6f 75 74 2b 64 69 66 66 2b 31 0d |X datout+diff+1.| 00003230 20 20 39 35 30 20 20 20 20 20 20 20 20 20 42 4e | 950 BN| 00003240 45 20 6d 6f 72 65 73 70 61 63 65 0d 20 20 39 36 |E morespace. 96| 00003250 30 20 20 20 20 20 20 20 20 20 43 50 59 20 64 61 |0 CPY da| 00003260 74 6f 75 74 2b 64 69 66 66 2b 32 0d 20 20 39 37 |tout+diff+2. 97| 00003270 30 20 20 20 20 20 20 20 20 20 42 45 51 20 69 6e |0 BEQ in| 00003280 6e 65 72 6c 6f 6f 70 0d 20 20 39 38 30 20 20 20 |nerloop. 980 | 00003290 20 20 20 20 20 20 53 45 43 0d 20 20 39 39 30 20 | SEC. 990 | 000032a0 2e 6d 6f 72 65 73 70 61 63 65 0d 20 31 30 30 30 |.morespace. 1000| 000032b0 20 20 20 20 20 20 20 20 20 54 59 41 20 0d 20 31 | TYA . 1| 000032c0 30 31 30 20 20 20 20 20 20 20 20 20 50 48 41 20 |010 PHA | 000032d0 0d 20 31 30 32 30 20 20 20 20 20 20 20 20 20 4c |. 1020 L| 000032e0 44 41 20 23 26 39 31 0d 20 31 30 33 30 20 20 20 |DA #&91. 1030 | 000032f0 20 20 20 20 20 20 4c 44 58 20 23 33 0d 20 31 30 | LDX #3. 10| 00003300 34 30 20 20 20 20 20 20 20 20 20 4a 53 52 20 6f |40 JSR o| 00003310 73 62 79 74 65 0d 20 31 30 35 30 20 20 20 20 20 |sbyte. 1050 | 00003320 20 20 20 20 50 4c 41 20 0d 20 31 30 36 30 20 20 | PLA . 1060 | 00003330 20 20 20 20 20 20 20 42 43 53 20 69 6e 6e 65 72 | BCS inner| 00003340 6c 6f 6f 70 0d 20 31 30 37 30 20 2e 64 61 74 69 |loop. 1070 .dati| 00003350 6e 0d 20 31 30 38 30 20 20 20 20 20 20 20 20 20 |n. 1080 | 00003360 53 54 59 20 70 6f 69 6e 74 65 72 0d 20 31 30 39 |STY pointer. 109| 00003370 30 20 20 20 20 20 20 20 20 20 49 4e 43 20 64 61 |0 INC da| 00003380 74 69 6e 2b 64 69 66 66 2b 31 0d 20 31 31 30 30 |tin+diff+1. 1100| 00003390 20 20 20 20 20 20 20 20 20 53 54 41 20 64 61 74 | STA dat| 000033a0 69 6e 2b 64 69 66 66 2b 32 0d 20 31 31 31 30 20 |in+diff+2. 1110 | 000033b0 20 20 20 20 20 20 20 20 43 4c 43 20 0d 20 31 31 | CLC . 11| 000033c0 32 30 20 20 20 20 20 20 20 20 20 42 43 43 20 69 |20 BCC i| 000033d0 6e 6e 65 72 6c 6f 6f 70 0d 20 31 31 33 30 20 2e |nnerloop. 1130 .| 000033e0 69 6e 74 65 72 75 70 74 0d 20 31 31 34 30 20 20 |interupt. 1140 | 000033f0 20 20 20 20 20 20 20 4c 44 41 20 23 26 38 32 0d | LDA #&82.| 00003400 20 31 31 35 30 20 20 20 20 20 20 20 20 20 42 49 | 1150 BI| 00003410 54 20 73 74 61 74 75 73 0d 20 31 31 36 30 20 20 |T status. 1160 | 00003420 20 20 20 20 20 20 20 42 45 51 20 72 65 73 74 6f | BEQ resto| 00003430 72 65 0d 20 31 31 37 30 20 20 20 20 20 20 20 20 |re. 1170 | 00003440 20 4c 44 41 20 73 74 61 72 66 78 35 0d 20 31 31 | LDA starfx5. 11| 00003450 38 30 20 20 20 20 20 20 20 20 20 43 4d 50 20 23 |80 CMP #| 00003460 33 0d 20 31 31 39 30 20 20 20 20 20 20 20 20 20 |3. 1190 | 00003470 42 4e 45 20 72 65 73 74 6f 72 65 0d 20 31 32 30 |BNE restore. 120| 00003480 30 20 2e 69 6e 6e 65 72 6c 6f 6f 70 0d 20 31 32 |0 .innerloop. 12| 00003490 31 30 20 20 20 20 20 20 20 20 20 4c 44 41 20 66 |10 LDA f| 000034a0 6c 61 67 2b 64 69 66 66 0d 20 31 32 32 30 20 20 |lag+diff. 1220 | 000034b0 20 20 20 20 20 20 20 42 4e 45 20 6e 6f 74 70 6f | BNE notpo| 000034c0 6c 6c 0d 20 31 32 33 30 20 20 20 20 20 20 20 20 |ll. 1230 | 000034d0 20 4c 44 41 20 23 26 38 32 0d 20 31 32 34 30 20 | LDA #&82. 1240 | 000034e0 20 20 20 20 20 20 20 20 42 49 54 20 73 74 61 74 | BIT stat| 000034f0 75 73 0d 20 31 32 35 30 20 20 20 20 20 20 20 20 |us. 1250 | 00003500 20 42 4e 45 20 6e 6f 74 70 6f 6c 6c 0d 20 31 32 | BNE notpoll. 12| 00003510 36 30 20 2e 73 74 65 70 0d 20 31 32 37 30 20 20 |60 .step. 1270 | 00003520 20 20 20 20 20 20 20 42 43 43 20 6f 75 74 65 72 | BCC outer| 00003530 6c 6f 6f 70 0d 20 31 32 38 30 20 2e 72 65 73 74 |loop. 1280 .rest| 00003540 6f 72 65 0d 20 31 32 39 30 20 20 20 20 20 20 20 |ore. 1290 | 00003550 20 20 43 4c 43 0d 20 31 33 30 30 20 20 20 20 20 | CLC. 1300 | 00003560 20 20 20 20 42 43 43 20 65 78 69 74 0d 20 31 33 | BCC exit. 13| 00003570 31 30 20 2e 6e 6f 74 70 6f 6c 6c 0d 20 31 33 32 |10 .notpoll. 132| 00003580 30 20 20 20 20 20 20 20 20 20 50 48 50 20 0d 20 |0 PHP . | 00003590 31 33 33 30 20 20 20 20 20 20 20 20 20 4c 44 41 |1330 LDA| 000035a0 20 23 30 0d 20 31 33 34 30 20 20 20 20 20 20 20 | #0. 1340 | 000035b0 20 20 53 54 41 20 66 6c 61 67 2b 64 69 66 66 0d | STA flag+diff.| 000035c0 20 31 33 35 30 20 20 20 20 20 20 20 20 20 4c 44 | 1350 LD| 000035d0 41 20 64 61 74 69 6e 2b 64 69 66 66 2b 31 0d 20 |A datin+diff+1. | 000035e0 31 33 36 30 20 20 20 20 20 20 20 20 20 43 4d 50 |1360 CMP| 000035f0 20 64 61 74 6f 75 74 2b 64 69 66 66 2b 31 0d 20 | datout+diff+1. | 00003600 31 33 37 30 20 20 20 20 20 20 20 20 20 42 4e 45 |1370 BNE| 00003610 20 6f 75 74 70 75 74 0d 20 31 33 38 30 20 20 20 | output. 1380 | 00003620 20 20 20 20 20 20 4c 44 41 20 64 61 74 69 6e 2b | LDA datin+| 00003630 64 69 66 66 2b 32 0d 20 31 33 39 30 20 20 20 20 |diff+2. 1390 | 00003640 20 20 20 20 20 43 4d 50 20 64 61 74 6f 75 74 2b | CMP datout+| 00003650 64 69 66 66 2b 32 0d 20 31 34 30 30 20 20 20 20 |diff+2. 1400 | 00003660 20 20 20 20 20 42 4e 45 20 6f 75 74 70 75 74 0d | BNE output.| 00003670 20 31 34 31 30 20 20 20 20 20 20 20 20 20 50 4c | 1410 PL| 00003680 50 0d 20 31 34 32 30 20 20 20 20 20 20 20 20 20 |P. 1420 | 00003690 4c 44 58 20 23 32 0d 20 31 34 33 30 20 20 20 20 |LDX #2. 1430 | 000036a0 20 20 20 20 20 53 54 58 20 63 6f 6e 74 72 6f 6c | STX control| 000036b0 0d 20 31 34 34 30 20 20 20 20 20 20 20 20 20 4c |. 1440 L| 000036c0 44 41 20 23 26 37 42 0d 20 31 34 35 30 20 20 20 |DA #&7B. 1450 | 000036d0 20 20 20 20 20 20 49 4e 58 0d 20 31 34 36 30 20 | INX. 1460 | 000036e0 20 20 20 20 20 20 20 20 4a 53 52 20 6f 73 62 79 | JSR osby| 000036f0 74 65 0d 20 31 34 37 30 20 20 20 20 20 20 20 20 |te. 1470 | 00003700 20 4a 4d 50 20 72 65 73 74 6f 72 65 2b 64 69 66 | JMP restore+dif| 00003710 66 0d 20 31 34 38 30 20 2e 6f 75 74 70 75 74 0d |f. 1480 .output.| 00003720 20 31 34 39 30 20 20 20 20 20 20 20 20 20 4c 44 | 1490 LD| 00003730 41 20 68 61 6e 64 73 68 61 6b 65 0d 20 31 35 30 |A handshake. 150| 00003740 30 20 20 20 20 20 20 20 20 20 41 4e 44 20 23 26 |0 AND #&| 00003750 46 30 0d 20 31 35 31 30 20 20 20 20 20 20 20 20 |F0. 1510 | 00003760 20 4f 52 41 20 23 26 30 41 0d 20 31 35 32 30 20 | ORA #&0A. 1520 | 00003770 20 20 20 20 20 20 20 20 4c 44 58 20 23 26 38 32 | LDX #&82| 00003780 0d 20 31 35 33 30 20 2e 64 61 74 6f 75 74 0d 20 |. 1530 .datout. | 00003790 31 35 34 30 20 20 20 20 20 20 20 20 20 4c 44 59 |1540 LDY| 000037a0 20 70 6f 69 6e 74 65 72 0d 20 31 35 35 30 20 20 | pointer. 1550 | 000037b0 20 20 20 20 20 20 20 53 54 41 20 68 61 6e 64 73 | STA hands| 000037c0 68 61 6b 65 0d 20 31 35 36 30 20 20 20 20 20 20 |hake. 1560 | 000037d0 20 20 20 53 54 58 20 63 6f 6e 74 72 6f 6c 0d 20 | STX control. | 000037e0 31 35 37 30 20 20 20 20 20 20 20 20 20 53 54 59 |1570 STY| 000037f0 20 70 72 69 6e 74 6f 75 74 0d 20 31 35 38 30 20 | printout. 1580 | 00003800 20 20 20 20 20 20 20 20 49 4e 43 20 64 61 74 6f | INC dato| 00003810 75 74 2b 64 69 66 66 2b 31 0d 20 31 35 39 30 20 |ut+diff+1. 1590 | 00003820 20 20 20 20 20 20 20 20 42 4e 45 20 6e 6f 74 70 | BNE notp| 00003830 61 67 65 0d 20 31 36 30 30 20 20 20 20 20 20 20 |age. 1600 | 00003840 20 20 4c 44 59 20 64 61 74 6f 75 74 2b 64 69 66 | LDY datout+dif| 00003850 66 2b 32 0d 20 31 36 31 30 20 20 20 20 20 20 20 |f+2. 1610 | 00003860 20 20 49 4e 59 20 0d 20 31 36 32 30 20 20 20 20 | INY . 1620 | 00003870 20 20 20 20 20 43 50 59 20 23 26 43 30 0d 20 31 | CPY #&C0. 1| 00003880 36 33 30 20 20 20 20 20 20 20 20 20 42 4e 45 20 |630 BNE | 00003890 6d 6f 72 65 72 6f 6f 6d 0d 20 31 36 34 30 20 20 |moreroom. 1640 | 000038a0 20 20 20 20 20 20 20 4c 44 59 20 23 26 38 31 0d | LDY #&81.| 000038b0 20 31 36 35 30 20 2e 6d 6f 72 65 72 6f 6f 6d 0d | 1650 .moreroom.| 000038c0 20 31 36 36 30 20 20 20 20 20 20 20 20 20 53 54 | 1660 ST| 000038d0 59 20 64 61 74 6f 75 74 2b 64 69 66 66 2b 32 0d |Y datout+diff+2.| 000038e0 20 31 36 37 30 20 2e 6e 6f 74 70 61 67 65 0d 20 | 1670 .notpage. | 000038f0 31 36 38 30 20 20 20 20 20 20 20 20 20 50 4c 50 |1680 PLP| 00003900 20 0d 20 31 36 39 30 20 20 20 20 20 20 20 20 20 | . 1690 | 00003910 42 43 53 20 69 6e 6e 65 72 6c 6f 6f 70 0d 20 31 |BCS innerloop. 1| 00003920 37 30 30 20 20 20 20 20 20 20 20 20 42 43 43 20 |700 BCC | 00003930 73 74 65 70 0d 20 31 37 31 30 20 2e 6c 61 73 74 |step. 1710 .last| 00003940 62 79 74 65 0d 20 31 37 32 30 20 5d 0d 20 31 37 |byte. 1720 ]. 17| 00003950 33 30 20 4e 45 58 54 0d 20 31 37 34 30 20 49 4e |30 NEXT. 1740 IN| 00003960 50 55 54 27 22 53 61 76 65 20 66 69 6c 65 6e 61 |PUT'"Save filena| 00003970 6d 65 20 3d 20 22 66 69 6c 65 6e 61 6d 65 24 0d |me = "filename$.| 00003980 20 31 37 35 30 20 49 46 20 66 69 6c 65 6e 61 6d | 1750 IF filenam| 00003990 65 24 3d 22 22 20 45 4e 44 0d 20 31 37 36 30 20 |e$="" END. 1760 | 000039a0 24 73 61 76 65 3d 22 53 41 56 45 20 22 2b 66 69 |$save="SAVE "+fi| 000039b0 6c 65 6e 61 6d 65 24 2b 22 20 22 2b 53 54 52 24 |lename$+" "+STR$| 000039c0 7e 28 48 49 4d 45 4d 29 2b 22 20 22 2b 53 54 52 |~(HIMEM)+" "+STR| 000039d0 24 7e 28 6c 61 73 0d 20 20 20 20 20 20 74 62 79 |$~(las. tby| 000039e0 74 65 29 2b 22 20 46 46 46 46 38 30 30 30 20 46 |te)+" FFFF8000 F| 000039f0 46 46 46 38 30 30 30 22 0d 20 31 37 37 30 20 58 |FFF8000". 1770 X| 00003a00 25 3d 73 61 76 65 20 4d 4f 44 20 32 35 36 0d 20 |%=save MOD 256. | 00003a10 31 37 38 30 20 59 25 3d 73 61 76 65 20 44 49 56 |1780 Y%=save DIV| 00003a20 20 32 35 36 0d 20 31 37 39 30 20 2a 4f 50 54 31 | 256. 1790 *OPT1| 00003a30 2c 32 0d 20 31 38 30 30 20 43 41 4c 4c 20 6f 73 |,2. 1800 CALL os| 00003a40 63 6c 69 0d 20 31 38 31 30 20 2a 4f 50 54 31 2c |cli. 1810 *OPT1,| 00003a50 30 0d 20 31 38 32 30 20 45 4e 44 0d 20 31 38 33 |0. 1820 END. 183| 00003a60 30 20 44 45 46 46 4e 65 71 75 62 28 62 79 74 65 |0 DEFFNequb(byte| 00003a70 29 0d 20 31 38 34 30 20 3f 50 25 3d 62 79 74 65 |). 1840 ?P%=byte| 00003a80 0d 20 31 38 35 30 20 50 25 3d 50 25 2b 31 0d 20 |. 1850 P%=P%+1. | 00003a90 31 38 36 30 20 3d 70 61 73 73 0d 20 31 38 37 30 |1860 =pass. 1870| 00003aa0 20 44 45 46 46 4e 65 71 75 77 28 77 6f 72 64 29 | DEFFNequw(word)| 00003ab0 0d 20 31 38 38 30 20 3f 50 25 3d 77 6f 72 64 20 |. 1880 ?P%=word | 00003ac0 4d 4f 44 20 32 35 36 0d 20 31 38 39 30 20 50 25 |MOD 256. 1890 P%| 00003ad0 3f 31 3d 77 6f 72 64 20 44 49 56 20 32 35 36 0d |?1=word DIV 256.| 00003ae0 20 31 39 30 30 20 50 25 3d 50 25 2b 32 0d 20 31 | 1900 P%=P%+2. 1| 00003af0 39 31 30 20 3d 70 61 73 73 0d 20 31 39 32 30 20 |910 =pass. 1920 | 00003b00 44 45 46 46 4e 65 71 75 64 28 64 6f 75 62 6c 65 |DEFFNequd(double| 00003b10 29 0d 20 31 39 33 30 20 21 50 25 3d 64 6f 75 62 |). 1930 !P%=doub| 00003b20 6c 65 0d 20 31 39 34 30 20 50 25 3d 50 25 2b 34 |le. 1940 P%=P%+4| 00003b30 0d 20 31 39 35 30 20 3d 70 61 73 73 0d 20 31 39 |. 1950 =pass. 19| 00003b40 36 30 20 44 45 46 46 4e 65 71 75 73 28 73 74 72 |60 DEFFNequs(str| 00003b50 69 6e 67 24 29 0d 20 31 39 37 30 20 24 50 25 3d |ing$). 1970 $P%=| 00003b60 73 74 72 69 6e 67 24 0d 20 31 39 38 30 20 50 25 |string$. 1980 P%| 00003b70 3d 50 25 2b 4c 45 4e 28 73 74 72 69 6e 67 24 29 |=P%+LEN(string$)| 00003b80 0d 20 31 39 39 30 20 3d 70 61 73 73 0d |. 1990 =pass.| 00003b8d