Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_35.ADF » P/OSWDTCT

P/OSWDTCT

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 » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_35.ADF
Filename: P/OSWDTCT
Read OK:
File size: 0679 bytes
Load address: FFFFFB47
Exec address: 1E728
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10REM Attempts to detect whether osword
   20REM to read clock is supported and
   30REM osbyte to read cmos RAM
   40REM (C)1997 SPROW
   50DIMblock% 32
   60MODE7:CLS:PRINT"OSWord/OSByte for RT Clock detector"'
   70PRINT"Read/write clock mode=0 ";
   80IFFNsubcall(0)=FALSE THENPRINT;"un";
   90PRINT;"available"
  100PRINT"Read/write clock mode=1 ";
  110IFFNsubcall(1)=FALSE THENPRINT;"un";
  120PRINT;"available"
  130PRINT"Read/write clock mode=2 ";
  140IFFNsubcall(2)=FALSE THENPRINT;"un";
  150PRINT;"available"
  160PRINT"Read/write cmos ram ";
  170IFFNosbyte161_162=FALSE THENPRINT;"un";
  180PRINT;"available"
  190id%=INKEY(-256)AND&FF:REM Elk=1;Master=253;BBCB=255;Compact=245;B+=251
  200IFid%<>1 ANDid%<>253 ANDid%<>255 ANDid%<>245 ANDid%<>251 THENPRINT'"Doomsday is only suitable for 8 bit     machines":END
  210PRINT'"Doomsday is ";
  220IF(FNsubcall(0)=FALSE ANDFNsubcall(1)=FALSE ANDFNsubcall(2)=FALSE) ORFNosbyte161_162=FALSE THENPRINT;"un";
  230PRINT;"suitable for your machine"
  240END
  250:
  260DEFPROCsetto255
  270REM Clear a block to 255
  280P%=block%
  290FORoffset%=0TO31:?(block%+offset%)=255:NEXT
  300ENDPROC
  310:
  320DEFFNsubcall(type%)
  330REM After the call,some,if not all,of the 255's will have been overwritten
  340PROCsetto255
  350?block%=type%:A%=14:X%=block% MOD256:Y%=block% DIV256:CALL&FFF1
  360flag%=FALSE
  370FORtest%=1TO31:IF?(block%+test%)<>255 THENflag%=TRUE
  380=flag%
  390:
  400DEFFNosbyte161_162
  410REM Attempts to alter a byte,but is done twice just to be sure
  420A%=161:X%=30:Y%=255:old30%=(USR&FFF4 AND&FF0000)DIV&10000
  430A%=161:X%=31:Y%=255:old31%=(USR&FFF4 AND&FF0000)DIV&10000
  440A%=162:X%=30:Y%=old30%+1:CALL&FFF4
  450A%=162:X%=31:Y%=old31%+1:CALL&FFF4
  460A%=161:X%=30:Y%=255:reread30%=(USR&FFF4 AND&FF0000)DIV&10000
  470A%=161:X%=31:Y%=255:reread31%=(USR&FFF4 AND&FF0000)DIV&10000
  480IF(reread30%<>(old30%+1)) OR(reread31%<>(old31%+1)) THEN=FALSE
  490A%=162:X%=30:Y%=old30%:CALL&FFF4
  500A%=162:X%=31:Y%=old31%:CALL&FFF4
  510=TRUE

