                                                 
/natural log subroutine
              
/for mus. Returns log of integer with b. p. between bits 5 and 6
/of AC. Time_. .5 ms.
             
log,	0		/call with jda
	dap lx
	lac log
	lio log
	spq
	jmp lx
	lac (307476	/22ln 2
sh,	ril 1s
	sub (13056	/ln 2
	spi i
	jmp sh
	rir 1s
	dio .prd
	dac log
	lac prd

ml,	and (160000
	ral 5s
	add (tbm
	dap gta
	add (tbl-tbm
	dap gtb
	lac log
gtb,	sub .
	dac log
	cla
gta,	lio .		/get multiplier
	repeat 6, mus prd
	ral 1s
	dac prd
	sma
	jmp ml
	sub (400000
	sar 4s
	add log
	sar 1s
lx,	jmp .

tbm,	73	65
	60	54
	50	46
	43	41

tbl,	11624	10045
	6372	5061
	3444	2600
	1336	0374
         
                    
start
         
         
             
