Home » Personal collection » Acorn tapes » Electron_User » Electron_User_tape26a_acorn_eu_1991_august.wav » ConvLog

ConvLog

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 tapes » Electron_User » Electron_User_tape26a_acorn_eu_1991_august.wav
Filename: ConvLog
Read OK:
File size: 0614 bytes
Load address: FFFF1A00
Exec address: FFFF8023
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10REM Logarithmic Conversion
   20REM By Rafael Jay
   30REM (C) The Micro User 1991
   40:
   50MODE7:VDU23;8202;0;0;0;
   60PROCinit_logs:PROCassem
   70INPUT'"Source filename: "S$
   80INPUT"Target filename: "T$
   90PRINT"Swap discs (Y/N)? ";
  100REPEAT:G%=GET
  110UNTILG%=ASC"Y"ORG%=ASC"N":VDUG%
  120IFG%=ASC"Y" SW%=-1 ELSE SW%=0
  130PROCconv(S$,T$):END
  140DEFPROCinit_logs
  150DIM LG%(255)
  160var=15/LOG(255)
  170FOR N%=1 TO 255
  180K=15-INT(LOG(N%)*var)
  190LG%(N%)=K
  200NEXT:FORL%=0TO255
  210L%?&A00=LG%(L%):NEXT
  220?&A00=&0F:ENDPROC
  230DEFPROCconv(O$,N$):CLS
  240IFNOTSW% GOTO270
  250PRINTTAB(9,5);"Insert source disc..."
  260REPEATUNTILINKEY-99
  270F%=OPENIN(O$)
  280IFNOTSW% GOTO310
  290PRINTTAB(9,5);"Insert target disc..."
  300REPEATUNTILINKEY-99
  310G%=OPENOUT(N$)
  320count%=0
  330REPEAT:T%=&5000
  340IFNOTSW% GOTO370
  350PRINTTAB(9,5);"Insert source disc..."
  360REPEATUNTILINKEY-99
  370PROCgb(F%,&2500,T%)
  380IFEOF#F% T%=(T%-!&905)
  390PROCc(&2500,T%)
  400IFNOTSW% GOTO430
  410PRINTTAB(9,5);"Insert target disc..."
  420REPEATUNTILINKEY-99
  430PROCpb(G%,&2500,T%/2)
  440count%=count%+1
  450PRINTTAB(3,1);(count%*20);"k ";
  460PRINT"converted (";INT(((count%*&5000)/EXT#F%)*100);"% of total)"
  470UNTILEOF#F%
  480CLOSE#0:ENDPROC
  490DEFPROCgb(H%,S%,L%)
  500?&900=H%:!&901=S%
  510!&905=L%:!&909=PTR#H%
  520A%=&03:X%=&00:Y%=&09:CALL&FFD1
  530ENDPROC
  540DEFPROCpb(H%,S%,L%)
  550!&900=H%:!&901=S%
  560!&905=L%:!&909=PTR#H%
  570A%=&01:X%=&00:Y%=&09:CALL&FFD1
  580ENDPROC
  590DEFPROCc(S%,L%)
  600!&70=S%:!&72=(S%+L%):!&75=S%
  610CALL&C00:ENDPROC
  620DEFPROCassem
  630FOR PASS=0 TO 2 STEP 2
  640P%=&C00:[OPT PASS
  650.loop LDY#&00
  660LDA(&70),Y
  670TAX:LDA&A00,X:STA&74
  680INY:LDA(&70),Y
  690TAX:LDA&A00,X
  700ASLA:ASLA:ASLA
  710ASLA:CLC:ADC&74
  720LDY#&00:STA(&75),Y
  730INC&75:BNEskip3
  740INC&76:.skip3
  750LDA&70:CLC:ADC#&02:STA&70
  760LDA&71:ADC#&00:STA&71
  770LDA&71:CMP&73:BNEloop
  780LDA&70:CMP&72:BCCloop
  790RTS
  800]:NEXT
  810ENDPROC

� Logarithmic Conversion
� By Rafael Jay
� (C) The Micro User 1991
(:
2�7:�23;8202;0;0;0;
<�init_logs:�assem
F�'"Source filename: "S$
P�"Target filename: "T$
Z�"Swap discs (Y/N)? ";
d
�:G%=�
n�G%=�"Y"�G%=�"N":�G%
x�G%=�"Y" SW%=-1 � SW%=0
��conv(S$,T$):�
���init_logs
�� LG%(255)
�var=15/�(255)
�� N%=1 � 255
�K=15-�(�(N%)*var)
�
LG%(N%)=K
��:�L%=0�255
�L%?&A00=LG%(L%):�
�?&A00=&0F:�
���conv(O$,N$):�
��SW% �TNA
�"�9,5);"Insert source disc..."

���-99
F%=�(O$)
�SW% �TvA
""�9,5);"Insert target disc..."
,
���-99
6G%=�(N$)
@count%=0
J�:T%=&5000
T�SW% �DrA
^"�9,5);"Insert source disc..."
h
���-99
r�gb(F%,&2500,T%)
|��#F% T%=(T%-!&905)
��c(&2500,T%)
��SW% �tnA
�"�9,5);"Insert target disc..."
�
���-99
��pb(G%,&2500,T%/2)
�count%=count%+1
��3,1);(count%*20);"k ";
�=�"converted (";�(((count%*&5000)/�#F%)*100);"% of total)"
�	��#F%
�	�#0:�
���gb(H%,S%,L%)
�?&900=H%:!&901=S%
�!&905=L%:!&909=�#H%
A%=&03:X%=&00:Y%=&09:�&FFD1
�
��pb(H%,S%,L%)
&!&900=H%:!&901=S%
0!&905=L%:!&909=�#H%
:A%=&01:X%=&00:Y%=&09:�&FFD1
D�
N��c(S%,L%)
X !&70=S%:!&72=(S%+L%):!&75=S%
b�&C00:�
l��assem
v� PASS=0 � 2 � 2
�P%=&C00:[OPT PASS
�.loop LDY#&00
�LDA(&70),Y
�TAX:LDA&A00,X:STA&74
�INY:LDA(&70),Y
�TAX:LDA&A00,X
�ASLA:ASLA:ASLA
�ASLA:CLC:ADC&74
�LDY#&00:STA(&75),Y
�INC&75:BNEskip3
�INC&76:.skip3
�LDA&70:CLC:ADC#&02:STA&70
�LDA&71:ADC#&00:STA&71
LDA&71:CMP&73:BNEloop
LDA&70:CMP&72:BCCloop
RTS
 ]:�
*�
�
00000000  0d 00 0a 1c f4 20 4c 6f  67 61 72 69 74 68 6d 69  |..... Logarithmi|
00000010  63 20 43 6f 6e 76 65 72  73 69 6f 6e 0d 00 14 13  |c Conversion....|
00000020  f4 20 42 79 20 52 61 66  61 65 6c 20 4a 61 79 0d  |. By Rafael Jay.|
00000030  00 1e 1d f4 20 28 43 29  20 54 68 65 20 4d 69 63  |.... (C) The Mic|
00000040  72 6f 20 55 73 65 72 20  31 39 39 31 0d 00 28 05  |ro User 1991..(.|
00000050  3a 0d 00 32 16 eb 37 3a  ef 32 33 3b 38 32 30 32  |:..2..7:.23;8202|
00000060  3b 30 3b 30 3b 30 3b 0d  00 3c 15 f2 69 6e 69 74  |;0;0;0;..<..init|
00000070  5f 6c 6f 67 73 3a f2 61  73 73 65 6d 0d 00 46 1b  |_logs:.assem..F.|
00000080  e8 27 22 53 6f 75 72 63  65 20 66 69 6c 65 6e 61  |.'"Source filena|
00000090  6d 65 3a 20 22 53 24 0d  00 50 1a e8 22 54 61 72  |me: "S$..P.."Tar|
000000a0  67 65 74 20 66 69 6c 65  6e 61 6d 65 3a 20 22 54  |get filename: "T|
000000b0  24 0d 00 5a 1a f1 22 53  77 61 70 20 64 69 73 63  |$..Z.."Swap disc|
000000c0  73 20 28 59 2f 4e 29 3f  20 22 3b 0d 00 64 0a f5  |s (Y/N)? ";..d..|
000000d0  3a 47 25 3d a5 0d 00 6e  18 fd 47 25 3d 97 22 59  |:G%=...n..G%=."Y|
000000e0  22 84 47 25 3d 97 22 4e  22 3a ef 47 25 0d 00 78  |".G%=."N":.G%..x|
000000f0  1b e7 47 25 3d 97 22 59  22 20 53 57 25 3d 2d 31  |..G%=."Y" SW%=-1|
00000100  20 8b 20 53 57 25 3d 30  0d 00 82 12 f2 63 6f 6e  | . SW%=0.....con|
00000110  76 28 53 24 2c 54 24 29  3a e0 0d 00 8c 0f dd f2  |v(S$,T$):.......|
00000120  69 6e 69 74 5f 6c 6f 67  73 0d 00 96 0e de 20 4c  |init_logs..... L|
00000130  47 25 28 32 35 35 29 0d  00 a0 11 76 61 72 3d 31  |G%(255)....var=1|
00000140  35 2f ab 28 32 35 35 29  0d 00 aa 10 e3 20 4e 25  |5/.(255)..... N%|
00000150  3d 31 20 b8 20 32 35 35  0d 00 b4 15 4b 3d 31 35  |=1 . 255....K=15|
00000160  2d a8 28 ab 28 4e 25 29  2a 76 61 72 29 0d 00 be  |-.(.(N%)*var)...|
00000170  0d 4c 47 25 28 4e 25 29  3d 4b 0d 00 c8 0f ed 3a  |.LG%(N%)=K.....:|
00000180  e3 4c 25 3d 30 b8 32 35  35 0d 00 d2 15 4c 25 3f  |.L%=0.255....L%?|
00000190  26 41 30 30 3d 4c 47 25  28 4c 25 29 3a ed 0d 00  |&A00=LG%(L%):...|
000001a0  dc 0f 3f 26 41 30 30 3d  26 30 46 3a e1 0d 00 e6  |..?&A00=&0F:....|
000001b0  13 dd f2 63 6f 6e 76 28  4f 24 2c 4e 24 29 3a db  |...conv(O$,N$):.|
000001c0  0d 00 f0 0f e7 ac 53 57  25 20 e5 8d 54 4e 41 0d  |......SW% ..TNA.|
000001d0  00 fa 22 f1 8a 39 2c 35  29 3b 22 49 6e 73 65 72  |.."..9,5);"Inser|
000001e0  74 20 73 6f 75 72 63 65  20 64 69 73 63 2e 2e 2e  |t source disc...|
000001f0  22 0d 01 04 0a f5 fd a6  2d 39 39 0d 01 0e 0c 46  |".......-99....F|
00000200  25 3d 8e 28 4f 24 29 0d  01 18 0f e7 ac 53 57 25  |%=.(O$)......SW%|
00000210  20 e5 8d 54 76 41 0d 01  22 22 f1 8a 39 2c 35 29  | ..TvA..""..9,5)|
00000220  3b 22 49 6e 73 65 72 74  20 74 61 72 67 65 74 20  |;"Insert target |
00000230  64 69 73 63 2e 2e 2e 22  0d 01 2c 0a f5 fd a6 2d  |disc..."..,....-|
00000240  39 39 0d 01 36 0c 47 25  3d ae 28 4e 24 29 0d 01  |99..6.G%=.(N$)..|
00000250  40 0c 63 6f 75 6e 74 25  3d 30 0d 01 4a 0e f5 3a  |@.count%=0..J..:|
00000260  54 25 3d 26 35 30 30 30  0d 01 54 0f e7 ac 53 57  |T%=&5000..T...SW|
00000270  25 20 e5 8d 44 72 41 0d  01 5e 22 f1 8a 39 2c 35  |% ..DrA..^"..9,5|
00000280  29 3b 22 49 6e 73 65 72  74 20 73 6f 75 72 63 65  |);"Insert source|
00000290  20 64 69 73 63 2e 2e 2e  22 0d 01 68 0a f5 fd a6  | disc..."..h....|
000002a0  2d 39 39 0d 01 72 14 f2  67 62 28 46 25 2c 26 32  |-99..r..gb(F%,&2|
000002b0  35 30 30 2c 54 25 29 0d  01 7c 17 e7 c5 23 46 25  |500,T%)..|...#F%|
000002c0  20 54 25 3d 28 54 25 2d  21 26 39 30 35 29 0d 01  | T%=(T%-!&905)..|
000002d0  86 10 f2 63 28 26 32 35  30 30 2c 54 25 29 0d 01  |...c(&2500,T%)..|
000002e0  90 0f e7 ac 53 57 25 20  e5 8d 74 6e 41 0d 01 9a  |....SW% ..tnA...|
000002f0  22 f1 8a 39 2c 35 29 3b  22 49 6e 73 65 72 74 20  |"..9,5);"Insert |
00000300  74 61 72 67 65 74 20 64  69 73 63 2e 2e 2e 22 0d  |target disc...".|
00000310  01 a4 0a f5 fd a6 2d 39  39 0d 01 ae 16 f2 70 62  |......-99.....pb|
00000320  28 47 25 2c 26 32 35 30  30 2c 54 25 2f 32 29 0d  |(G%,&2500,T%/2).|
00000330  01 b8 13 63 6f 75 6e 74  25 3d 63 6f 75 6e 74 25  |...count%=count%|
00000340  2b 31 0d 01 c2 1c f1 8a  33 2c 31 29 3b 28 63 6f  |+1......3,1);(co|
00000350  75 6e 74 25 2a 32 30 29  3b 22 6b 20 22 3b 0d 01  |unt%*20);"k ";..|
00000360  cc 3d f1 22 63 6f 6e 76  65 72 74 65 64 20 28 22  |.=."converted ("|
00000370  3b a8 28 28 28 63 6f 75  6e 74 25 2a 26 35 30 30  |;.(((count%*&500|
00000380  30 29 2f a2 23 46 25 29  2a 31 30 30 29 3b 22 25  |0)/.#F%)*100);"%|
00000390  20 6f 66 20 74 6f 74 61  6c 29 22 0d 01 d6 09 fd  | of total)".....|
000003a0  c5 23 46 25 0d 01 e0 09  d9 23 30 3a e1 0d 01 ea  |.#F%.....#0:....|
000003b0  12 dd f2 67 62 28 48 25  2c 53 25 2c 4c 25 29 0d  |...gb(H%,S%,L%).|
000003c0  01 f4 15 3f 26 39 30 30  3d 48 25 3a 21 26 39 30  |...?&900=H%:!&90|
000003d0  31 3d 53 25 0d 01 fe 17  21 26 39 30 35 3d 4c 25  |1=S%....!&905=L%|
000003e0  3a 21 26 39 30 39 3d 8f  23 48 25 0d 02 08 1f 41  |:!&909=.#H%....A|
000003f0  25 3d 26 30 33 3a 58 25  3d 26 30 30 3a 59 25 3d  |%=&03:X%=&00:Y%=|
00000400  26 30 39 3a d6 26 46 46  44 31 0d 02 12 05 e1 0d  |&09:.&FFD1......|
00000410  02 1c 12 dd f2 70 62 28  48 25 2c 53 25 2c 4c 25  |.....pb(H%,S%,L%|
00000420  29 0d 02 26 15 21 26 39  30 30 3d 48 25 3a 21 26  |)..&.!&900=H%:!&|
00000430  39 30 31 3d 53 25 0d 02  30 17 21 26 39 30 35 3d  |901=S%..0.!&905=|
00000440  4c 25 3a 21 26 39 30 39  3d 8f 23 48 25 0d 02 3a  |L%:!&909=.#H%..:|
00000450  1f 41 25 3d 26 30 31 3a  58 25 3d 26 30 30 3a 59  |.A%=&01:X%=&00:Y|
00000460  25 3d 26 30 39 3a d6 26  46 46 44 31 0d 02 44 05  |%=&09:.&FFD1..D.|
00000470  e1 0d 02 4e 0e dd f2 63  28 53 25 2c 4c 25 29 0d  |...N...c(S%,L%).|
00000480  02 58 20 21 26 37 30 3d  53 25 3a 21 26 37 32 3d  |.X !&70=S%:!&72=|
00000490  28 53 25 2b 4c 25 29 3a  21 26 37 35 3d 53 25 0d  |(S%+L%):!&75=S%.|
000004a0  02 62 0b d6 26 43 30 30  3a e1 0d 02 6c 0b dd f2  |.b..&C00:...l...|
000004b0  61 73 73 65 6d 0d 02 76  14 e3 20 50 41 53 53 3d  |assem..v.. PASS=|
000004c0  30 20 b8 20 32 20 88 20  32 0d 02 80 15 50 25 3d  |0 . 2 . 2....P%=|
000004d0  26 43 30 30 3a 5b 4f 50  54 20 50 41 53 53 0d 02  |&C00:[OPT PASS..|
000004e0  8a 11 2e 6c 6f 6f 70 20  4c 44 59 23 26 30 30 0d  |...loop LDY#&00.|
000004f0  02 94 0e 4c 44 41 28 26  37 30 29 2c 59 0d 02 9e  |...LDA(&70),Y...|
00000500  18 54 41 58 3a 4c 44 41  26 41 30 30 2c 58 3a 53  |.TAX:LDA&A00,X:S|
00000510  54 41 26 37 34 0d 02 a8  12 49 4e 59 3a 4c 44 41  |TA&74....INY:LDA|
00000520  28 26 37 30 29 2c 59 0d  02 b2 11 54 41 58 3a 4c  |(&70),Y....TAX:L|
00000530  44 41 26 41 30 30 2c 58  0d 02 bc 12 41 53 4c 41  |DA&A00,X....ASLA|
00000540  3a 41 53 4c 41 3a 41 53  4c 41 0d 02 c6 13 41 53  |:ASLA:ASLA....AS|
00000550  4c 41 3a 43 4c 43 3a 41  44 43 26 37 34 0d 02 d0  |LA:CLC:ADC&74...|
00000560  16 4c 44 59 23 26 30 30  3a 53 54 41 28 26 37 35  |.LDY#&00:STA(&75|
00000570  29 2c 59 0d 02 da 13 49  4e 43 26 37 35 3a 42 4e  |),Y....INC&75:BN|
00000580  45 73 6b 69 70 33 0d 02  e4 11 49 4e 43 26 37 36  |Eskip3....INC&76|
00000590  3a 2e 73 6b 69 70 33 0d  02 ee 1d 4c 44 41 26 37  |:.skip3....LDA&7|
000005a0  30 3a 43 4c 43 3a 41 44  43 23 26 30 32 3a 53 54  |0:CLC:ADC#&02:ST|
000005b0  41 26 37 30 0d 02 f8 19  4c 44 41 26 37 31 3a 41  |A&70....LDA&71:A|
000005c0  44 43 23 26 30 30 3a 53  54 41 26 37 31 0d 03 02  |DC#&00:STA&71...|
000005d0  19 4c 44 41 26 37 31 3a  43 4d 50 26 37 33 3a 42  |.LDA&71:CMP&73:B|
000005e0  4e 45 6c 6f 6f 70 0d 03  0c 19 4c 44 41 26 37 30  |NEloop....LDA&70|
000005f0  3a 43 4d 50 26 37 32 3a  42 43 43 6c 6f 6f 70 0d  |:CMP&72:BCCloop.|
00000600  03 16 07 52 54 53 0d 03  20 07 5d 3a ed 0d 03 2a  |...RTS.. .]:...*|
00000610  05 e1 0d ff                                       |....|
00000614
ConvLog.m0
ConvLog.m1
ConvLog.m2
ConvLog.m4
ConvLog.m5