Home » Archimedes archive » Acorn User » AU 1996-02.adf » Regulars » RuntheRISC/PinTST

RuntheRISC/PinTST

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 1996-02.adf » Regulars
Filename: RuntheRISC/PinTST
Read OK:
File size: 0283 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM>PinTST
   20PRINT"Parallel input test for DVM"
   30PRINT"By Mike Cook"
   40ON ERROR GOTO 300
   50PRINT"Reads the DVM through the printer port"
   60PRINT"Press space to end any other key for a new reading"
   70F%=OPENIN"parallel:"
   80REM Set port to inputs
   90SYS"Parallel_Op",2,&20,&DF
  100REPEAT
  110REM Pulse Run/Hold
  120SYS"Parallel_Op",2,0,&FE
  130SYS"Parallel_Op",2,1,&FE
  140REM Get first digit and sign
  150A%=BGET#F%
  160IF (A% AND &20)=0 THEN V$="-" ELSE V$="+"
  170V$=V$+CHR$((A% AND &F) OR &30)+"."
  180REM Get the next 4 digits
  190FOR C%=1 TO 4
  200A%=BGET#F%
  210B%=(A% AND &F) OR &30
  220V$=V$+CHR$(B%)
  230NEXT
  240PRINTV$;
  250IF (A% AND &80)=0 THEN PRINT ELSE PRINT" Overflow"
  260A$=GET$
  270UNTIL A$=" "
  280CLOSE#F%
  290END
  300REPORT:PRINT" at line ";ERL
  310CLOSE#F%

