Home » Archimedes archive » Acorn Computing » 1994 08.adf » 9408 » BodyBuild/Drip

BodyBuild/Drip

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 Computing » 1994 08.adf » 9408
Filename: BodyBuild/Drip
Read OK:
File size: 0F39 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM>Drip
   20REM Chaos from a drip
   30REM Use the interrupt from the printer to time the
   40REM interval between drips
   50DIM CODE% 300
   60PROC_Init
   70PRINT"Drip detection test program"
   80PRINT"Escape to quit"
   90PRINT"Count  Time (mS)"
  100ON ERROR PROC_RELEASE
  110PROC_Claim
  120LC=0
  130REPEAT
  140CLS
  150PRINT"Body Build Phase Space Timer"
  160PRINT"by Mike Cook"
  170PRINT"You need the special hardware deiscribed in the:-"
  180PRINT"August 94 issue of Acorn Computing."
  190PRINT:PRINT"Press space bar to get back to this page."
  200PRINT"In Plot mode press S after space to save the plot to disc,"
  210PRINT"any other key not to save"
  220PRINT:PRINT"Test mode or Plot mode"
  230PRINT"ENTER T OR P"
  240A$=GET$
  250IF A$="T" OR A$="t" THEN PROC_TEST
  260IF A$="P" OR A$="p" THEN PROC_PLOT
  270UNTIL FALSE
  280
  290DEF PROC_TEST
  300PRINT"Test Mode"
  310REPEAT
  320IF !CNT<>LC THEN LC=!CNT:PRINT LC,!TD
  330UNTIL INKEY(-99)
  340ENDPROC
  350
  360DEF PROC_PLOT
  370LOCAL X%,Y%
  380PROC_AXIS
  390
  400REPEAT
  410LC=!CNT
  420REPEAT UNTIL(LC<>!CNT OR INKEY(-99))
  430X%=!TD:Y%=!TB
  440GCOL 0,POINT(X%,Y%)+1
  450POINT X%,Y%
  460UNTIL INKEY(-99)
  470REPEAT
  480A$=GET$
  490UNTIL A$<>" "
  500IF A$="S" OR A$="s" THEN *SCREENSAVE PLOT
  510ENDPROC
  520
  530DEF PROC_Init
  540FOR A%=0 TO 3 STEP 3
  550P%=CODE%
  560[
  570OPT A%
  580.TM  EQUD 0  \ 1mS timer count 7 weeks before overflow
  590.TL  EQUD 0  \ Timer value at last drip
  600.TD  EQUD 0  \ Time between drips
  610.TB  EQUD 0  \ Time for last drip
  620.CNT EQUD 0  \ Flag indicating new drip time
  630.TV  EQUD 0  \ Overflow of timers
  640.ISR
  650MOV R2,#&50000 \ Address of printer latch
  660ADD R2,R2,R3
  670MOV R1,#0     \ Printer bits low
  680STR R1,[R2,#&10]
  690
  700MOV R0,#&10 \ IRQ from BUSY
  710.HTS
  720LDR R1,[R0,R3] \ GET REQUEST
  730ANDS R1,R1,#1 \ TEST BIT 0
  740BNE HTS \ Hold till interrupt has stopped
  750MOV R1,#&10000 \ Put bit 0 high again
  760STR R1,[R2,#&10]
  770
  780LDR R0,[R12,#-16] \ GET CURRENT TIME
  790LDR R1,[R12,#-12]  \ GET LAST TIME
  800SUB R2,R0,R1      \ Work out differance
  810CMP R2,#10      \ Test for double drip
  820BCC EXIT
  830
  840LDR R1,[R12,#-8] \Move last interval
  850STR R1,[R12,#-4]
  860
  870MOV R2,R2,ASL #2
  880STR R2,[R12,#-8]
  890STR R0,[R12,#-12]  \ New last time
  900
  910LDR R0,[R12]     \ Increment count
  920ADD R0,R0,#1
  930STR R0,[R12]
  940
  950.EXIT
  960MOV PC,R14 \ Back to BASIC
  970
  980.TREQ \ IRQ from timer
  990MOV R0,#&40  \ Clear T1 interrupt
 1000STRB R0,[R3,#&14]
 1010LDR R0,[R12] \ Increment TM
 1020ADD R0,R0,#1
 1030STR R0,[R12]
 1040MOV PC,R14 \ Back to BASIC
 1050
 1060.ENAB  \ Enable the interrupts from BUSY and T1
 1070STMFD R13!,{R14}
 1080MOV R9,R15
 1090SWI "OS_EnterOS"
 1100MOVNV R0,R0        \ JUST DELAY
 1110MOV R0, #&3200000   \ BASE ADDRESS OF IOC
 1120MOV R1,#&50000     \ OFFSET TO PRINTER LATCH
 1130ADD R1,R1,R0
 1140MOV R2,#&10000    \ Bit 0 high
 1150STR R2,[R1,#&10]
 1160
 1170LDRB R1,[R0,#&18]    \ Get interrupt mask
 1180ORR R1,R1,#&41       \ Set bit 6 & 0
 1190STRB R1,[R0,#&18]
 1200MOV R1,#&D0         \ Set timer values FOR 1mS interval
 1210STRB R1,[R0,#&50]  \ Low value
 1220MOV R1,#&7
 1230STRB R1,[R0,#&54]  \ Hi value
 1240
 1250\PREPARE TO EXIT
 1260TEQP R9,#0
 1270MOVNV R0,R0
 1280LDMFD R13!, {PC} \ BACK FROM WHENST YOU CAME
 1290
 1300.DISAB  \ Disable the interrupts from BUSY and T1
 1310STMFD R13!,{R14}
 1320MOV R9,R15
 1330SWI "OS_EnterOS"
 1340MOVNV R0,R0        \ JUST DELAY
 1350MOV R0, #&3200000   \ BASE ADDRESS OF IOC
 1360LDRB R1,[R0,#&18]    \ Get interrupt mask
 1370AND R1,R1,#&FE       \ Clear bit 6 & 0
 1380STRB R1,[R0,#&18]
 1390
 1400\PREPARE TO EXIT
 1410TEQP R9,#0
 1420MOVNV R0,R0
 1430LDMFD R13!, {PC} \ BACK FROM WHENST YOU CAME
 1440]
 1450
 1460NEXT
 1470ENDPROC
 1480
 1490DEF PROC_Claim
 1500SYS"OS_ClaimDeviceVector",0,ISR,CNT
 1510SYS"OS_ClaimDeviceVector",6,TREQ,TM
 1520CALL ENAB
 1530ENDPROC
 1540
 1550DEF PROC_RELEASE
 1560REPORT:PRINT" at line ";ERL
 1570CALL DISAB
 1580SYS"OS_ReleaseDeviceVector",0,ISR,CNT
 1590SYS"OS_ReleaseDeviceVector",6,TREQ,TM
 1600END
 1610ENDPROC
 1620
 1630DEF PROC_AXIS
 1640LOCAL XA%,LA%,M%
 1650MODE 12
 1660VDU 5
 1670LA%=40
 1680LINE 0,LA%,1280,LA%
 1690LINE LA%,0,LA%,1024
 1700XA%=100
 1710REPEAT
 1720LINE XA%,LA%,XA%,LA%-10
 1730LINE LA%,XA%,LA%-10,XA%
 1740MOVE XA%-16,24
 1750PRINT ;XA%/4;
 1760XA%+=100
 1770UNTIL XA%>1280
 1780VDU 4
 1790VDU 28,0,31,1,10
 1800PRINT"T i m e   i n   m S"
 1810VDU 28,0,31,79,0
 1820PRINT TAB(20,0)" Drip Plot in Phase Space by Mike Cook"
 1830ENDPROC


�>Drip
� Chaos from a drip
4� Use the interrupt from the printer to time the
(� interval between drips
2� CODE% 300
<
�_Init
F"�"Drip detection test program"
P�"Escape to quit"
Z�"Count  Time (mS)"
d� � �_RELEASE
n�_Claim
xLC=0
��
��
�#�"Body Build Phase Space Timer"
��"by Mike Cook"
�8�"You need the special hardware deiscribed in the:-"
�*�"August 94 issue of Acorn Computing."
�2�:�"Press space bar to get back to this page."
�A�"In Plot mode press S after space to save the plot to disc,"
� �"any other key not to save"
��:�"Test mode or Plot mode"
��"ENTER T OR P"
�A$=�
�� A$="T" � A$="t" � �_TEST
� A$="P" � A$="p" � �_PLOT
� �

"� �_TEST
,�"Test Mode"
6�
@!� !CNT<>LC � LC=!CNT:� LC,!TD
J� �(-99)
T�
^
h� �_PLOT
r� X%,Y%
|
�_AXIS
�
��
�LC=!CNT
�� �(LC<>!CNT � �(-99))
�X%=!TD:Y%=!TB
�� 0,�X%,Y%)+1
�Ȓ X%,Y%
�� �(-99)
��
�A$=�
�
� A$<>" "
�(� A$="S" � A$="s" � *SCREENSAVE PLOT
��

� �_Init
� A%=0 � 3 � 3
&P%=CODE%
0[
:
OPT A%
D:.TM  EQUD 0  \ 1mS timer count 7 weeks before overflow
N+.TL  EQUD 0  \ Timer value at last drip
X%.TD  EQUD 0  \ Time between drips
b%.TB  EQUD 0  \ Time for last drip
l0.CNT EQUD 0  \ Flag indicating new drip time
v%.TV  EQUD 0  \ Overflow of timers
�.ISR
�-MOV R2,#&50000 \ Address of printer latch
�ADD R2,R2,R3
�$MOV R1,#0     \ Printer bits low
�STR R1,[R2,#&10]
�
�MOV R0,#&10 \ IRQ from BUSY
�.HTS
�LDR R1,[R0,R3] \ � REQUEST
��S R1,R1,#1 \ TEST BIT 0
�-BNE HTS \ Hold till interrupt has stopped
�)MOV R1,#&10000 \ Put bit 0 high again
�STR R1,[R2,#&10]

#LDR R0,[R12,#-16] \ � CURRENT �
!LDR R1,[R12,#-12]  \ � LAST �
 +SUB R2,R0,R1      \ Work out differance
**CMP R2,#10      \ Test for double drip
4BCC EXIT
>
H(LDR R1,[R12,#-8] \Move last interval
RSTR R1,[R12,#-4]
\
fMOV R2,R2,ASL #2
pSTR R2,[R12,#-8]
z&STR R0,[R12,#-12]  \ New last time
�
�&LDR R0,[R12]     \ Increment count
�ADD R0,R0,#1
�STR R0,[R12]
�
�	.EXIT
�MOV PC,R14 \ Back to BASIC
�
�.TREQ \ IRQ from timer
�%MOV R0,#&40  \ Clear T1 interrupt
�STRB R0,[R3,#&14]
�LDR R0,[R12] \ Increment TM
�ADD R0,R0,#1
STR R0,[R12]
MOV PC,R14 \ Back to BASIC

$3.ENAB  \ Enable the interrupts from BUSY and T1
.STMFD R13!,{R14}
8MOV R9,R15
BSWI "OS_EnterOS"
L#MOVNV R0,R0        \ JUST DELAY
V,MOV R0, #&3200000   \ BASE ADDRESS � IOC
`)MOV R1,#&50000     \ �SET � �ER LATCH
jADD R1,R1,R0
t"MOV R2,#&10000    \ Bit 0 high
~STR R2,[R1,#&10]
�
�-LDRB R1,[R0,#&18]    \ Get interrupt mask
�'�R R1,R1,#&41       \ Set bit 6 & 0
�STRB R1,[R0,#&18]
�9MOV R1,#&D0         \ Set timer values � 1mS interval
�"STRB R1,[R0,#&50]  \ Low value
�MOV R1,#&7
�!STRB R1,[R0,#&54]  \ Hi value
�
�\PREPARE � EXIT
�TEQP R9,#0
�MOVNV R0,R0
-LDMFD R13!, {PC} \ BACK FROM �ST YOU CAME


5.DISAB  \ Disable the interrupts from BUSY and T1
STMFD R13!,{R14}
(MOV R9,R15
2SWI "OS_EnterOS"
<#MOVNV R0,R0        \ JUST DELAY
F,MOV R0, #&3200000   \ BASE ADDRESS � IOC
P-LDRB R1,[R0,#&18]    \ Get interrupt mask
Z(� R1,R1,#&FE       \ Clear bit 6 & 0
dSTRB R1,[R0,#&18]
n
x\PREPARE � EXIT
�TEQP R9,#0
�MOVNV R0,R0
�-LDMFD R13!, {PC} \ BACK FROM �ST YOU CAME
�]
�
��
��
�
�
� �_Claim
�&ș"OS_ClaimDeviceVector",0,ISR,CNT
�&ș"OS_ClaimDeviceVector",6,TREQ,TM
�
� ENAB
��

� �_RELEASE
�:�" at line ";�
"� DISAB
,(ș"OS_ReleaseDeviceVector",0,ISR,CNT
6(ș"OS_ReleaseDeviceVector",6,TREQ,TM
@�
J�
T
^� �_AXIS
h� XA%,LA%,M%
r� 12
|� 5
�
LA%=40
�� 0,LA%,1280,LA%
�� LA%,0,LA%,1024
�XA%=100
��
�� XA%,LA%,XA%,LA%-10
�� LA%,XA%,LA%-10,XA%
�� XA%-16,24
�
� ;XA%/4;
�XA%+=100
�� XA%>1280
�� 4
�� 28,0,31,1,10
�"T i m e   i n   m S"
� 28,0,31,79,0
4� �20,0)" Drip Plot in Phase Space by Mike Cook"
&�
�
00000000  0d 00 0a 0a f4 3e 44 72  69 70 0d 00 14 17 f4 20  |.....>Drip..... |
00000010  43 68 61 6f 73 20 66 72  6f 6d 20 61 20 64 72 69  |Chaos from a dri|
00000020  70 0d 00 1e 34 f4 20 55  73 65 20 74 68 65 20 69  |p...4. Use the i|
00000030  6e 74 65 72 72 75 70 74  20 66 72 6f 6d 20 74 68  |nterrupt from th|
00000040  65 20 70 72 69 6e 74 65  72 20 74 6f 20 74 69 6d  |e printer to tim|
00000050  65 20 74 68 65 0d 00 28  1c f4 20 69 6e 74 65 72  |e the..(.. inter|
00000060  76 61 6c 20 62 65 74 77  65 65 6e 20 64 72 69 70  |val between drip|
00000070  73 0d 00 32 0f de 20 43  4f 44 45 25 20 33 30 30  |s..2.. CODE% 300|
00000080  0d 00 3c 0a f2 5f 49 6e  69 74 0d 00 46 22 f1 22  |..<.._Init..F"."|
00000090  44 72 69 70 20 64 65 74  65 63 74 69 6f 6e 20 74  |Drip detection t|
000000a0  65 73 74 20 70 72 6f 67  72 61 6d 22 0d 00 50 15  |est program"..P.|
000000b0  f1 22 45 73 63 61 70 65  20 74 6f 20 71 75 69 74  |."Escape to quit|
000000c0  22 0d 00 5a 17 f1 22 43  6f 75 6e 74 20 20 54 69  |"..Z.."Count  Ti|
000000d0  6d 65 20 28 6d 53 29 22  0d 00 64 11 ee 20 85 20  |me (mS)"..d.. . |
000000e0  f2 5f 52 45 4c 45 41 53  45 0d 00 6e 0b f2 5f 43  |._RELEASE..n.._C|
000000f0  6c 61 69 6d 0d 00 78 08  4c 43 3d 30 0d 00 82 05  |laim..x.LC=0....|
00000100  f5 0d 00 8c 05 db 0d 00  96 23 f1 22 42 6f 64 79  |.........#."Body|
00000110  20 42 75 69 6c 64 20 50  68 61 73 65 20 53 70 61  | Build Phase Spa|
00000120  63 65 20 54 69 6d 65 72  22 0d 00 a0 13 f1 22 62  |ce Timer"....."b|
00000130  79 20 4d 69 6b 65 20 43  6f 6f 6b 22 0d 00 aa 38  |y Mike Cook"...8|
00000140  f1 22 59 6f 75 20 6e 65  65 64 20 74 68 65 20 73  |."You need the s|
00000150  70 65 63 69 61 6c 20 68  61 72 64 77 61 72 65 20  |pecial hardware |
00000160  64 65 69 73 63 72 69 62  65 64 20 69 6e 20 74 68  |deiscribed in th|
00000170  65 3a 2d 22 0d 00 b4 2a  f1 22 41 75 67 75 73 74  |e:-"...*."August|
00000180  20 39 34 20 69 73 73 75  65 20 6f 66 20 41 63 6f  | 94 issue of Aco|
00000190  72 6e 20 43 6f 6d 70 75  74 69 6e 67 2e 22 0d 00  |rn Computing."..|
000001a0  be 32 f1 3a f1 22 50 72  65 73 73 20 73 70 61 63  |.2.:."Press spac|
000001b0  65 20 62 61 72 20 74 6f  20 67 65 74 20 62 61 63  |e bar to get bac|
000001c0  6b 20 74 6f 20 74 68 69  73 20 70 61 67 65 2e 22  |k to this page."|
000001d0  0d 00 c8 41 f1 22 49 6e  20 50 6c 6f 74 20 6d 6f  |...A."In Plot mo|
000001e0  64 65 20 70 72 65 73 73  20 53 20 61 66 74 65 72  |de press S after|
000001f0  20 73 70 61 63 65 20 74  6f 20 73 61 76 65 20 74  | space to save t|
00000200  68 65 20 70 6c 6f 74 20  74 6f 20 64 69 73 63 2c  |he plot to disc,|
00000210  22 0d 00 d2 20 f1 22 61  6e 79 20 6f 74 68 65 72  |"... ."any other|
00000220  20 6b 65 79 20 6e 6f 74  20 74 6f 20 73 61 76 65  | key not to save|
00000230  22 0d 00 dc 1f f1 3a f1  22 54 65 73 74 20 6d 6f  |".....:."Test mo|
00000240  64 65 20 6f 72 20 50 6c  6f 74 20 6d 6f 64 65 22  |de or Plot mode"|
00000250  0d 00 e6 13 f1 22 45 4e  54 45 52 20 54 20 4f 52  |....."ENTER T OR|
00000260  20 50 22 0d 00 f0 08 41  24 3d be 0d 00 fa 1e e7  | P"....A$=......|
00000270  20 41 24 3d 22 54 22 20  84 20 41 24 3d 22 74 22  | A$="T" . A$="t"|
00000280  20 8c 20 f2 5f 54 45 53  54 0d 01 04 1e e7 20 41  | . ._TEST..... A|
00000290  24 3d 22 50 22 20 84 20  41 24 3d 22 70 22 20 8c  |$="P" . A$="p" .|
000002a0  20 f2 5f 50 4c 4f 54 0d  01 0e 07 fd 20 a3 0d 01  | ._PLOT..... ...|
000002b0  18 04 0d 01 22 0c dd 20  f2 5f 54 45 53 54 0d 01  |....".. ._TEST..|
000002c0  2c 10 f1 22 54 65 73 74  20 4d 6f 64 65 22 0d 01  |,.."Test Mode"..|
000002d0  36 05 f5 0d 01 40 21 e7  20 21 43 4e 54 3c 3e 4c  |6....@!. !CNT<>L|
000002e0  43 20 8c 20 4c 43 3d 21  43 4e 54 3a f1 20 4c 43  |C . LC=!CNT:. LC|
000002f0  2c 21 54 44 0d 01 4a 0c  fd 20 a6 28 2d 39 39 29  |,!TD..J.. .(-99)|
00000300  0d 01 54 05 e1 0d 01 5e  04 0d 01 68 0c dd 20 f2  |..T....^...h.. .|
00000310  5f 50 4c 4f 54 0d 01 72  0b ea 20 58 25 2c 59 25  |_PLOT..r.. X%,Y%|
00000320  0d 01 7c 0a f2 5f 41 58  49 53 0d 01 86 04 0d 01  |..|.._AXIS......|
00000330  90 05 f5 0d 01 9a 0b 4c  43 3d 21 43 4e 54 0d 01  |.......LC=!CNT..|
00000340  a4 1a f5 20 fd 28 4c 43  3c 3e 21 43 4e 54 20 84  |... .(LC<>!CNT .|
00000350  20 a6 28 2d 39 39 29 29  0d 01 ae 11 58 25 3d 21  | .(-99))....X%=!|
00000360  54 44 3a 59 25 3d 21 54  42 0d 01 b8 11 e6 20 30  |TD:Y%=!TB..... 0|
00000370  2c b0 58 25 2c 59 25 29  2b 31 0d 01 c2 0c c8 92  |,.X%,Y%)+1......|
00000380  20 58 25 2c 59 25 0d 01  cc 0c fd 20 a6 28 2d 39  | X%,Y%..... .(-9|
00000390  39 29 0d 01 d6 05 f5 0d  01 e0 08 41 24 3d be 0d  |9).........A$=..|
000003a0  01 ea 0d fd 20 41 24 3c  3e 22 20 22 0d 01 f4 28  |.... A$<>" "...(|
000003b0  e7 20 41 24 3d 22 53 22  20 84 20 41 24 3d 22 73  |. A$="S" . A$="s|
000003c0  22 20 8c 20 2a 53 43 52  45 45 4e 53 41 56 45 20  |" . *SCREENSAVE |
000003d0  50 4c 4f 54 0d 01 fe 05  e1 0d 02 08 04 0d 02 12  |PLOT............|
000003e0  0c dd 20 f2 5f 49 6e 69  74 0d 02 1c 12 e3 20 41  |.. ._Init..... A|
000003f0  25 3d 30 20 b8 20 33 20  88 20 33 0d 02 26 0c 50  |%=0 . 3 . 3..&.P|
00000400  25 3d 43 4f 44 45 25 0d  02 30 05 5b 0d 02 3a 0a  |%=CODE%..0.[..:.|
00000410  4f 50 54 20 41 25 0d 02  44 3a 2e 54 4d 20 20 45  |OPT A%..D:.TM  E|
00000420  51 55 44 20 30 20 20 5c  20 31 6d 53 20 74 69 6d  |QUD 0  \ 1mS tim|
00000430  65 72 20 63 6f 75 6e 74  20 37 20 77 65 65 6b 73  |er count 7 weeks|
00000440  20 62 65 66 6f 72 65 20  6f 76 65 72 66 6c 6f 77  | before overflow|
00000450  0d 02 4e 2b 2e 54 4c 20  20 45 51 55 44 20 30 20  |..N+.TL  EQUD 0 |
00000460  20 5c 20 54 69 6d 65 72  20 76 61 6c 75 65 20 61  | \ Timer value a|
00000470  74 20 6c 61 73 74 20 64  72 69 70 0d 02 58 25 2e  |t last drip..X%.|
00000480  54 44 20 20 45 51 55 44  20 30 20 20 5c 20 54 69  |TD  EQUD 0  \ Ti|
00000490  6d 65 20 62 65 74 77 65  65 6e 20 64 72 69 70 73  |me between drips|
000004a0  0d 02 62 25 2e 54 42 20  20 45 51 55 44 20 30 20  |..b%.TB  EQUD 0 |
000004b0  20 5c 20 54 69 6d 65 20  66 6f 72 20 6c 61 73 74  | \ Time for last|
000004c0  20 64 72 69 70 0d 02 6c  30 2e 43 4e 54 20 45 51  | drip..l0.CNT EQ|
000004d0  55 44 20 30 20 20 5c 20  46 6c 61 67 20 69 6e 64  |UD 0  \ Flag ind|
000004e0  69 63 61 74 69 6e 67 20  6e 65 77 20 64 72 69 70  |icating new drip|
000004f0  20 74 69 6d 65 0d 02 76  25 2e 54 56 20 20 45 51  | time..v%.TV  EQ|
00000500  55 44 20 30 20 20 5c 20  4f 76 65 72 66 6c 6f 77  |UD 0  \ Overflow|
00000510  20 6f 66 20 74 69 6d 65  72 73 0d 02 80 08 2e 49  | of timers.....I|
00000520  53 52 0d 02 8a 2d 4d 4f  56 20 52 32 2c 23 26 35  |SR...-MOV R2,#&5|
00000530  30 30 30 30 20 5c 20 41  64 64 72 65 73 73 20 6f  |0000 \ Address o|
00000540  66 20 70 72 69 6e 74 65  72 20 6c 61 74 63 68 0d  |f printer latch.|
00000550  02 94 10 41 44 44 20 52  32 2c 52 32 2c 52 33 0d  |...ADD R2,R2,R3.|
00000560  02 9e 24 4d 4f 56 20 52  31 2c 23 30 20 20 20 20  |..$MOV R1,#0    |
00000570  20 5c 20 50 72 69 6e 74  65 72 20 62 69 74 73 20  | \ Printer bits |
00000580  6c 6f 77 0d 02 a8 14 53  54 52 20 52 31 2c 5b 52  |low....STR R1,[R|
00000590  32 2c 23 26 31 30 5d 0d  02 b2 04 0d 02 bc 1f 4d  |2,#&10]........M|
000005a0  4f 56 20 52 30 2c 23 26  31 30 20 5c 20 49 52 51  |OV R0,#&10 \ IRQ|
000005b0  20 66 72 6f 6d 20 42 55  53 59 0d 02 c6 08 2e 48  | from BUSY.....H|
000005c0  54 53 0d 02 d0 1e 4c 44  52 20 52 31 2c 5b 52 30  |TS....LDR R1,[R0|
000005d0  2c 52 33 5d 20 5c 20 a5  20 52 45 51 55 45 53 54  |,R3] \ . REQUEST|
000005e0  0d 02 da 1c 80 53 20 52  31 2c 52 31 2c 23 31 20  |.....S R1,R1,#1 |
000005f0  5c 20 54 45 53 54 20 42  49 54 20 30 0d 02 e4 2d  |\ TEST BIT 0...-|
00000600  42 4e 45 20 48 54 53 20  5c 20 48 6f 6c 64 20 74  |BNE HTS \ Hold t|
00000610  69 6c 6c 20 69 6e 74 65  72 72 75 70 74 20 68 61  |ill interrupt ha|
00000620  73 20 73 74 6f 70 70 65  64 0d 02 ee 29 4d 4f 56  |s stopped...)MOV|
00000630  20 52 31 2c 23 26 31 30  30 30 30 20 5c 20 50 75  | R1,#&10000 \ Pu|
00000640  74 20 62 69 74 20 30 20  68 69 67 68 20 61 67 61  |t bit 0 high aga|
00000650  69 6e 0d 02 f8 14 53 54  52 20 52 31 2c 5b 52 32  |in....STR R1,[R2|
00000660  2c 23 26 31 30 5d 0d 03  02 04 0d 03 0c 23 4c 44  |,#&10].......#LD|
00000670  52 20 52 30 2c 5b 52 31  32 2c 23 2d 31 36 5d 20  |R R0,[R12,#-16] |
00000680  5c 20 a5 20 43 55 52 52  45 4e 54 20 91 0d 03 16  |\ . CURRENT ....|
00000690  21 4c 44 52 20 52 31 2c  5b 52 31 32 2c 23 2d 31  |!LDR R1,[R12,#-1|
000006a0  32 5d 20 20 5c 20 a5 20  4c 41 53 54 20 91 0d 03  |2]  \ . LAST ...|
000006b0  20 2b 53 55 42 20 52 32  2c 52 30 2c 52 31 20 20  | +SUB R2,R0,R1  |
000006c0  20 20 20 20 5c 20 57 6f  72 6b 20 6f 75 74 20 64  |    \ Work out d|
000006d0  69 66 66 65 72 61 6e 63  65 0d 03 2a 2a 43 4d 50  |ifferance..**CMP|
000006e0  20 52 32 2c 23 31 30 20  20 20 20 20 20 5c 20 54  | R2,#10      \ T|
000006f0  65 73 74 20 66 6f 72 20  64 6f 75 62 6c 65 20 64  |est for double d|
00000700  72 69 70 0d 03 34 0c 42  43 43 20 45 58 49 54 0d  |rip..4.BCC EXIT.|
00000710  03 3e 04 0d 03 48 28 4c  44 52 20 52 31 2c 5b 52  |.>...H(LDR R1,[R|
00000720  31 32 2c 23 2d 38 5d 20  5c 4d 6f 76 65 20 6c 61  |12,#-8] \Move la|
00000730  73 74 20 69 6e 74 65 72  76 61 6c 0d 03 52 14 53  |st interval..R.S|
00000740  54 52 20 52 31 2c 5b 52  31 32 2c 23 2d 34 5d 0d  |TR R1,[R12,#-4].|
00000750  03 5c 04 0d 03 66 14 4d  4f 56 20 52 32 2c 52 32  |.\...f.MOV R2,R2|
00000760  2c 41 53 4c 20 23 32 0d  03 70 14 53 54 52 20 52  |,ASL #2..p.STR R|
00000770  32 2c 5b 52 31 32 2c 23  2d 38 5d 0d 03 7a 26 53  |2,[R12,#-8]..z&S|
00000780  54 52 20 52 30 2c 5b 52  31 32 2c 23 2d 31 32 5d  |TR R0,[R12,#-12]|
00000790  20 20 5c 20 4e 65 77 20  6c 61 73 74 20 74 69 6d  |  \ New last tim|
000007a0  65 0d 03 84 04 0d 03 8e  26 4c 44 52 20 52 30 2c  |e.......&LDR R0,|
000007b0  5b 52 31 32 5d 20 20 20  20 20 5c 20 49 6e 63 72  |[R12]     \ Incr|
000007c0  65 6d 65 6e 74 20 63 6f  75 6e 74 0d 03 98 10 41  |ement count....A|
000007d0  44 44 20 52 30 2c 52 30  2c 23 31 0d 03 a2 10 53  |DD R0,R0,#1....S|
000007e0  54 52 20 52 30 2c 5b 52  31 32 5d 0d 03 ac 04 0d  |TR R0,[R12].....|
000007f0  03 b6 09 2e 45 58 49 54  0d 03 c0 1e 4d 4f 56 20  |....EXIT....MOV |
00000800  50 43 2c 52 31 34 20 5c  20 42 61 63 6b 20 74 6f  |PC,R14 \ Back to|
00000810  20 42 41 53 49 43 0d 03  ca 04 0d 03 d4 1a 2e 54  | BASIC.........T|
00000820  52 45 51 20 5c 20 49 52  51 20 66 72 6f 6d 20 74  |REQ \ IRQ from t|
00000830  69 6d 65 72 0d 03 de 25  4d 4f 56 20 52 30 2c 23  |imer...%MOV R0,#|
00000840  26 34 30 20 20 5c 20 43  6c 65 61 72 20 54 31 20  |&40  \ Clear T1 |
00000850  69 6e 74 65 72 72 75 70  74 0d 03 e8 15 53 54 52  |interrupt....STR|
00000860  42 20 52 30 2c 5b 52 33  2c 23 26 31 34 5d 0d 03  |B R0,[R3,#&14]..|
00000870  f2 1f 4c 44 52 20 52 30  2c 5b 52 31 32 5d 20 5c  |..LDR R0,[R12] \|
00000880  20 49 6e 63 72 65 6d 65  6e 74 20 54 4d 0d 03 fc  | Increment TM...|
00000890  10 41 44 44 20 52 30 2c  52 30 2c 23 31 0d 04 06  |.ADD R0,R0,#1...|
000008a0  10 53 54 52 20 52 30 2c  5b 52 31 32 5d 0d 04 10  |.STR R0,[R12]...|
000008b0  1e 4d 4f 56 20 50 43 2c  52 31 34 20 5c 20 42 61  |.MOV PC,R14 \ Ba|
000008c0  63 6b 20 74 6f 20 42 41  53 49 43 0d 04 1a 04 0d  |ck to BASIC.....|
000008d0  04 24 33 2e 45 4e 41 42  20 20 5c 20 45 6e 61 62  |.$3.ENAB  \ Enab|
000008e0  6c 65 20 74 68 65 20 69  6e 74 65 72 72 75 70 74  |le the interrupt|
000008f0  73 20 66 72 6f 6d 20 42  55 53 59 20 61 6e 64 20  |s from BUSY and |
00000900  54 31 0d 04 2e 14 53 54  4d 46 44 20 52 31 33 21  |T1....STMFD R13!|
00000910  2c 7b 52 31 34 7d 0d 04  38 0e 4d 4f 56 20 52 39  |,{R14}..8.MOV R9|
00000920  2c 52 31 35 0d 04 42 14  53 57 49 20 22 4f 53 5f  |,R15..B.SWI "OS_|
00000930  45 6e 74 65 72 4f 53 22  0d 04 4c 23 4d 4f 56 4e  |EnterOS"..L#MOVN|
00000940  56 20 52 30 2c 52 30 20  20 20 20 20 20 20 20 5c  |V R0,R0        \|
00000950  20 4a 55 53 54 20 44 45  4c 41 59 0d 04 56 2c 4d  | JUST DELAY..V,M|
00000960  4f 56 20 52 30 2c 20 23  26 33 32 30 30 30 30 30  |OV R0, #&3200000|
00000970  20 20 20 5c 20 42 41 53  45 20 41 44 44 52 45 53  |   \ BASE ADDRES|
00000980  53 20 ca 20 49 4f 43 0d  04 60 29 4d 4f 56 20 52  |S . IOC..`)MOV R|
00000990  31 2c 23 26 35 30 30 30  30 20 20 20 20 20 5c 20  |1,#&50000     \ |
000009a0  87 53 45 54 20 b8 20 f1  45 52 20 4c 41 54 43 48  |.SET . .ER LATCH|
000009b0  0d 04 6a 10 41 44 44 20  52 31 2c 52 31 2c 52 30  |..j.ADD R1,R1,R0|
000009c0  0d 04 74 22 4d 4f 56 20  52 32 2c 23 26 31 30 30  |..t"MOV R2,#&100|
000009d0  30 30 20 20 20 20 5c 20  42 69 74 20 30 20 68 69  |00    \ Bit 0 hi|
000009e0  67 68 0d 04 7e 14 53 54  52 20 52 32 2c 5b 52 31  |gh..~.STR R2,[R1|
000009f0  2c 23 26 31 30 5d 0d 04  88 04 0d 04 92 2d 4c 44  |,#&10].......-LD|
00000a00  52 42 20 52 31 2c 5b 52  30 2c 23 26 31 38 5d 20  |RB R1,[R0,#&18] |
00000a10  20 20 20 5c 20 47 65 74  20 69 6e 74 65 72 72 75  |   \ Get interru|
00000a20  70 74 20 6d 61 73 6b 0d  04 9c 27 84 52 20 52 31  |pt mask...'.R R1|
00000a30  2c 52 31 2c 23 26 34 31  20 20 20 20 20 20 20 5c  |,R1,#&41       \|
00000a40  20 53 65 74 20 62 69 74  20 36 20 26 20 30 0d 04  | Set bit 6 & 0..|
00000a50  a6 15 53 54 52 42 20 52  31 2c 5b 52 30 2c 23 26  |..STRB R1,[R0,#&|
00000a60  31 38 5d 0d 04 b0 39 4d  4f 56 20 52 31 2c 23 26  |18]...9MOV R1,#&|
00000a70  44 30 20 20 20 20 20 20  20 20 20 5c 20 53 65 74  |D0         \ Set|
00000a80  20 74 69 6d 65 72 20 76  61 6c 75 65 73 20 e3 20  | timer values . |
00000a90  31 6d 53 20 69 6e 74 65  72 76 61 6c 0d 04 ba 22  |1mS interval..."|
00000aa0  53 54 52 42 20 52 31 2c  5b 52 30 2c 23 26 35 30  |STRB R1,[R0,#&50|
00000ab0  5d 20 20 5c 20 4c 6f 77  20 76 61 6c 75 65 0d 04  |]  \ Low value..|
00000ac0  c4 0e 4d 4f 56 20 52 31  2c 23 26 37 0d 04 ce 21  |..MOV R1,#&7...!|
00000ad0  53 54 52 42 20 52 31 2c  5b 52 30 2c 23 26 35 34  |STRB R1,[R0,#&54|
00000ae0  5d 20 20 5c 20 48 69 20  76 61 6c 75 65 0d 04 d8  |]  \ Hi value...|
00000af0  04 0d 04 e2 13 5c 50 52  45 50 41 52 45 20 b8 20  |.....\PREPARE . |
00000b00  45 58 49 54 0d 04 ec 0e  54 45 51 50 20 52 39 2c  |EXIT....TEQP R9,|
00000b10  23 30 0d 04 f6 0f 4d 4f  56 4e 56 20 52 30 2c 52  |#0....MOVNV R0,R|
00000b20  30 0d 05 00 2d 4c 44 4d  46 44 20 52 31 33 21 2c  |0...-LDMFD R13!,|
00000b30  20 7b 50 43 7d 20 5c 20  42 41 43 4b 20 46 52 4f  | {PC} \ BACK FRO|
00000b40  4d 20 c9 53 54 20 59 4f  55 20 43 41 4d 45 0d 05  |M .ST YOU CAME..|
00000b50  0a 04 0d 05 14 35 2e 44  49 53 41 42 20 20 5c 20  |.....5.DISAB  \ |
00000b60  44 69 73 61 62 6c 65 20  74 68 65 20 69 6e 74 65  |Disable the inte|
00000b70  72 72 75 70 74 73 20 66  72 6f 6d 20 42 55 53 59  |rrupts from BUSY|
00000b80  20 61 6e 64 20 54 31 0d  05 1e 14 53 54 4d 46 44  | and T1....STMFD|
00000b90  20 52 31 33 21 2c 7b 52  31 34 7d 0d 05 28 0e 4d  | R13!,{R14}..(.M|
00000ba0  4f 56 20 52 39 2c 52 31  35 0d 05 32 14 53 57 49  |OV R9,R15..2.SWI|
00000bb0  20 22 4f 53 5f 45 6e 74  65 72 4f 53 22 0d 05 3c  | "OS_EnterOS"..<|
00000bc0  23 4d 4f 56 4e 56 20 52  30 2c 52 30 20 20 20 20  |#MOVNV R0,R0    |
00000bd0  20 20 20 20 5c 20 4a 55  53 54 20 44 45 4c 41 59  |    \ JUST DELAY|
00000be0  0d 05 46 2c 4d 4f 56 20  52 30 2c 20 23 26 33 32  |..F,MOV R0, #&32|
00000bf0  30 30 30 30 30 20 20 20  5c 20 42 41 53 45 20 41  |00000   \ BASE A|
00000c00  44 44 52 45 53 53 20 ca  20 49 4f 43 0d 05 50 2d  |DDRESS . IOC..P-|
00000c10  4c 44 52 42 20 52 31 2c  5b 52 30 2c 23 26 31 38  |LDRB R1,[R0,#&18|
00000c20  5d 20 20 20 20 5c 20 47  65 74 20 69 6e 74 65 72  |]    \ Get inter|
00000c30  72 75 70 74 20 6d 61 73  6b 0d 05 5a 28 80 20 52  |rupt mask..Z(. R|
00000c40  31 2c 52 31 2c 23 26 46  45 20 20 20 20 20 20 20  |1,R1,#&FE       |
00000c50  5c 20 43 6c 65 61 72 20  62 69 74 20 36 20 26 20  |\ Clear bit 6 & |
00000c60  30 0d 05 64 15 53 54 52  42 20 52 31 2c 5b 52 30  |0..d.STRB R1,[R0|
00000c70  2c 23 26 31 38 5d 0d 05  6e 04 0d 05 78 13 5c 50  |,#&18]..n...x.\P|
00000c80  52 45 50 41 52 45 20 b8  20 45 58 49 54 0d 05 82  |REPARE . EXIT...|
00000c90  0e 54 45 51 50 20 52 39  2c 23 30 0d 05 8c 0f 4d  |.TEQP R9,#0....M|
00000ca0  4f 56 4e 56 20 52 30 2c  52 30 0d 05 96 2d 4c 44  |OVNV R0,R0...-LD|
00000cb0  4d 46 44 20 52 31 33 21  2c 20 7b 50 43 7d 20 5c  |MFD R13!, {PC} \|
00000cc0  20 42 41 43 4b 20 46 52  4f 4d 20 c9 53 54 20 59  | BACK FROM .ST Y|
00000cd0  4f 55 20 43 41 4d 45 0d  05 a0 05 5d 0d 05 aa 04  |OU CAME....]....|
00000ce0  0d 05 b4 05 ed 0d 05 be  05 e1 0d 05 c8 04 0d 05  |................|
00000cf0  d2 0d dd 20 f2 5f 43 6c  61 69 6d 0d 05 dc 26 c8  |... ._Claim...&.|
00000d00  99 22 4f 53 5f 43 6c 61  69 6d 44 65 76 69 63 65  |."OS_ClaimDevice|
00000d10  56 65 63 74 6f 72 22 2c  30 2c 49 53 52 2c 43 4e  |Vector",0,ISR,CN|
00000d20  54 0d 05 e6 26 c8 99 22  4f 53 5f 43 6c 61 69 6d  |T...&.."OS_Claim|
00000d30  44 65 76 69 63 65 56 65  63 74 6f 72 22 2c 36 2c  |DeviceVector",6,|
00000d40  54 52 45 51 2c 54 4d 0d  05 f0 0a d6 20 45 4e 41  |TREQ,TM..... ENA|
00000d50  42 0d 05 fa 05 e1 0d 06  04 04 0d 06 0e 0f dd 20  |B.............. |
00000d60  f2 5f 52 45 4c 45 41 53  45 0d 06 18 14 f6 3a f1  |._RELEASE.....:.|
00000d70  22 20 61 74 20 6c 69 6e  65 20 22 3b 9e 0d 06 22  |" at line ";..."|
00000d80  0b d6 20 44 49 53 41 42  0d 06 2c 28 c8 99 22 4f  |.. DISAB..,(.."O|
00000d90  53 5f 52 65 6c 65 61 73  65 44 65 76 69 63 65 56  |S_ReleaseDeviceV|
00000da0  65 63 74 6f 72 22 2c 30  2c 49 53 52 2c 43 4e 54  |ector",0,ISR,CNT|
00000db0  0d 06 36 28 c8 99 22 4f  53 5f 52 65 6c 65 61 73  |..6(.."OS_Releas|
00000dc0  65 44 65 76 69 63 65 56  65 63 74 6f 72 22 2c 36  |eDeviceVector",6|
00000dd0  2c 54 52 45 51 2c 54 4d  0d 06 40 05 e0 0d 06 4a  |,TREQ,TM..@....J|
00000de0  05 e1 0d 06 54 04 0d 06  5e 0c dd 20 f2 5f 41 58  |....T...^.. ._AX|
00000df0  49 53 0d 06 68 10 ea 20  58 41 25 2c 4c 41 25 2c  |IS..h.. XA%,LA%,|
00000e00  4d 25 0d 06 72 08 eb 20  31 32 0d 06 7c 07 ef 20  |M%..r.. 12..|.. |
00000e10  35 0d 06 86 0a 4c 41 25  3d 34 30 0d 06 90 14 86  |5....LA%=40.....|
00000e20  20 30 2c 4c 41 25 2c 31  32 38 30 2c 4c 41 25 0d  | 0,LA%,1280,LA%.|
00000e30  06 9a 14 86 20 4c 41 25  2c 30 2c 4c 41 25 2c 31  |.... LA%,0,LA%,1|
00000e40  30 32 34 0d 06 a4 0b 58  41 25 3d 31 30 30 0d 06  |024....XA%=100..|
00000e50  ae 05 f5 0d 06 b8 18 86  20 58 41 25 2c 4c 41 25  |........ XA%,LA%|
00000e60  2c 58 41 25 2c 4c 41 25  2d 31 30 0d 06 c2 18 86  |,XA%,LA%-10.....|
00000e70  20 4c 41 25 2c 58 41 25  2c 4c 41 25 2d 31 30 2c  | LA%,XA%,LA%-10,|
00000e80  58 41 25 0d 06 cc 0f ec  20 58 41 25 2d 31 36 2c  |XA%..... XA%-16,|
00000e90  32 34 0d 06 d6 0d f1 20  3b 58 41 25 2f 34 3b 0d  |24..... ;XA%/4;.|
00000ea0  06 e0 0c 58 41 25 2b 3d  31 30 30 0d 06 ea 0e fd  |...XA%+=100.....|
00000eb0  20 58 41 25 3e 31 32 38  30 0d 06 f4 07 ef 20 34  | XA%>1280..... 4|
00000ec0  0d 06 fe 12 ef 20 32 38  2c 30 2c 33 31 2c 31 2c  |..... 28,0,31,1,|
00000ed0  31 30 0d 07 08 1a f1 22  54 20 69 20 6d 20 65 20  |10....."T i m e |
00000ee0  20 20 69 20 6e 20 20 20  6d 20 53 22 0d 07 12 12  |  i n   m S"....|
00000ef0  ef 20 32 38 2c 30 2c 33  31 2c 37 39 2c 30 0d 07  |. 28,0,31,79,0..|
00000f00  1c 34 f1 20 8a 32 30 2c  30 29 22 20 44 72 69 70  |.4. .20,0)" Drip|
00000f10  20 50 6c 6f 74 20 69 6e  20 50 68 61 73 65 20 53  | Plot in Phase S|
00000f20  70 61 63 65 20 62 79 20  4d 69 6b 65 20 43 6f 6f  |pace by Mike Coo|
00000f30  6b 22 0d 07 26 05 e1 0d  ff                       |k"..&....|
00000f39