'� Attempts to detect whether osword
$� to read clock is supported and
� osbyte to read cmos RAM
(� (C)1997 SPROW
2�block% 32
<0�7:�:�"OSWord/OSByte for RT Clock detector"'
F �"Read/write clock mode=0 ";
P�subcall(0)=� ��;"un";
Z�;"available"
d �"Read/write clock mode=1 ";
n�subcall(1)=� ��;"un";
x�;"available"
� �"Read/write clock mode=2 ";
��subcall(2)=� ��;"un";
��;"available"
��"Read/write cmos ram ";
��osbyte161_162=� ��;"un";
��;"available"
�Bid%=�(-256)�&FF:� Elk=1;Master=253;BBCB=255;Compact=245;B+=251
�k�id%<>1 �id%<>253 �id%<>255 �id%<>245 �id%<>251 ��'"Doomsday is only suitable for 8 bit     machines":�
��'"Doomsday is ";
�M�(�subcall(0)=� ��subcall(1)=� ��subcall(2)=�) ��osbyte161_162=� ��;"un";
�!�;"suitable for your machine"
��
�:
��setto255
� Clear a block to 255

P%=block%
")�offset%=0�31:?(block%+offset%)=255:�
,�
6:
@ݤsubcall(type%)
JL� After the call,some,if not all,of the 255's will have been overwritten
T
�setto255
^<?block%=type%:A%=14:X%=block% �256:Y%=block% �256:�&FFF1
hflag%=�
r.�test%=1�31:�?(block%+test%)<>255 �flag%=�
|
=flag%
�:
�ݤosbyte161_162
�@� Attempts to alter a byte,but is done twice just to be sure
�7A%=161:X%=30:Y%=255:old30%=(�&FFF4 �&FF0000)�&10000
�7A%=161:X%=31:Y%=255:old31%=(�&FFF4 �&FF0000)�&10000
�#A%=162:X%=30:Y%=old30%+1:�&FFF4
�#A%=162:X%=31:Y%=old31%+1:�&FFF4
�:A%=161:X%=30:Y%=255:reread30%=(�&FFF4 �&FF0000)�&10000
�:A%=161:X%=31:Y%=255:reread31%=(�&FFF4 �&FF0000)�&10000
�9�(reread30%<>(old30%+1)) �(reread31%<>(old31%+1)) �=�
�!A%=162:X%=30:Y%=old30%:�&FFF4
�!A%=162:X%=31:Y%=old31%:�&FFF4
�=�
�
00000000  0d 00 0a 27 f4 20 41 74  74 65 6d 70 74 73 20 74  |...'. Attempts t|
00000010  6f 20 64 65 74 65 63 74  20 77 68 65 74 68 65 72  |o detect whether|
00000020  20 6f 73 77 6f 72 64 0d  00 14 24 f4 20 74 6f 20  | osword...$. to |
00000030  72 65 61 64 20 63 6c 6f  63 6b 20 69 73 20 73 75  |read clock is su|
00000040  70 70 6f 72 74 65 64 20  61 6e 64 0d 00 1e 1d f4  |pported and.....|
00000050  20 6f 73 62 79 74 65 20  74 6f 20 72 65 61 64 20  | osbyte to read |
00000060  63 6d 6f 73 20 52 41 4d  0d 00 28 13 f4 20 28 43  |cmos RAM..(.. (C|
00000070  29 31 39 39 37 20 53 50  52 4f 57 0d 00 32 0e de  |)1997 SPROW..2..|
00000080  62 6c 6f 63 6b 25 20 33  32 0d 00 3c 30 eb 37 3a  |block% 32..<0.7:|
00000090  db 3a f1 22 4f 53 57 6f  72 64 2f 4f 53 42 79 74  |.:."OSWord/OSByt|
000000a0  65 20 66 6f 72 20 52 54  20 43 6c 6f 63 6b 20 64  |e for RT Clock d|
000000b0  65 74 65 63 74 6f 72 22  27 0d 00 46 20 f1 22 52  |etector"'..F ."R|
000000c0  65 61 64 2f 77 72 69 74  65 20 63 6c 6f 63 6b 20  |ead/write clock |
000000d0  6d 6f 64 65 3d 30 20 22  3b 0d 00 50 1b e7 a4 73  |mode=0 ";..P...s|
000000e0  75 62 63 61 6c 6c 28 30  29 3d a3 20 8c f1 3b 22  |ubcall(0)=. ..;"|
000000f0  75 6e 22 3b 0d 00 5a 11  f1 3b 22 61 76 61 69 6c  |un";..Z..;"avail|
00000100  61 62 6c 65 22 0d 00 64  20 f1 22 52 65 61 64 2f  |able"..d ."Read/|
00000110  77 72 69 74 65 20 63 6c  6f 63 6b 20 6d 6f 64 65  |write clock mode|
00000120  3d 31 20 22 3b 0d 00 6e  1b e7 a4 73 75 62 63 61  |=1 ";..n...subca|
00000130  6c 6c 28 31 29 3d a3 20  8c f1 3b 22 75 6e 22 3b  |ll(1)=. ..;"un";|
00000140  0d 00 78 11 f1 3b 22 61  76 61 69 6c 61 62 6c 65  |..x..;"available|
00000150  22 0d 00 82 20 f1 22 52  65 61 64 2f 77 72 69 74  |"... ."Read/writ|
00000160  65 20 63 6c 6f 63 6b 20  6d 6f 64 65 3d 32 20 22  |e clock mode=2 "|
00000170  3b 0d 00 8c 1b e7 a4 73  75 62 63 61 6c 6c 28 32  |;......subcall(2|
00000180  29 3d a3 20 8c f1 3b 22  75 6e 22 3b 0d 00 96 11  |)=. ..;"un";....|
00000190  f1 3b 22 61 76 61 69 6c  61 62 6c 65 22 0d 00 a0  |.;"available"...|
000001a0  1c f1 22 52 65 61 64 2f  77 72 69 74 65 20 63 6d  |.."Read/write cm|
000001b0  6f 73 20 72 61 6d 20 22  3b 0d 00 aa 1e e7 a4 6f  |os ram ";......o|
000001c0  73 62 79 74 65 31 36 31  5f 31 36 32 3d a3 20 8c  |sbyte161_162=. .|
000001d0  f1 3b 22 75 6e 22 3b 0d  00 b4 11 f1 3b 22 61 76  |.;"un";.....;"av|
000001e0  61 69 6c 61 62 6c 65 22  0d 00 be 42 69 64 25 3d  |ailable"...Bid%=|
000001f0  a6 28 2d 32 35 36 29 80  26 46 46 3a f4 20 45 6c  |.(-256).&FF:. El|
00000200  6b 3d 31 3b 4d 61 73 74  65 72 3d 32 35 33 3b 42  |k=1;Master=253;B|
00000210  42 43 42 3d 32 35 35 3b  43 6f 6d 70 61 63 74 3d  |BCB=255;Compact=|
00000220  32 34 35 3b 42 2b 3d 32  35 31 0d 00 c8 6b e7 69  |245;B+=251...k.i|
00000230  64 25 3c 3e 31 20 80 69  64 25 3c 3e 32 35 33 20  |d%<>1 .id%<>253 |
00000240  80 69 64 25 3c 3e 32 35  35 20 80 69 64 25 3c 3e  |.id%<>255 .id%<>|
00000250  32 34 35 20 80 69 64 25  3c 3e 32 35 31 20 8c f1  |245 .id%<>251 ..|
00000260  27 22 44 6f 6f 6d 73 64  61 79 20 69 73 20 6f 6e  |'"Doomsday is on|
00000270  6c 79 20 73 75 69 74 61  62 6c 65 20 66 6f 72 20  |ly suitable for |
00000280  38 20 62 69 74 20 20 20  20 20 6d 61 63 68 69 6e  |8 bit     machin|
00000290  65 73 22 3a e0 0d 00 d2  15 f1 27 22 44 6f 6f 6d  |es":......'"Doom|
000002a0  73 64 61 79 20 69 73 20  22 3b 0d 00 dc 4d e7 28  |sday is ";...M.(|
000002b0  a4 73 75 62 63 61 6c 6c  28 30 29 3d a3 20 80 a4  |.subcall(0)=. ..|
000002c0  73 75 62 63 61 6c 6c 28  31 29 3d a3 20 80 a4 73  |subcall(1)=. ..s|
000002d0  75 62 63 61 6c 6c 28 32  29 3d a3 29 20 84 a4 6f  |ubcall(2)=.) ..o|
000002e0  73 62 79 74 65 31 36 31  5f 31 36 32 3d a3 20 8c  |sbyte161_162=. .|
000002f0  f1 3b 22 75 6e 22 3b 0d  00 e6 21 f1 3b 22 73 75  |.;"un";...!.;"su|
00000300  69 74 61 62 6c 65 20 66  6f 72 20 79 6f 75 72 20  |itable for your |
00000310  6d 61 63 68 69 6e 65 22  0d 00 f0 05 e0 0d 00 fa  |machine"........|
00000320  05 3a 0d 01 04 0e dd f2  73 65 74 74 6f 32 35 35  |.:......setto255|
00000330  0d 01 0e 1a f4 20 43 6c  65 61 72 20 61 20 62 6c  |..... Clear a bl|
00000340  6f 63 6b 20 74 6f 20 32  35 35 0d 01 18 0d 50 25  |ock to 255....P%|
00000350  3d 62 6c 6f 63 6b 25 0d  01 22 29 e3 6f 66 66 73  |=block%..").offs|
00000360  65 74 25 3d 30 b8 33 31  3a 3f 28 62 6c 6f 63 6b  |et%=0.31:?(block|
00000370  25 2b 6f 66 66 73 65 74  25 29 3d 32 35 35 3a ed  |%+offset%)=255:.|
00000380  0d 01 2c 05 e1 0d 01 36  05 3a 0d 01 40 14 dd a4  |..,....6.:..@...|
00000390  73 75 62 63 61 6c 6c 28  74 79 70 65 25 29 0d 01  |subcall(type%)..|
000003a0  4a 4c f4 20 41 66 74 65  72 20 74 68 65 20 63 61  |JL. After the ca|
000003b0  6c 6c 2c 73 6f 6d 65 2c  69 66 20 6e 6f 74 20 61  |ll,some,if not a|
000003c0  6c 6c 2c 6f 66 20 74 68  65 20 32 35 35 27 73 20  |ll,of the 255's |
000003d0  77 69 6c 6c 20 68 61 76  65 20 62 65 65 6e 20 6f  |will have been o|
000003e0  76 65 72 77 72 69 74 74  65 6e 0d 01 54 0d f2 73  |verwritten..T..s|
000003f0  65 74 74 6f 32 35 35 0d  01 5e 3c 3f 62 6c 6f 63  |etto255..^<?bloc|
00000400  6b 25 3d 74 79 70 65 25  3a 41 25 3d 31 34 3a 58  |k%=type%:A%=14:X|
00000410  25 3d 62 6c 6f 63 6b 25  20 83 32 35 36 3a 59 25  |%=block% .256:Y%|
00000420  3d 62 6c 6f 63 6b 25 20  81 32 35 36 3a d6 26 46  |=block% .256:.&F|
00000430  46 46 31 0d 01 68 0b 66  6c 61 67 25 3d a3 0d 01  |FF1..h.flag%=...|
00000440  72 2e e3 74 65 73 74 25  3d 31 b8 33 31 3a e7 3f  |r..test%=1.31:.?|
00000450  28 62 6c 6f 63 6b 25 2b  74 65 73 74 25 29 3c 3e  |(block%+test%)<>|
00000460  32 35 35 20 8c 66 6c 61  67 25 3d b9 0d 01 7c 0a  |255 .flag%=...|.|
00000470  3d 66 6c 61 67 25 0d 01  86 05 3a 0d 01 90 13 dd  |=flag%....:.....|
00000480  a4 6f 73 62 79 74 65 31  36 31 5f 31 36 32 0d 01  |.osbyte161_162..|
00000490  9a 40 f4 20 41 74 74 65  6d 70 74 73 20 74 6f 20  |.@. Attempts to |
000004a0  61 6c 74 65 72 20 61 20  62 79 74 65 2c 62 75 74  |alter a byte,but|
000004b0  20 69 73 20 64 6f 6e 65  20 74 77 69 63 65 20 6a  | is done twice j|
000004c0  75 73 74 20 74 6f 20 62  65 20 73 75 72 65 0d 01  |ust to be sure..|
000004d0  a4 37 41 25 3d 31 36 31  3a 58 25 3d 33 30 3a 59  |.7A%=161:X%=30:Y|
000004e0  25 3d 32 35 35 3a 6f 6c  64 33 30 25 3d 28 ba 26  |%=255:old30%=(.&|
000004f0  46 46 46 34 20 80 26 46  46 30 30 30 30 29 81 26  |FFF4 .&FF0000).&|
00000500  31 30 30 30 30 0d 01 ae  37 41 25 3d 31 36 31 3a  |10000...7A%=161:|
00000510  58 25 3d 33 31 3a 59 25  3d 32 35 35 3a 6f 6c 64  |X%=31:Y%=255:old|
00000520  33 31 25 3d 28 ba 26 46  46 46 34 20 80 26 46 46  |31%=(.&FFF4 .&FF|
00000530  30 30 30 30 29 81 26 31  30 30 30 30 0d 01 b8 23  |0000).&10000...#|
00000540  41 25 3d 31 36 32 3a 58  25 3d 33 30 3a 59 25 3d  |A%=162:X%=30:Y%=|
00000550  6f 6c 64 33 30 25 2b 31  3a d6 26 46 46 46 34 0d  |old30%+1:.&FFF4.|
00000560  01 c2 23 41 25 3d 31 36  32 3a 58 25 3d 33 31 3a  |..#A%=162:X%=31:|
00000570  59 25 3d 6f 6c 64 33 31  25 2b 31 3a d6 26 46 46  |Y%=old31%+1:.&FF|
00000580  46 34 0d 01 cc 3a 41 25  3d 31 36 31 3a 58 25 3d  |F4...:A%=161:X%=|
00000590  33 30 3a 59 25 3d 32 35  35 3a 72 65 72 65 61 64  |30:Y%=255:reread|
000005a0  33 30 25 3d 28 ba 26 46  46 46 34 20 80 26 46 46  |30%=(.&FFF4 .&FF|
000005b0  30 30 30 30 29 81 26 31  30 30 30 30 0d 01 d6 3a  |0000).&10000...:|
000005c0  41 25 3d 31 36 31 3a 58  25 3d 33 31 3a 59 25 3d  |A%=161:X%=31:Y%=|
000005d0  32 35 35 3a 72 65 72 65  61 64 33 31 25 3d 28 ba  |255:reread31%=(.|
000005e0  26 46 46 46 34 20 80 26  46 46 30 30 30 30 29 81  |&FFF4 .&FF0000).|
000005f0  26 31 30 30 30 30 0d 01  e0 39 e7 28 72 65 72 65  |&10000...9.(rere|
00000600  61 64 33 30 25 3c 3e 28  6f 6c 64 33 30 25 2b 31  |ad30%<>(old30%+1|
00000610  29 29 20 84 28 72 65 72  65 61 64 33 31 25 3c 3e  |)) .(reread31%<>|
00000620  28 6f 6c 64 33 31 25 2b  31 29 29 20 8c 3d a3 0d  |(old31%+1)) .=..|
00000630  01 ea 21 41 25 3d 31 36  32 3a 58 25 3d 33 30 3a  |..!A%=162:X%=30:|
00000640  59 25 3d 6f 6c 64 33 30  25 3a d6 26 46 46 46 34  |Y%=old30%:.&FFF4|
00000650  0d 01 f4 21 41 25 3d 31  36 32 3a 58 25 3d 33 31  |...!A%=162:X%=31|
00000660  3a 59 25 3d 6f 6c 64 33  31 25 3a d6 26 46 46 46  |:Y%=old31%:.&FFF|
00000670  34 0d 01 fe 06 3d b9 0d  ff                       |4....=...|
00000679
P/OSWDTCT.m0
P/OSWDTCT.m1
P/OSWDTCT.m2
P/OSWDTCT.m4
P/OSWDTCT.m5