8-Bit Software Online Conversion
:0.$.TYPIST - Listing
10REM"
20REM" Typewriter Listing 1
30REM" Mike Rawlings
40REM" For BBCB / B+ / Electron
50REM" 6-7-1986
60REM"
70REM"
80REM" Printer specific codes
90REM" marked with REM statements
100REM"
110REM"
120REM" Codes are correct for
130REM" Epson DX-100 / Brother HR15
140REM"
150:
160ON ERROR PROCerror
170*TV 255
180MODE7:IFHIMEM=&6000 computer$="ELK"
:ELSEcomputer$="BBC"
190MODE 0
200*FX 18
210*FX 202,48
220*FX 212,0
230*FX 213,205
240*FX 4,1
250IFcomputer$="ELK" OSCLI"FX 226,144"
:ELSE*FX 219,9
260:
270B%=&70:C%=&900:D%=&947:E%=&99E:F%=&
E00:G%=&C00:H%=&C47:J%=&C65:K%=&C87:L%=&
CA9:M%=&6C7:Q%=78:R%=&2400:N%=&CCB:IF PA
GE>&800 GOTO 290
280D%=&24C:E%=&2A3:Q%=350:R%=&7400:N%=
&389:J%=&301:K%=&323:L%=&345:M%=&367
290ENVELOPE 1,3,1,-1,1,1,1,1,126,-60,-
12,-1,126,126:ENVELOPE 2,0,0,0,0,0,0,0,5
0,-20,-20,-20,126,1
300READ data:IF data=-1 GOTO 320
310VDU data:GOTO300
320PROCassemble
330VDU 28,0,31,79,29:COLOUR 128:CLS:CO
LOUR 1
340IFcomputer$="BBC" PRINT SPC(3)"|CTR
L f0|CTRL f1|CTRL f2|CTRL f3|CTRL f4|":E
LSEPRINTSPC(3)"|FUNC A |FUNC B |FUNC C |
FUNC D |FUNC E |"
350PRINT SPC(3)"| CLEAR | STAND | TAB
| TAB |DEFINE |"
360PRINT SPC(3)"| TAB | TAB | ON
| OFF |f - KEY|";
370IFcomputer$="BBC" $J%=STRING$(10,CH
R$(32))+"PRESS ESCAPE":ELSE$J%="CTRL I |
"+STRING$(6,CHR$(32))+"PRESS ESCAPE"
380IFcomputer$="BBC" $K%=STRING$(14,CH
R$(32))+"TO":ELSE$K%=" TAB |"+STRING$(
10,CHR$(32))+"TO"
390IFcomputer$="BBC" $L%=STRING$(10,CH
R$(32))+"CLEAR SCREEN":ELSE$L%=" |
"+STRING$(6,CHR$(32))+"CLEAR SCREEN"
400$M%="WORD ?"+STRING$(24,CHR$(32))+C
HR$(124)+STRING$(24,CHR$(8))
410$N%="KEY NUMBER ? "
420X%=H% MOD 256:Y%=H% DIV 256
430VDU 28,5,27,76,4
440COLOUR 0:COLOUR 129
450:
460REM" Set pitch 10
470VDU 2,1,27,1,31,1,11,3
480REM" Set pitch 10
490:
500PAGE=R%:CHAIN "TYPIST2"
520DATA 23,224,63,63,3,3,3,3,3,3
530DATA 23,225,252,252,192,192,192,192
,192,192
540DATA 23,226,3,3,3,3,3,3,0,0
550DATA 23,227,192,192,192,192,192,192
,0,0
560DATA 23,228,3,3,3,3,63,63,0,0
570DATA 23,229,192,192,192,192,252,252
,0,0
580DATA 23,230,60,60,60,60,60,30,15,7
590DATA 23,231,60,60,60,60,60,120,240,
224
600DATA 23,232,63,63,60,60,60,60,63,63
610DATA 23,233,240,248,124,60,60,124,2
48,240
620DATA 23,234,60,60,60,60,60,60,0,0
630DATA 23,235,240,120,60,60,60,60,0,0
640DATA 23,236,252,252,0,0,0,0,240,240
650DATA 23,237,60,60,60,60,63,63,0,0
660DATA 23,238,0,0,0,0,252,252,0,0
670DATA 23,239,60,60,60,60,60,60,60,61
680DATA 23,240,15,15,15,15,207,207,207
,239
690DATA 23,241,63,63,63,62,60,60,0,0
700DATA 23,242,255,255,63,31,15,15,0,0
710DATA 23,255,0,0,60,102,102,60,0,0
720DATA 31,26,1
730DATA 224,225,32,230,231,32,232
740DATA 233,32,232,236,32,239,240,32
750DATA 232,233,32,224,225,32,224
760DATA 225,32,232,236,32,232,233
770DATA 31,26,2
780DATA 226,227,32,226,227,32,234,32
790DATA 32,237,238,32,241,242,32,234
800DATA 235,32,228,229,32,226,227,32
810DATA 237,238,32,234,235
820DATA 19,0,7,0,0,0
830DATA 19,1,4,0,0,0
840DATA 28,3,27,76,4
850DATA 23,0,10,96,0,0,0,0,0,0
860DATA 17,129,12,18,0,0
870DATA -1
880:
890DEF PROCerror:MODE 7
900*FX 4,0
910*FX 202,32
920*FX 212,144
930*FX 213,101
940PRINT '':REPORT:PRINT " at line ";E
RL:END
950:
960DEF PROCassemble
970P%=B%
980[OPT 0
990LDX #(H% MOD 256)
1000STX &8B
1010LDX #(H% DIV 256)
1020STX &8C
1030LDX #32
1040STX &8E
1050LDX #127
1060STX &8F
1070LDA #0
1080TAY
1090LDX #&8B
1100JSR &FFF1
1110RTS
1120]
1130FOR pass=0 TO 2 STEP 2
1140P%=D%
1150[OPT pass
1160LDA #2
1170JSR &FFEE
1180LDY &8D
1190.loop
1200LDA #1
1210JSR &FFEE
1220LDA C%,Y
1230PHA
1240JSR &FFEE
1250CMP #95
1260BNE skip1
1270LDA (&8B),Y
1280CMP #127
1290BPL skip2
1300.skip1
1310PLA
1320PHA
1330CMP #32
1340BEQ skip2
1350CMP #95
1360BNE skip3
1370LDA (&8B),Y
1380CLC
1390ADC #128
1400JMP skip5
1410.skip3
1420LDA (&8B),Y
1430CMP #128
1440BMI skip4
1450PLA
1460PHA
1470CLC
1480ADC #128
1490JMP skip5
1500.skip4
1510PLA
1520PHA
1530.skip5
1540STA (&8B),Y
1550.skip2
1560PLA
1570INY
1580CPY &8E
1590BNE loop
1600LDA #13
1610JSR &FFEE
1620LDA #3
1630JSR &FFEE
1640LDA #10
1650JSR &FFEE
1660RTS
1670]:NEXT
1680FOR pass=0 TO 2 STEP 2
1690P%=E%
1700[OPT pass
1710LDA #5
1720JSR &FFEE
1730JSR sub
1740.loop1
1750LDA (&8B),Y
1760CMP #128
1770BMI skip1
1780SEC
1790SBC #128
1800STA C%,Y
1810LDA #95
1820JSR &FFEE
1830JMP skip2
1840.skip1
1850STA C%,Y
1860LDA #9
1870JSR &FFEE
1880.skip2
1890INY
1900CPY #70
1910BNE loop1
1920JSR sub
1930.loop2
1940LDA C%,Y
1950JSR &FFEE
1960INY
1970CPY #70
1980BNE loop2
1990LDA #4
2000JSR &FFEE
2010RTS
2020.sub
2030LDA #25
2040JSR &FFEE
2050LDA #4
2060JSR &FFEE
2070LDA #80
2080JSR &FFEE
2090LDA #0
2100JSR &FFEE
2110LDA &8D
2120JSR &FFEE
2130LDA &8E
2140JSR &FFEE
2150LDY #0
2160RTS
2170]:NEXT
2180ENDPROC