Propeller Manual

Table Of Contents
Appendix B: Math Samples and Function Tables
test num,num2 wz
muxnz exp,exp2
if_z shl num,#4
test num,num1 wz
muxnz exp,exp1
if_z shl num,#2
test num,num0 wz
muxnz exp,exp0
if_z shl num,#1
shr num,#30-11 'justify sub-leading bits as word
offset
and num,table_mask 'isolate table offset bits
add num,table_log 'add log table address
rdword num,num 'read fractional portion of exponent
or exp,num 'combine fractional & integer portions
numexp_ret ret '91..106 clocks
'(variance due to HUB sync on RDWORD)
num4 long $FFFF0000
num3 long $FF000000
num2 long $F0000000
num1 long $C0000000
num0 long $80000000
exp4 long $00100000
exp3 long $00080000
exp2 long $00040000
exp1 long $00020000
exp0 long $00010000
table_mask long $0FFE 'table offset mask
table_log long $C000 'log table base
num long 0 'input
exp long 0 'output
Propeller Manual v1.1 · Page 383