Home » Archimedes archive » Acorn User » AU 1995-09.adf » !Regulars » Regulars/RuntheRISC/BI_DIdrive

Regulars/RuntheRISC/BI_DIdrive

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 » Archimedes archive » Acorn User » AU 1995-09.adf » !Regulars
Filename: Regulars/RuntheRISC/BI_DIdrive
Read OK:
File size: 12CA bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >Develop.BI_DIdrive
   20REM ASSEMBLE A RELOCATABLE MODULE
   30REM To drive the single direction to bi-direction hardware
   40REM With SWIs
   50PROC_Bint
   60PRINTSPC(24);~MS;" ";~ME
   70*KEY 1 OSCLI("*SAVE Develop.!PortMon.MakeBi "+STR$~MS+" "+STR$~ME) |M
   80*KEY 2 *SETTYPE Develop.!PortMon.MakeBi FFA |M
   90*KEY 3 *RMLOAD Develop.!PortMon.MakeBi |M
  100
  110*KEY 5 SYS&42EC1,2,0,&FFFFFFFF TO ,A%,B%:P.~A%,~B%|M
  120*KEY 6 SYS&42EC1,2,
  130*KEY 7 ,0 TO ,A%,B%:P.~A%,~B%|M
  140*KEY 9 SYS&42EC1, 1,&FF,&FF|M
  150*KEY 10 SYS&42EC1, 1,&00,&FF|M
  160*KEY 11 SYS&42EC1,0 TO ,A%,B%:P.~A%,~B%|M
  170END
  180DEF PROC_Bint
  190REM INITILISATION
  200DIM CODE% 1800
  210OS_WriteI=&100
  220FOR A%=0 TO 3 STEP 3
  230P%=CODE%
  240[
  250OPT A%
  260.MS \ MODULE START LABLE
  270EQUD 0      \ START CODE
  280EQUD IC-MS  \ INITILISATION OFFSET
  290EQUD FC-MS  \ FINILISATION CODE
  300EQUD 0      \ SERVICE CODE
  310EQUD TS-MS  \ TITLE STRING OFFSET
  320EQUD HS-MS  \ HELP STRING OFFSET
  330EQUD 0      \ COMMAND TABLE OFFSET
  340EQUD &42EC0 \ SWI CHUNK BASE
  350EQUD PP-MS  \ SWI HANDLER CODE
  360EQUD 0      \ SWI DECODING TABLE
  370EQUD 0      \ SWI DECODING CODE
  380EQUD 0      \ END OF TABLE MARKER
  390.HS EQUS "Printer Port"
  400EQUB 09
  410EQUS "0.10 (10 July 1995) Driver for single to Bi-directional Port"
  420EQUB 0
  430ALIGN
  440.TS EQUS "BI-DI_Port_Driver"
  450EQUB 0
  460ALIGN
  470
  480.IC \ START CODE
  490\ CLAIM MEMORY
  500STMFD (13)!,{14} \ RENUMBER RETURN
  510MOV R0,#6 \ CLAIM SPACE
  520MOV R3,#&4 \ AMOUNT OF SPACE
  530SWI "OS_Module" \ ask for space
  540STRVC R2,[R12]
  550LDMFD (13) !,{15} \ BACK FROM WHENST CAME
  560
  570.FC \ FINILISATION CODE
  580STMFD (13)!,{14} \ RENUMBER RETURN
  590MOV R0,#7 \ FREE SPACE
  600LDR R2,[R12] \ POINTER TO MEMORY
  610MOV R3,#&3E00 \ AMOUNT OF SPACE
  620SWI "OS_Module" \ GIVE IT BACK
  630LDMFD (13) !,{15} \ BACK FROM WHENST CAME
  640
  650.PP \ MACHINE CODE TO HANDLE PRINTER ACCESS
  660
  670LDR R12,[R12]
  680CMP R11,#(EOJ - JT)/4
  690ADDLO PC, PC, R11, LSL #2
  700B UNKN
  710.JT
  720B PP0
  730B PP1
  740.EOJ
  750.UNKN
  760ADR R0,ErrTok
  770MOV R1, #0
  780MOV R2, #0
  790ADR R4, HS
  800SWI "XMessageTrans_ErrorLookup"
  810ORRS  PC, R14, #&10000000\ #Overflow_Flag
  820.ErrTok
  830EQUD &1E6
  840EQUS "BadSWI"
  850EQUB 0
  860ALIGN
  870\ Return Printer Address
  880.PP0
  890MOV R0,#&3200000 \ Address of Printer Port
  900ADD R0,R0,#&50000
  910ADD R0,R0,#&10
  920MOVS PC,R14
  930
  940\ Parallel port Operation
  950.PP1
  960STMFD R13!,{R3,R4,R5,R6}
  970CMP R0,#0
  980BEQ Rs
  990CMP R0,#1
 1000BEQ WDR
 1010CMP R0,#2
 1020BEQ CT
 1030MOVS PC,R14
 1040
 1050\Read status & data
 1060.Rs
 1070MOV R4,#&3200000 \ Address of Printer Port
 1080ADD R0,R4,#&50000 \ Point to printer
 1090MOV R5,#0 \ Register to accumulate Printer byte
 1100MOV R6,#0 \ Register to accumulate Status byte
 1110MOV R1,#&67
 1120.nb
 1130MOV R2,R1,ASL #16 \ Shift to top 16 bits
 1140STR R2,[R0,#&10] \ Store it out to port
 1150
 1160MOV R5,R5,ASL #1
 1170MOV R6,R6,ASL #1
 1180LDRB R3,[R4,#&10] \ Get Busy
 1190AND R3,R3,#1 \ Mask out busy
 1200ORR R5,R5,R3 \ Merge with printer byte
 1210
 1220LDRB R3,[R4,#&00] \ Get ACK
 1230AND R3,R3,#&40
 1240MOV R3,R3,LSR #6
 1250ORR R6,R6,R3 \ Merge with status byte
 1260SUB R1,R1,#1 \ Next multiplexer address
 1270
 1280TST R1,#8 \ Have we reached the end of all addresses
 1290BEQ nb    \ Do it again if we have not
 1300MOV R1,R5
 1310MOV R2,R6
 1320EOR R2,R2,#&80 \ Invert status bit
 1330MOV R0,#0
 1340LDMFD R13!,{R3,R4,R5,R6}
 1350MOVS PC,R14
 1360
 1370\ Write Data to printer
 1380.WDR
 1390MOV R4,#&3200000 \ Address of Printer Port
 1400ADD R4,R4,#&50000
 1410MOV R1,R1, ASL #16
 1420MOV R2,#&67
 1430MOV R2,R2,ASL #16
 1440.nb2
 1450AND R3,R1,#&800000 \ Isolate top bit
 1460ORR R3,R3,R2 \ Merge with address
 1470STR R3,[R4,#&10] \ Output data
 1480AND R3,R3,#&DF0000 \ Strobe low
 1490STR R3,[R4,#&10]
 1500
 1510ORR R3,R3,#&200000 \ Strobe high
 1520STR R3,[R4,#&10]
 1530MOV R1,R1,ASL #1 \ Slide to next bit
 1540SUB R2,R2,#&10000
 1550TST R2,#&80000
 1560BEQ nb2
 1570LDMFD R13!,{R3,R4,R5,R6}
 1580MOVS PC,R14
 1590
 1600\ Read & Write control reg
 1610.CT
 1620LDR R0,[R12] \ Get what has been written to Control before
 1630AND R3,R2,R0
 1640EOR R2,R3,R1 \ Now contains new value
 1650AND R2,R2,#&FF
 1660STR R2,[R12] \ Record new value
 1670MOV R1,R2
 1680EOR R1,R1,#&B \ Make some outputs inverted
 1690
 1700\ Now write it to the multiplexer
 1710MOV R4,#&3200000 \ Address of Printer Port
 1720ADD R4,R4,#&50000
 1730MOV R1,R1, ASL #16
 1740MOV R2,#&67
 1750MOV R2,R2,ASL #16
 1760.nb3
 1770AND R3,R1,#&800000 \ Isolate second top bit
 1780ORR R3,R3,R2 \ Merge with address
 1790STR R3,[R4,#&10] \ Output data
 1800AND R3,R3,#&BF0000 \ Strobe low
 1810STR R3,[R4,#&10]
 1820
 1830\Delay
 1840\MOV R6,#&400
 1850\.DL3
 1860\STR R3,[R4,#&10]
 1870\SUBS R6,R6,#1
 1880\BNE DL3
 1890
 1900ORR R3,R3,#&400000 \ Strobe high
 1910STR R3,[R4,#&10]
 1920MOV R1,R1,ASL #1 \ Slide to next bit
 1930SUB R2,R2,#&10000
 1940TST R2,#&80000
 1950BEQ nb3
 1960
 1970\Put values in right place
 1980MOV R1,R0    \ Old value
 1990MOV R0,#3
 2000LDR R2,[R12] \ New value
 2010LDMFD R13!,{R3,R4,R5,R6}
 2020MOVS PC,R14
 2030
 2040.ME \ LABLE FOR MODULE END
 2050]
 2060NEXT
 2070ENDPROC

� >Develop.BI_DIdrive
#� ASSEMBLE A RELOCATABLE MODULE
<� To drive the single direction to bi-direction hardware
(� With SWIs
2
�_Bint
<�(24);~MS;" ";~ME
FI*KEY 1 OSCLI("*SAVE Develop.!PortMon.MakeBi "+STR$~MS+" "+STR$~ME) |M
P2*KEY 2 *SETTYPE Develop.!PortMon.MakeBi FFA |M
Z-*KEY 3 *RMLOAD Develop.!PortMon.MakeBi |M
d
n8*KEY 5 SYS&42EC1,2,0,&FFFFFFFF TO ,A%,B%:P.~A%,~B%|M
x*KEY 6 SYS&42EC1,2,
�#*KEY 7 ,0 TO ,A%,B%:P.~A%,~B%|M
�!*KEY 9 SYS&42EC1, 1,&FF,&FF|M
�"*KEY 10 SYS&42EC1, 1,&00,&FF|M
�-*KEY 11 SYS&42EC1,0 TO ,A%,B%:P.~A%,~B%|M
��
�� �_Bint
�� INITILISATION
�� CODE% 1800
�OS_WriteI=&100
�� A%=0 � 3 � 3
�P%=CODE%
�[
�
OPT A%
.MS \ �ULE START LABLE
EQUD 0      \ START CODE
$EQUD IC-MS  \ INITILISATION �SET
"#EQUD FC-MS  \ FINILISATION CODE
,EQUD 0      \ SERVICE CODE
6#EQUD TS-MS  \ TITLE STRING �SET
@ EQUD HS-MS  \ Ǔ STRING �SET
J$EQUD 0      \ COMMAND TABLE �SET
T EQUD &42EC0 \ SWI CHUNK BASE
^"EQUD PP-MS  \ SWI HANDLER CODE
h$EQUD 0      \ SWI DECODING TABLE
r#EQUD 0      \ SWI DECODING CODE
|"EQUD 0      \ � � TABLE MARKER
�.HS EQUS "Printer Port"
�EQUB 09
�GEQUS "0.10 (10 July 1995) Driver for single to Bi-directional Port"
�
EQUB 0
�	ALIGN
� .TS EQUS "BI-DI_Port_Driver"
�
EQUB 0
�	ALIGN
�
�.IC \ START CODE
�\ CLAIM MEMORY
�STMFD (13)!,{14} \ Ǚ �
�MOV R0,#6 \ CLAIM SPACE
MOV R3,#&4 \ AMOUNT � SPACE
#SWI "OS_Module" \ ask for space
STRVC R2,[R12]
&*LDMFD (13) !,{15} \ BACK FROM �ST CAME
0
:.FC \ FINILISATION CODE
DSTMFD (13)!,{14} \ Ǚ �
NMOV R0,#7 \ FREE SPACE
X LDR R2,[R12] \ ȒER � MEMORY
b"MOV R3,#&3E00 \ AMOUNT � SPACE
l"SWI "OS_Module" \ GIVE IT BACK
v*LDMFD (13) !,{15} \ BACK FROM �ST CAME
�
�*.PP \ MACHINE CODE � HANDLE �ER ACCESS
�
�LDR R12,[R12]
�CMP R11,#(EOJ - JT)/4
�ADDLO PC, PC, R11, LSL #2
�
B UNKN
�.JT
�	B PP0
�	B PP1
�.EOJ
�	.UNKN
�ADR R0,ErrTok
MOV R1, #0
MOV R2, #0
ADR R4, HS
 #SWI "XMessageTrans_ErrorLookup"
*,�RS  PC, R14, #&10000000\ #Overflow_Flag
4.ErrTok
>
EQUD &1E6
HEQUS "BadSWI"
R
EQUB 0
\	ALIGN
f\ Return Printer Address
p.PP0
z.MOV R0,#&3200000 \ Address of Printer Port
�ADD R0,R0,#&50000
�ADD R0,R0,#&10
�MOVS PC,R14
�
�\ Parallel port Operation
�.PP1
�STMFD R13!,{R3,R4,R5,R6}
�
CMP R0,#0
�
BEQ Rs
�
CMP R0,#1
�BEQ WDR
�
CMP R0,#2
�
BEQ CT
MOVS PC,R14

\Read status & data
$.Rs
..MOV R4,#&3200000 \ Address of Printer Port
8(ADD R0,R4,#&50000 \ Point to printer
B3MOV R5,#0 \ Register to accumulate Printer byte
L2MOV R6,#0 \ Register to accumulate Status byte
VMOV R1,#&67
`.nb
j,MOV R2,R1,ASL #16 \ Shift to top 16 bits
t+STR R2,[R0,#&10] \ Store it out to port
~
�MOV R5,R5,ASL #1
�MOV R6,R6,ASL #1
� LDRB R3,[R4,#&10] \ Get Busy
�� R3,R3,#1 \ Mask out busy
�)�R R5,R5,R3 \ Merge with printer byte
�
�LDRB R3,[R4,#&00] \ Get ACK
�� R3,R3,#&40
�MOV R3,R3,LSR #6
�(�R R6,R6,R3 \ Merge with status byte
�+SUB R1,R1,#1 \ Next multiplexer address
�
8TST R1,#8 \ Have we reached the end of all addresses

*BEQ nb    \ Do it again if we have not

MOV R1,R5

MOV R2,R6
($� R2,R2,#&80 \ Invert status bit
2
MOV R0,#0
<LDMFD R13!,{R3,R4,R5,R6}
FMOVS PC,R14
P
Z\ Write Data to printer
d.WDR
n.MOV R4,#&3200000 \ Address of Printer Port
xADD R4,R4,#&50000
�MOV R1,R1, ASL #16
�MOV R2,#&67
�MOV R2,R2,ASL #16
�.nb2
�&� R3,R1,#&800000 \ Isolate top bit
�$�R R3,R3,R2 \ Merge with address
�"STR R3,[R4,#&10] \ Output data
�!� R3,R3,#&DF0000 \ Strobe low
�STR R3,[R4,#&10]
�
�#�R R3,R3,#&200000 \ Strobe high
�STR R3,[R4,#&10]
�(MOV R1,R1,ASL #1 \ Slide to next bit
SUB R2,R2,#&10000
TST R2,#&80000
BEQ nb2
"LDMFD R13!,{R3,R4,R5,R6}
,MOVS PC,R14
6
@\ Read & Write control reg
J.CT
T>LDR R0,[R12] \ Get what has been written to Control before
^� R3,R2,R0
h'� R2,R3,R1 \ Now contains new value
r� R2,R2,#&FF
|#STR R2,[R12] \ Record new value
�
MOV R1,R2
�,� R1,R1,#&B \ Make some outputs inverted
�
�%\ Now write it to the multiplexer
�.MOV R4,#&3200000 \ Address of Printer Port
�ADD R4,R4,#&50000
�MOV R1,R1, ASL #16
�MOV R2,#&67
�MOV R2,R2,ASL #16
�.nb3
�-� R3,R1,#&800000 \ Isolate second top bit
�$�R R3,R3,R2 \ Merge with address
�"STR R3,[R4,#&10] \ Output data
!� R3,R3,#&BF0000 \ Strobe low
STR R3,[R4,#&10]

&
\Delay
0\MOV R6,#&400
:	\.DL3
D\STR R3,[R4,#&10]
N\SUBS R6,R6,#1
X\BNE DL3
b
l#�R R3,R3,#&400000 \ Strobe high
vSTR R3,[R4,#&10]
�(MOV R1,R1,ASL #1 \ Slide to next bit
�SUB R2,R2,#&10000
�TST R2,#&80000
�BEQ nb3
�
�\Put values in right place
�MOV R1,R0    \ Old value
�
MOV R0,#3
�LDR R2,[R12] \ New value
�LDMFD R13!,{R3,R4,R5,R6}
�MOVS PC,R14
�
�.ME \ LABLE � �ULE �
]
�
�
�
00000000  0d 00 0a 19 f4 20 3e 44  65 76 65 6c 6f 70 2e 42  |..... >Develop.B|
00000010  49 5f 44 49 64 72 69 76  65 0d 00 14 23 f4 20 41  |I_DIdrive...#. A|
00000020  53 53 45 4d 42 4c 45 20  41 20 52 45 4c 4f 43 41  |SSEMBLE A RELOCA|
00000030  54 41 42 4c 45 20 4d 4f  44 55 4c 45 0d 00 1e 3c  |TABLE MODULE...<|
00000040  f4 20 54 6f 20 64 72 69  76 65 20 74 68 65 20 73  |. To drive the s|
00000050  69 6e 67 6c 65 20 64 69  72 65 63 74 69 6f 6e 20  |ingle direction |
00000060  74 6f 20 62 69 2d 64 69  72 65 63 74 69 6f 6e 20  |to bi-direction |
00000070  68 61 72 64 77 61 72 65  0d 00 28 0f f4 20 57 69  |hardware..(.. Wi|
00000080  74 68 20 53 57 49 73 0d  00 32 0a f2 5f 42 69 6e  |th SWIs..2.._Bin|
00000090  74 0d 00 3c 16 f1 89 28  32 34 29 3b 7e 4d 53 3b  |t..<...(24);~MS;|
000000a0  22 20 22 3b 7e 4d 45 0d  00 46 49 2a 4b 45 59 20  |" ";~ME..FI*KEY |
000000b0  31 20 4f 53 43 4c 49 28  22 2a 53 41 56 45 20 44  |1 OSCLI("*SAVE D|
000000c0  65 76 65 6c 6f 70 2e 21  50 6f 72 74 4d 6f 6e 2e  |evelop.!PortMon.|
000000d0  4d 61 6b 65 42 69 20 22  2b 53 54 52 24 7e 4d 53  |MakeBi "+STR$~MS|
000000e0  2b 22 20 22 2b 53 54 52  24 7e 4d 45 29 20 7c 4d  |+" "+STR$~ME) |M|
000000f0  0d 00 50 32 2a 4b 45 59  20 32 20 2a 53 45 54 54  |..P2*KEY 2 *SETT|
00000100  59 50 45 20 44 65 76 65  6c 6f 70 2e 21 50 6f 72  |YPE Develop.!Por|
00000110  74 4d 6f 6e 2e 4d 61 6b  65 42 69 20 46 46 41 20  |tMon.MakeBi FFA |
00000120  7c 4d 0d 00 5a 2d 2a 4b  45 59 20 33 20 2a 52 4d  ||M..Z-*KEY 3 *RM|
00000130  4c 4f 41 44 20 44 65 76  65 6c 6f 70 2e 21 50 6f  |LOAD Develop.!Po|
00000140  72 74 4d 6f 6e 2e 4d 61  6b 65 42 69 20 7c 4d 0d  |rtMon.MakeBi |M.|
00000150  00 64 04 0d 00 6e 38 2a  4b 45 59 20 35 20 53 59  |.d...n8*KEY 5 SY|
00000160  53 26 34 32 45 43 31 2c  32 2c 30 2c 26 46 46 46  |S&42EC1,2,0,&FFF|
00000170  46 46 46 46 46 20 54 4f  20 2c 41 25 2c 42 25 3a  |FFFFF TO ,A%,B%:|
00000180  50 2e 7e 41 25 2c 7e 42  25 7c 4d 0d 00 78 17 2a  |P.~A%,~B%|M..x.*|
00000190  4b 45 59 20 36 20 53 59  53 26 34 32 45 43 31 2c  |KEY 6 SYS&42EC1,|
000001a0  32 2c 0d 00 82 23 2a 4b  45 59 20 37 20 2c 30 20  |2,...#*KEY 7 ,0 |
000001b0  54 4f 20 2c 41 25 2c 42  25 3a 50 2e 7e 41 25 2c  |TO ,A%,B%:P.~A%,|
000001c0  7e 42 25 7c 4d 0d 00 8c  21 2a 4b 45 59 20 39 20  |~B%|M...!*KEY 9 |
000001d0  53 59 53 26 34 32 45 43  31 2c 20 31 2c 26 46 46  |SYS&42EC1, 1,&FF|
000001e0  2c 26 46 46 7c 4d 0d 00  96 22 2a 4b 45 59 20 31  |,&FF|M..."*KEY 1|
000001f0  30 20 53 59 53 26 34 32  45 43 31 2c 20 31 2c 26  |0 SYS&42EC1, 1,&|
00000200  30 30 2c 26 46 46 7c 4d  0d 00 a0 2d 2a 4b 45 59  |00,&FF|M...-*KEY|
00000210  20 31 31 20 53 59 53 26  34 32 45 43 31 2c 30 20  | 11 SYS&42EC1,0 |
00000220  54 4f 20 2c 41 25 2c 42  25 3a 50 2e 7e 41 25 2c  |TO ,A%,B%:P.~A%,|
00000230  7e 42 25 7c 4d 0d 00 aa  05 e0 0d 00 b4 0c dd 20  |~B%|M.......... |
00000240  f2 5f 42 69 6e 74 0d 00  be 13 f4 20 49 4e 49 54  |._Bint..... INIT|
00000250  49 4c 49 53 41 54 49 4f  4e 0d 00 c8 10 de 20 43  |ILISATION..... C|
00000260  4f 44 45 25 20 31 38 30  30 0d 00 d2 12 4f 53 5f  |ODE% 1800....OS_|
00000270  57 72 69 74 65 49 3d 26  31 30 30 0d 00 dc 12 e3  |WriteI=&100.....|
00000280  20 41 25 3d 30 20 b8 20  33 20 88 20 33 0d 00 e6  | A%=0 . 3 . 3...|
00000290  0c 50 25 3d 43 4f 44 45  25 0d 00 f0 05 5b 0d 00  |.P%=CODE%....[..|
000002a0  fa 0a 4f 50 54 20 41 25  0d 01 04 1a 2e 4d 53 20  |..OPT A%.....MS |
000002b0  5c 20 83 55 4c 45 20 53  54 41 52 54 20 4c 41 42  |\ .ULE START LAB|
000002c0  4c 45 0d 01 0e 1c 45 51  55 44 20 30 20 20 20 20  |LE....EQUD 0    |
000002d0  20 20 5c 20 53 54 41 52  54 20 43 4f 44 45 0d 01  |  \ START CODE..|
000002e0  18 24 45 51 55 44 20 49  43 2d 4d 53 20 20 5c 20  |.$EQUD IC-MS  \ |
000002f0  49 4e 49 54 49 4c 49 53  41 54 49 4f 4e 20 87 53  |INITILISATION .S|
00000300  45 54 0d 01 22 23 45 51  55 44 20 46 43 2d 4d 53  |ET.."#EQUD FC-MS|
00000310  20 20 5c 20 46 49 4e 49  4c 49 53 41 54 49 4f 4e  |  \ FINILISATION|
00000320  20 43 4f 44 45 0d 01 2c  1e 45 51 55 44 20 30 20  | CODE..,.EQUD 0 |
00000330  20 20 20 20 20 5c 20 53  45 52 56 49 43 45 20 43  |     \ SERVICE C|
00000340  4f 44 45 0d 01 36 23 45  51 55 44 20 54 53 2d 4d  |ODE..6#EQUD TS-M|
00000350  53 20 20 5c 20 54 49 54  4c 45 20 53 54 52 49 4e  |S  \ TITLE STRIN|
00000360  47 20 87 53 45 54 0d 01  40 20 45 51 55 44 20 48  |G .SET..@ EQUD H|
00000370  53 2d 4d 53 20 20 5c 20  c7 93 20 53 54 52 49 4e  |S-MS  \ .. STRIN|
00000380  47 20 87 53 45 54 0d 01  4a 24 45 51 55 44 20 30  |G .SET..J$EQUD 0|
00000390  20 20 20 20 20 20 5c 20  43 4f 4d 4d 41 4e 44 20  |      \ COMMAND |
000003a0  54 41 42 4c 45 20 87 53  45 54 0d 01 54 20 45 51  |TABLE .SET..T EQ|
000003b0  55 44 20 26 34 32 45 43  30 20 5c 20 53 57 49 20  |UD &42EC0 \ SWI |
000003c0  43 48 55 4e 4b 20 42 41  53 45 0d 01 5e 22 45 51  |CHUNK BASE..^"EQ|
000003d0  55 44 20 50 50 2d 4d 53  20 20 5c 20 53 57 49 20  |UD PP-MS  \ SWI |
000003e0  48 41 4e 44 4c 45 52 20  43 4f 44 45 0d 01 68 24  |HANDLER CODE..h$|
000003f0  45 51 55 44 20 30 20 20  20 20 20 20 5c 20 53 57  |EQUD 0      \ SW|
00000400  49 20 44 45 43 4f 44 49  4e 47 20 54 41 42 4c 45  |I DECODING TABLE|
00000410  0d 01 72 23 45 51 55 44  20 30 20 20 20 20 20 20  |..r#EQUD 0      |
00000420  5c 20 53 57 49 20 44 45  43 4f 44 49 4e 47 20 43  |\ SWI DECODING C|
00000430  4f 44 45 0d 01 7c 22 45  51 55 44 20 30 20 20 20  |ODE..|"EQUD 0   |
00000440  20 20 20 5c 20 e0 20 ca  20 54 41 42 4c 45 20 4d  |   \ . . TABLE M|
00000450  41 52 4b 45 52 0d 01 86  1b 2e 48 53 20 45 51 55  |ARKER.....HS EQU|
00000460  53 20 22 50 72 69 6e 74  65 72 20 50 6f 72 74 22  |S "Printer Port"|
00000470  0d 01 90 0b 45 51 55 42  20 30 39 0d 01 9a 47 45  |....EQUB 09...GE|
00000480  51 55 53 20 22 30 2e 31  30 20 28 31 30 20 4a 75  |QUS "0.10 (10 Ju|
00000490  6c 79 20 31 39 39 35 29  20 44 72 69 76 65 72 20  |ly 1995) Driver |
000004a0  66 6f 72 20 73 69 6e 67  6c 65 20 74 6f 20 42 69  |for single to Bi|
000004b0  2d 64 69 72 65 63 74 69  6f 6e 61 6c 20 50 6f 72  |-directional Por|
000004c0  74 22 0d 01 a4 0a 45 51  55 42 20 30 0d 01 ae 09  |t"....EQUB 0....|
000004d0  41 4c 49 47 4e 0d 01 b8  20 2e 54 53 20 45 51 55  |ALIGN... .TS EQU|
000004e0  53 20 22 42 49 2d 44 49  5f 50 6f 72 74 5f 44 72  |S "BI-DI_Port_Dr|
000004f0  69 76 65 72 22 0d 01 c2  0a 45 51 55 42 20 30 0d  |iver"....EQUB 0.|
00000500  01 cc 09 41 4c 49 47 4e  0d 01 d6 04 0d 01 e0 14  |...ALIGN........|
00000510  2e 49 43 20 5c 20 53 54  41 52 54 20 43 4f 44 45  |.IC \ START CODE|
00000520  0d 01 ea 12 5c 20 43 4c  41 49 4d 20 4d 45 4d 4f  |....\ CLAIM MEMO|
00000530  52 59 0d 01 f4 1b 53 54  4d 46 44 20 28 31 33 29  |RY....STMFD (13)|
00000540  21 2c 7b 31 34 7d 20 5c  20 c7 99 20 f8 0d 01 fe  |!,{14} \ .. ....|
00000550  1b 4d 4f 56 20 52 30 2c  23 36 20 5c 20 43 4c 41  |.MOV R0,#6 \ CLA|
00000560  49 4d 20 53 50 41 43 45  0d 02 08 1f 4d 4f 56 20  |IM SPACE....MOV |
00000570  52 33 2c 23 26 34 20 5c  20 41 4d 4f 55 4e 54 20  |R3,#&4 \ AMOUNT |
00000580  ca 20 53 50 41 43 45 0d  02 12 23 53 57 49 20 22  |. SPACE...#SWI "|
00000590  4f 53 5f 4d 6f 64 75 6c  65 22 20 5c 20 61 73 6b  |OS_Module" \ ask|
000005a0  20 66 6f 72 20 73 70 61  63 65 0d 02 1c 12 53 54  | for space....ST|
000005b0  52 56 43 20 52 32 2c 5b  52 31 32 5d 0d 02 26 2a  |RVC R2,[R12]..&*|
000005c0  4c 44 4d 46 44 20 28 31  33 29 20 21 2c 7b 31 35  |LDMFD (13) !,{15|
000005d0  7d 20 5c 20 42 41 43 4b  20 46 52 4f 4d 20 c9 53  |} \ BACK FROM .S|
000005e0  54 20 43 41 4d 45 0d 02  30 04 0d 02 3a 1b 2e 46  |T CAME..0...:..F|
000005f0  43 20 5c 20 46 49 4e 49  4c 49 53 41 54 49 4f 4e  |C \ FINILISATION|
00000600  20 43 4f 44 45 0d 02 44  1b 53 54 4d 46 44 20 28  | CODE..D.STMFD (|
00000610  31 33 29 21 2c 7b 31 34  7d 20 5c 20 c7 99 20 f8  |13)!,{14} \ .. .|
00000620  0d 02 4e 1a 4d 4f 56 20  52 30 2c 23 37 20 5c 20  |..N.MOV R0,#7 \ |
00000630  46 52 45 45 20 53 50 41  43 45 0d 02 58 20 4c 44  |FREE SPACE..X LD|
00000640  52 20 52 32 2c 5b 52 31  32 5d 20 5c 20 c8 92 45  |R R2,[R12] \ ..E|
00000650  52 20 b8 20 4d 45 4d 4f  52 59 0d 02 62 22 4d 4f  |R . MEMORY..b"MO|
00000660  56 20 52 33 2c 23 26 33  45 30 30 20 5c 20 41 4d  |V R3,#&3E00 \ AM|
00000670  4f 55 4e 54 20 ca 20 53  50 41 43 45 0d 02 6c 22  |OUNT . SPACE..l"|
00000680  53 57 49 20 22 4f 53 5f  4d 6f 64 75 6c 65 22 20  |SWI "OS_Module" |
00000690  5c 20 47 49 56 45 20 49  54 20 42 41 43 4b 0d 02  |\ GIVE IT BACK..|
000006a0  76 2a 4c 44 4d 46 44 20  28 31 33 29 20 21 2c 7b  |v*LDMFD (13) !,{|
000006b0  31 35 7d 20 5c 20 42 41  43 4b 20 46 52 4f 4d 20  |15} \ BACK FROM |
000006c0  c9 53 54 20 43 41 4d 45  0d 02 80 04 0d 02 8a 2a  |.ST CAME.......*|
000006d0  2e 50 50 20 5c 20 4d 41  43 48 49 4e 45 20 43 4f  |.PP \ MACHINE CO|
000006e0  44 45 20 b8 20 48 41 4e  44 4c 45 20 f1 45 52 20  |DE . HANDLE .ER |
000006f0  41 43 43 45 53 53 0d 02  94 04 0d 02 9e 11 4c 44  |ACCESS........LD|
00000700  52 20 52 31 32 2c 5b 52  31 32 5d 0d 02 a8 19 43  |R R12,[R12]....C|
00000710  4d 50 20 52 31 31 2c 23  28 45 4f 4a 20 2d 20 4a  |MP R11,#(EOJ - J|
00000720  54 29 2f 34 0d 02 b2 1d  41 44 44 4c 4f 20 50 43  |T)/4....ADDLO PC|
00000730  2c 20 50 43 2c 20 52 31  31 2c 20 4c 53 4c 20 23  |, PC, R11, LSL #|
00000740  32 0d 02 bc 0a 42 20 55  4e 4b 4e 0d 02 c6 07 2e  |2....B UNKN.....|
00000750  4a 54 0d 02 d0 09 42 20  50 50 30 0d 02 da 09 42  |JT....B PP0....B|
00000760  20 50 50 31 0d 02 e4 08  2e 45 4f 4a 0d 02 ee 09  | PP1.....EOJ....|
00000770  2e 55 4e 4b 4e 0d 02 f8  11 41 44 52 20 52 30 2c  |.UNKN....ADR R0,|
00000780  45 72 72 54 6f 6b 0d 03  02 0e 4d 4f 56 20 52 31  |ErrTok....MOV R1|
00000790  2c 20 23 30 0d 03 0c 0e  4d 4f 56 20 52 32 2c 20  |, #0....MOV R2, |
000007a0  23 30 0d 03 16 0e 41 44  52 20 52 34 2c 20 48 53  |#0....ADR R4, HS|
000007b0  0d 03 20 23 53 57 49 20  22 58 4d 65 73 73 61 67  |.. #SWI "XMessag|
000007c0  65 54 72 61 6e 73 5f 45  72 72 6f 72 4c 6f 6f 6b  |eTrans_ErrorLook|
000007d0  75 70 22 0d 03 2a 2c 84  52 53 20 20 50 43 2c 20  |up"..*,.RS  PC, |
000007e0  52 31 34 2c 20 23 26 31  30 30 30 30 30 30 30 5c  |R14, #&10000000\|
000007f0  20 23 4f 76 65 72 66 6c  6f 77 5f 46 6c 61 67 0d  | #Overflow_Flag.|
00000800  03 34 0b 2e 45 72 72 54  6f 6b 0d 03 3e 0d 45 51  |.4..ErrTok..>.EQ|
00000810  55 44 20 26 31 45 36 0d  03 48 11 45 51 55 53 20  |UD &1E6..H.EQUS |
00000820  22 42 61 64 53 57 49 22  0d 03 52 0a 45 51 55 42  |"BadSWI"..R.EQUB|
00000830  20 30 0d 03 5c 09 41 4c  49 47 4e 0d 03 66 1c 5c  | 0..\.ALIGN..f.\|
00000840  20 52 65 74 75 72 6e 20  50 72 69 6e 74 65 72 20  | Return Printer |
00000850  41 64 64 72 65 73 73 0d  03 70 08 2e 50 50 30 0d  |Address..p..PP0.|
00000860  03 7a 2e 4d 4f 56 20 52  30 2c 23 26 33 32 30 30  |.z.MOV R0,#&3200|
00000870  30 30 30 20 5c 20 41 64  64 72 65 73 73 20 6f 66  |000 \ Address of|
00000880  20 50 72 69 6e 74 65 72  20 50 6f 72 74 0d 03 84  | Printer Port...|
00000890  15 41 44 44 20 52 30 2c  52 30 2c 23 26 35 30 30  |.ADD R0,R0,#&500|
000008a0  30 30 0d 03 8e 12 41 44  44 20 52 30 2c 52 30 2c  |00....ADD R0,R0,|
000008b0  23 26 31 30 0d 03 98 0f  4d 4f 56 53 20 50 43 2c  |#&10....MOVS PC,|
000008c0  52 31 34 0d 03 a2 04 0d  03 ac 1d 5c 20 50 61 72  |R14........\ Par|
000008d0  61 6c 6c 65 6c 20 70 6f  72 74 20 4f 70 65 72 61  |allel port Opera|
000008e0  74 69 6f 6e 0d 03 b6 08  2e 50 50 31 0d 03 c0 1c  |tion.....PP1....|
000008f0  53 54 4d 46 44 20 52 31  33 21 2c 7b 52 33 2c 52  |STMFD R13!,{R3,R|
00000900  34 2c 52 35 2c 52 36 7d  0d 03 ca 0d 43 4d 50 20  |4,R5,R6}....CMP |
00000910  52 30 2c 23 30 0d 03 d4  0a 42 45 51 20 52 73 0d  |R0,#0....BEQ Rs.|
00000920  03 de 0d 43 4d 50 20 52  30 2c 23 31 0d 03 e8 0b  |...CMP R0,#1....|
00000930  42 45 51 20 57 44 52 0d  03 f2 0d 43 4d 50 20 52  |BEQ WDR....CMP R|
00000940  30 2c 23 32 0d 03 fc 0a  42 45 51 20 43 54 0d 04  |0,#2....BEQ CT..|
00000950  06 0f 4d 4f 56 53 20 50  43 2c 52 31 34 0d 04 10  |..MOVS PC,R14...|
00000960  04 0d 04 1a 17 5c 52 65  61 64 20 73 74 61 74 75  |.....\Read statu|
00000970  73 20 26 20 64 61 74 61  0d 04 24 07 2e 52 73 0d  |s & data..$..Rs.|
00000980  04 2e 2e 4d 4f 56 20 52  34 2c 23 26 33 32 30 30  |...MOV R4,#&3200|
00000990  30 30 30 20 5c 20 41 64  64 72 65 73 73 20 6f 66  |000 \ Address of|
000009a0  20 50 72 69 6e 74 65 72  20 50 6f 72 74 0d 04 38  | Printer Port..8|
000009b0  28 41 44 44 20 52 30 2c  52 34 2c 23 26 35 30 30  |(ADD R0,R4,#&500|
000009c0  30 30 20 5c 20 50 6f 69  6e 74 20 74 6f 20 70 72  |00 \ Point to pr|
000009d0  69 6e 74 65 72 0d 04 42  33 4d 4f 56 20 52 35 2c  |inter..B3MOV R5,|
000009e0  23 30 20 5c 20 52 65 67  69 73 74 65 72 20 74 6f  |#0 \ Register to|
000009f0  20 61 63 63 75 6d 75 6c  61 74 65 20 50 72 69 6e  | accumulate Prin|
00000a00  74 65 72 20 62 79 74 65  0d 04 4c 32 4d 4f 56 20  |ter byte..L2MOV |
00000a10  52 36 2c 23 30 20 5c 20  52 65 67 69 73 74 65 72  |R6,#0 \ Register|
00000a20  20 74 6f 20 61 63 63 75  6d 75 6c 61 74 65 20 53  | to accumulate S|
00000a30  74 61 74 75 73 20 62 79  74 65 0d 04 56 0f 4d 4f  |tatus byte..V.MO|
00000a40  56 20 52 31 2c 23 26 36  37 0d 04 60 07 2e 6e 62  |V R1,#&67..`..nb|
00000a50  0d 04 6a 2c 4d 4f 56 20  52 32 2c 52 31 2c 41 53  |..j,MOV R2,R1,AS|
00000a60  4c 20 23 31 36 20 5c 20  53 68 69 66 74 20 74 6f  |L #16 \ Shift to|
00000a70  20 74 6f 70 20 31 36 20  62 69 74 73 0d 04 74 2b  | top 16 bits..t+|
00000a80  53 54 52 20 52 32 2c 5b  52 30 2c 23 26 31 30 5d  |STR R2,[R0,#&10]|
00000a90  20 5c 20 53 74 6f 72 65  20 69 74 20 6f 75 74 20  | \ Store it out |
00000aa0  74 6f 20 70 6f 72 74 0d  04 7e 04 0d 04 88 14 4d  |to port..~.....M|
00000ab0  4f 56 20 52 35 2c 52 35  2c 41 53 4c 20 23 31 0d  |OV R5,R5,ASL #1.|
00000ac0  04 92 14 4d 4f 56 20 52  36 2c 52 36 2c 41 53 4c  |...MOV R6,R6,ASL|
00000ad0  20 23 31 0d 04 9c 20 4c  44 52 42 20 52 33 2c 5b  | #1... LDRB R3,[|
00000ae0  52 34 2c 23 26 31 30 5d  20 5c 20 47 65 74 20 42  |R4,#&10] \ Get B|
00000af0  75 73 79 0d 04 a6 1e 80  20 52 33 2c 52 33 2c 23  |usy..... R3,R3,#|
00000b00  31 20 5c 20 4d 61 73 6b  20 6f 75 74 20 62 75 73  |1 \ Mask out bus|
00000b10  79 0d 04 b0 29 84 52 20  52 35 2c 52 35 2c 52 33  |y...).R R5,R5,R3|
00000b20  20 5c 20 4d 65 72 67 65  20 77 69 74 68 20 70 72  | \ Merge with pr|
00000b30  69 6e 74 65 72 20 62 79  74 65 0d 04 ba 04 0d 04  |inter byte......|
00000b40  c4 1f 4c 44 52 42 20 52  33 2c 5b 52 34 2c 23 26  |..LDRB R3,[R4,#&|
00000b50  30 30 5d 20 5c 20 47 65  74 20 41 43 4b 0d 04 ce  |00] \ Get ACK...|
00000b60  10 80 20 52 33 2c 52 33  2c 23 26 34 30 0d 04 d8  |.. R3,R3,#&40...|
00000b70  14 4d 4f 56 20 52 33 2c  52 33 2c 4c 53 52 20 23  |.MOV R3,R3,LSR #|
00000b80  36 0d 04 e2 28 84 52 20  52 36 2c 52 36 2c 52 33  |6...(.R R6,R6,R3|
00000b90  20 5c 20 4d 65 72 67 65  20 77 69 74 68 20 73 74  | \ Merge with st|
00000ba0  61 74 75 73 20 62 79 74  65 0d 04 ec 2b 53 55 42  |atus byte...+SUB|
00000bb0  20 52 31 2c 52 31 2c 23  31 20 5c 20 4e 65 78 74  | R1,R1,#1 \ Next|
00000bc0  20 6d 75 6c 74 69 70 6c  65 78 65 72 20 61 64 64  | multiplexer add|
00000bd0  72 65 73 73 0d 04 f6 04  0d 05 00 38 54 53 54 20  |ress.......8TST |
00000be0  52 31 2c 23 38 20 5c 20  48 61 76 65 20 77 65 20  |R1,#8 \ Have we |
00000bf0  72 65 61 63 68 65 64 20  74 68 65 20 65 6e 64 20  |reached the end |
00000c00  6f 66 20 61 6c 6c 20 61  64 64 72 65 73 73 65 73  |of all addresses|
00000c10  0d 05 0a 2a 42 45 51 20  6e 62 20 20 20 20 5c 20  |...*BEQ nb    \ |
00000c20  44 6f 20 69 74 20 61 67  61 69 6e 20 69 66 20 77  |Do it again if w|
00000c30  65 20 68 61 76 65 20 6e  6f 74 0d 05 14 0d 4d 4f  |e have not....MO|
00000c40  56 20 52 31 2c 52 35 0d  05 1e 0d 4d 4f 56 20 52  |V R1,R5....MOV R|
00000c50  32 2c 52 36 0d 05 28 24  82 20 52 32 2c 52 32 2c  |2,R6..($. R2,R2,|
00000c60  23 26 38 30 20 5c 20 49  6e 76 65 72 74 20 73 74  |#&80 \ Invert st|
00000c70  61 74 75 73 20 62 69 74  0d 05 32 0d 4d 4f 56 20  |atus bit..2.MOV |
00000c80  52 30 2c 23 30 0d 05 3c  1c 4c 44 4d 46 44 20 52  |R0,#0..<.LDMFD R|
00000c90  31 33 21 2c 7b 52 33 2c  52 34 2c 52 35 2c 52 36  |13!,{R3,R4,R5,R6|
00000ca0  7d 0d 05 46 0f 4d 4f 56  53 20 50 43 2c 52 31 34  |}..F.MOVS PC,R14|
00000cb0  0d 05 50 04 0d 05 5a 1b  5c 20 57 72 69 74 65 20  |..P...Z.\ Write |
00000cc0  44 61 74 61 20 74 6f 20  70 72 69 6e 74 65 72 0d  |Data to printer.|
00000cd0  05 64 08 2e 57 44 52 0d  05 6e 2e 4d 4f 56 20 52  |.d..WDR..n.MOV R|
00000ce0  34 2c 23 26 33 32 30 30  30 30 30 20 5c 20 41 64  |4,#&3200000 \ Ad|
00000cf0  64 72 65 73 73 20 6f 66  20 50 72 69 6e 74 65 72  |dress of Printer|
00000d00  20 50 6f 72 74 0d 05 78  15 41 44 44 20 52 34 2c  | Port..x.ADD R4,|
00000d10  52 34 2c 23 26 35 30 30  30 30 0d 05 82 16 4d 4f  |R4,#&50000....MO|
00000d20  56 20 52 31 2c 52 31 2c  20 41 53 4c 20 23 31 36  |V R1,R1, ASL #16|
00000d30  0d 05 8c 0f 4d 4f 56 20  52 32 2c 23 26 36 37 0d  |....MOV R2,#&67.|
00000d40  05 96 15 4d 4f 56 20 52  32 2c 52 32 2c 41 53 4c  |...MOV R2,R2,ASL|
00000d50  20 23 31 36 0d 05 a0 08  2e 6e 62 32 0d 05 aa 26  | #16.....nb2...&|
00000d60  80 20 52 33 2c 52 31 2c  23 26 38 30 30 30 30 30  |. R3,R1,#&800000|
00000d70  20 5c 20 49 73 6f 6c 61  74 65 20 74 6f 70 20 62  | \ Isolate top b|
00000d80  69 74 0d 05 b4 24 84 52  20 52 33 2c 52 33 2c 52  |it...$.R R3,R3,R|
00000d90  32 20 5c 20 4d 65 72 67  65 20 77 69 74 68 20 61  |2 \ Merge with a|
00000da0  64 64 72 65 73 73 0d 05  be 22 53 54 52 20 52 33  |ddress..."STR R3|
00000db0  2c 5b 52 34 2c 23 26 31  30 5d 20 5c 20 4f 75 74  |,[R4,#&10] \ Out|
00000dc0  70 75 74 20 64 61 74 61  0d 05 c8 21 80 20 52 33  |put data...!. R3|
00000dd0  2c 52 33 2c 23 26 44 46  30 30 30 30 20 5c 20 53  |,R3,#&DF0000 \ S|
00000de0  74 72 6f 62 65 20 6c 6f  77 0d 05 d2 14 53 54 52  |trobe low....STR|
00000df0  20 52 33 2c 5b 52 34 2c  23 26 31 30 5d 0d 05 dc  | R3,[R4,#&10]...|
00000e00  04 0d 05 e6 23 84 52 20  52 33 2c 52 33 2c 23 26  |....#.R R3,R3,#&|
00000e10  32 30 30 30 30 30 20 5c  20 53 74 72 6f 62 65 20  |200000 \ Strobe |
00000e20  68 69 67 68 0d 05 f0 14  53 54 52 20 52 33 2c 5b  |high....STR R3,[|
00000e30  52 34 2c 23 26 31 30 5d  0d 05 fa 28 4d 4f 56 20  |R4,#&10]...(MOV |
00000e40  52 31 2c 52 31 2c 41 53  4c 20 23 31 20 5c 20 53  |R1,R1,ASL #1 \ S|
00000e50  6c 69 64 65 20 74 6f 20  6e 65 78 74 20 62 69 74  |lide to next bit|
00000e60  0d 06 04 15 53 55 42 20  52 32 2c 52 32 2c 23 26  |....SUB R2,R2,#&|
00000e70  31 30 30 30 30 0d 06 0e  12 54 53 54 20 52 32 2c  |10000....TST R2,|
00000e80  23 26 38 30 30 30 30 0d  06 18 0b 42 45 51 20 6e  |#&80000....BEQ n|
00000e90  62 32 0d 06 22 1c 4c 44  4d 46 44 20 52 31 33 21  |b2..".LDMFD R13!|
00000ea0  2c 7b 52 33 2c 52 34 2c  52 35 2c 52 36 7d 0d 06  |,{R3,R4,R5,R6}..|
00000eb0  2c 0f 4d 4f 56 53 20 50  43 2c 52 31 34 0d 06 36  |,.MOVS PC,R14..6|
00000ec0  04 0d 06 40 1e 5c 20 52  65 61 64 20 26 20 57 72  |...@.\ Read & Wr|
00000ed0  69 74 65 20 63 6f 6e 74  72 6f 6c 20 72 65 67 0d  |ite control reg.|
00000ee0  06 4a 07 2e 43 54 0d 06  54 3e 4c 44 52 20 52 30  |.J..CT..T>LDR R0|
00000ef0  2c 5b 52 31 32 5d 20 5c  20 47 65 74 20 77 68 61  |,[R12] \ Get wha|
00000f00  74 20 68 61 73 20 62 65  65 6e 20 77 72 69 74 74  |t has been writt|
00000f10  65 6e 20 74 6f 20 43 6f  6e 74 72 6f 6c 20 62 65  |en to Control be|
00000f20  66 6f 72 65 0d 06 5e 0e  80 20 52 33 2c 52 32 2c  |fore..^.. R3,R2,|
00000f30  52 30 0d 06 68 27 82 20  52 32 2c 52 33 2c 52 31  |R0..h'. R2,R3,R1|
00000f40  20 5c 20 4e 6f 77 20 63  6f 6e 74 61 69 6e 73 20  | \ Now contains |
00000f50  6e 65 77 20 76 61 6c 75  65 0d 06 72 10 80 20 52  |new value..r.. R|
00000f60  32 2c 52 32 2c 23 26 46  46 0d 06 7c 23 53 54 52  |2,R2,#&FF..|#STR|
00000f70  20 52 32 2c 5b 52 31 32  5d 20 5c 20 52 65 63 6f  | R2,[R12] \ Reco|
00000f80  72 64 20 6e 65 77 20 76  61 6c 75 65 0d 06 86 0d  |rd new value....|
00000f90  4d 4f 56 20 52 31 2c 52  32 0d 06 90 2c 82 20 52  |MOV R1,R2...,. R|
00000fa0  31 2c 52 31 2c 23 26 42  20 5c 20 4d 61 6b 65 20  |1,R1,#&B \ Make |
00000fb0  73 6f 6d 65 20 6f 75 74  70 75 74 73 20 69 6e 76  |some outputs inv|
00000fc0  65 72 74 65 64 0d 06 9a  04 0d 06 a4 25 5c 20 4e  |erted.......%\ N|
00000fd0  6f 77 20 77 72 69 74 65  20 69 74 20 74 6f 20 74  |ow write it to t|
00000fe0  68 65 20 6d 75 6c 74 69  70 6c 65 78 65 72 0d 06  |he multiplexer..|
00000ff0  ae 2e 4d 4f 56 20 52 34  2c 23 26 33 32 30 30 30  |..MOV R4,#&32000|
00001000  30 30 20 5c 20 41 64 64  72 65 73 73 20 6f 66 20  |00 \ Address of |
00001010  50 72 69 6e 74 65 72 20  50 6f 72 74 0d 06 b8 15  |Printer Port....|
00001020  41 44 44 20 52 34 2c 52  34 2c 23 26 35 30 30 30  |ADD R4,R4,#&5000|
00001030  30 0d 06 c2 16 4d 4f 56  20 52 31 2c 52 31 2c 20  |0....MOV R1,R1, |
00001040  41 53 4c 20 23 31 36 0d  06 cc 0f 4d 4f 56 20 52  |ASL #16....MOV R|
00001050  32 2c 23 26 36 37 0d 06  d6 15 4d 4f 56 20 52 32  |2,#&67....MOV R2|
00001060  2c 52 32 2c 41 53 4c 20  23 31 36 0d 06 e0 08 2e  |,R2,ASL #16.....|
00001070  6e 62 33 0d 06 ea 2d 80  20 52 33 2c 52 31 2c 23  |nb3...-. R3,R1,#|
00001080  26 38 30 30 30 30 30 20  5c 20 49 73 6f 6c 61 74  |&800000 \ Isolat|
00001090  65 20 73 65 63 6f 6e 64  20 74 6f 70 20 62 69 74  |e second top bit|
000010a0  0d 06 f4 24 84 52 20 52  33 2c 52 33 2c 52 32 20  |...$.R R3,R3,R2 |
000010b0  5c 20 4d 65 72 67 65 20  77 69 74 68 20 61 64 64  |\ Merge with add|
000010c0  72 65 73 73 0d 06 fe 22  53 54 52 20 52 33 2c 5b  |ress..."STR R3,[|
000010d0  52 34 2c 23 26 31 30 5d  20 5c 20 4f 75 74 70 75  |R4,#&10] \ Outpu|
000010e0  74 20 64 61 74 61 0d 07  08 21 80 20 52 33 2c 52  |t data...!. R3,R|
000010f0  33 2c 23 26 42 46 30 30  30 30 20 5c 20 53 74 72  |3,#&BF0000 \ Str|
00001100  6f 62 65 20 6c 6f 77 0d  07 12 14 53 54 52 20 52  |obe low....STR R|
00001110  33 2c 5b 52 34 2c 23 26  31 30 5d 0d 07 1c 04 0d  |3,[R4,#&10].....|
00001120  07 26 0a 5c 44 65 6c 61  79 0d 07 30 11 5c 4d 4f  |.&.\Delay..0.\MO|
00001130  56 20 52 36 2c 23 26 34  30 30 0d 07 3a 09 5c 2e  |V R6,#&400..:.\.|
00001140  44 4c 33 0d 07 44 15 5c  53 54 52 20 52 33 2c 5b  |DL3..D.\STR R3,[|
00001150  52 34 2c 23 26 31 30 5d  0d 07 4e 12 5c 53 55 42  |R4,#&10]..N.\SUB|
00001160  53 20 52 36 2c 52 36 2c  23 31 0d 07 58 0c 5c 42  |S R6,R6,#1..X.\B|
00001170  4e 45 20 44 4c 33 0d 07  62 04 0d 07 6c 23 84 52  |NE DL3..b...l#.R|
00001180  20 52 33 2c 52 33 2c 23  26 34 30 30 30 30 30 20  | R3,R3,#&400000 |
00001190  5c 20 53 74 72 6f 62 65  20 68 69 67 68 0d 07 76  |\ Strobe high..v|
000011a0  14 53 54 52 20 52 33 2c  5b 52 34 2c 23 26 31 30  |.STR R3,[R4,#&10|
000011b0  5d 0d 07 80 28 4d 4f 56  20 52 31 2c 52 31 2c 41  |]...(MOV R1,R1,A|
000011c0  53 4c 20 23 31 20 5c 20  53 6c 69 64 65 20 74 6f  |SL #1 \ Slide to|
000011d0  20 6e 65 78 74 20 62 69  74 0d 07 8a 15 53 55 42  | next bit....SUB|
000011e0  20 52 32 2c 52 32 2c 23  26 31 30 30 30 30 0d 07  | R2,R2,#&10000..|
000011f0  94 12 54 53 54 20 52 32  2c 23 26 38 30 30 30 30  |..TST R2,#&80000|
00001200  0d 07 9e 0b 42 45 51 20  6e 62 33 0d 07 a8 04 0d  |....BEQ nb3.....|
00001210  07 b2 1e 5c 50 75 74 20  76 61 6c 75 65 73 20 69  |...\Put values i|
00001220  6e 20 72 69 67 68 74 20  70 6c 61 63 65 0d 07 bc  |n right place...|
00001230  1c 4d 4f 56 20 52 31 2c  52 30 20 20 20 20 5c 20  |.MOV R1,R0    \ |
00001240  4f 6c 64 20 76 61 6c 75  65 0d 07 c6 0d 4d 4f 56  |Old value....MOV|
00001250  20 52 30 2c 23 33 0d 07  d0 1c 4c 44 52 20 52 32  | R0,#3....LDR R2|
00001260  2c 5b 52 31 32 5d 20 5c  20 4e 65 77 20 76 61 6c  |,[R12] \ New val|
00001270  75 65 0d 07 da 1c 4c 44  4d 46 44 20 52 31 33 21  |ue....LDMFD R13!|
00001280  2c 7b 52 33 2c 52 34 2c  52 35 2c 52 36 7d 0d 07  |,{R3,R4,R5,R6}..|
00001290  e4 0f 4d 4f 56 53 20 50  43 2c 52 31 34 0d 07 ee  |..MOVS PC,R14...|
000012a0  04 0d 07 f8 18 2e 4d 45  20 5c 20 4c 41 42 4c 45  |......ME \ LABLE|
000012b0  20 e3 20 83 55 4c 45 20  e0 0d 08 02 05 5d 0d 08  | . .ULE .....]..|
000012c0  0c 05 ed 0d 08 16 05 e1  0d ff                    |..........|
000012ca