�>PinTST
"�"Parallel input test for DVM"
�"By Mike Cook"
(� � � �TlA
2-�"Reads the DVM through the printer port"
<9�"Press space to end any other key for a new reading"
FF%=�"parallel:"
P� Set port to inputs
Zș"Parallel_Op",2,&20,&DF
d�
n� Pulse Run/Hold
xș"Parallel_Op",2,0,&FE
�ș"Parallel_Op",2,1,&FE
�� Get first digit and sign
�A%=�#F%
�$� (A% � &20)=0 � V$="-" � V$="+"
� V$=V$+�((A% � &F) � &30)+"."
�� Get the next 4 digits
�� C%=1 � 4
�A%=�#F%
�B%=(A% � &F) � &30
�V$=V$+�(B%)
��
��V$;
�%� (A% � &80)=0 � � � �" Overflow"
A$=�
� A$=" "
�#F%
"�
,�:�" at line ";�
6�#F%
�
00000000  0d 00 0a 0c f4 3e 50 69  6e 54 53 54 0d 00 14 22  |.....>PinTST..."|
00000010  f1 22 50 61 72 61 6c 6c  65 6c 20 69 6e 70 75 74  |."Parallel input|
00000020  20 74 65 73 74 20 66 6f  72 20 44 56 4d 22 0d 00  | test for DVM"..|
00000030  1e 13 f1 22 42 79 20 4d  69 6b 65 20 43 6f 6f 6b  |..."By Mike Cook|
00000040  22 0d 00 28 0e ee 20 85  20 e5 20 8d 54 6c 41 0d  |"..(.. . . .TlA.|
00000050  00 32 2d f1 22 52 65 61  64 73 20 74 68 65 20 44  |.2-."Reads the D|
00000060  56 4d 20 74 68 72 6f 75  67 68 20 74 68 65 20 70  |VM through the p|
00000070  72 69 6e 74 65 72 20 70  6f 72 74 22 0d 00 3c 39  |rinter port"..<9|
00000080  f1 22 50 72 65 73 73 20  73 70 61 63 65 20 74 6f  |."Press space to|
00000090  20 65 6e 64 20 61 6e 79  20 6f 74 68 65 72 20 6b  | end any other k|
000000a0  65 79 20 66 6f 72 20 61  20 6e 65 77 20 72 65 61  |ey for a new rea|
000000b0  64 69 6e 67 22 0d 00 46  13 46 25 3d 8e 22 70 61  |ding"..F.F%=."pa|
000000c0  72 61 6c 6c 65 6c 3a 22  0d 00 50 18 f4 20 53 65  |rallel:"..P.. Se|
000000d0  74 20 70 6f 72 74 20 74  6f 20 69 6e 70 75 74 73  |t port to inputs|
000000e0  0d 00 5a 1d c8 99 22 50  61 72 61 6c 6c 65 6c 5f  |..Z..."Parallel_|
000000f0  4f 70 22 2c 32 2c 26 32  30 2c 26 44 46 0d 00 64  |Op",2,&20,&DF..d|
00000100  05 f5 0d 00 6e 14 f4 20  50 75 6c 73 65 20 52 75  |....n.. Pulse Ru|
00000110  6e 2f 48 6f 6c 64 0d 00  78 1b c8 99 22 50 61 72  |n/Hold..x..."Par|
00000120  61 6c 6c 65 6c 5f 4f 70  22 2c 32 2c 30 2c 26 46  |allel_Op",2,0,&F|
00000130  45 0d 00 82 1b c8 99 22  50 61 72 61 6c 6c 65 6c  |E......"Parallel|
00000140  5f 4f 70 22 2c 32 2c 31  2c 26 46 45 0d 00 8c 1e  |_Op",2,1,&FE....|
00000150  f4 20 47 65 74 20 66 69  72 73 74 20 64 69 67 69  |. Get first digi|
00000160  74 20 61 6e 64 20 73 69  67 6e 0d 00 96 0b 41 25  |t and sign....A%|
00000170  3d 9a 23 46 25 0d 00 a0  24 e7 20 28 41 25 20 80  |=.#F%...$. (A% .|
00000180  20 26 32 30 29 3d 30 20  8c 20 56 24 3d 22 2d 22  | &20)=0 . V$="-"|
00000190  20 8b 20 56 24 3d 22 2b  22 0d 00 aa 20 56 24 3d  | . V$="+"... V$=|
000001a0  56 24 2b bd 28 28 41 25  20 80 20 26 46 29 20 84  |V$+.((A% . &F) .|
000001b0  20 26 33 30 29 2b 22 2e  22 0d 00 b4 1b f4 20 47  | &30)+"."..... G|
000001c0  65 74 20 74 68 65 20 6e  65 78 74 20 34 20 64 69  |et the next 4 di|
000001d0  67 69 74 73 0d 00 be 0e  e3 20 43 25 3d 31 20 b8  |gits..... C%=1 .|
000001e0  20 34 0d 00 c8 0b 41 25  3d 9a 23 46 25 0d 00 d2  | 4....A%=.#F%...|
000001f0  16 42 25 3d 28 41 25 20  80 20 26 46 29 20 84 20  |.B%=(A% . &F) . |
00000200  26 33 30 0d 00 dc 0f 56  24 3d 56 24 2b bd 28 42  |&30....V$=V$+.(B|
00000210  25 29 0d 00 e6 05 ed 0d  00 f0 08 f1 56 24 3b 0d  |%)..........V$;.|
00000220  00 fa 25 e7 20 28 41 25  20 80 20 26 38 30 29 3d  |..%. (A% . &80)=|
00000230  30 20 8c 20 f1 20 8b 20  f1 22 20 4f 76 65 72 66  |0 . . . ." Overf|
00000240  6c 6f 77 22 0d 01 04 08  41 24 3d be 0d 01 0e 0c  |low"....A$=.....|
00000250  fd 20 41 24 3d 22 20 22  0d 01 18 08 d9 23 46 25  |. A$=" ".....#F%|
00000260  0d 01 22 05 e0 0d 01 2c  14 f6 3a f1 22 20 61 74  |.."....,..:." at|
00000270  20 6c 69 6e 65 20 22 3b  9e 0d 01 36 08 d9 23 46  | line ";...6..#F|
00000280  25 0d ff                                          |%..|
00000283