{ A-Law expansion routine. Calling Parameters R0 = Compressed 8-bit Input Value Result Registers R0 = Linear value Altered Registers R0, R1, R12, R13, R15; Cycles Time 19 Cycles Version 0.01 8/10/90 Gordon A. Sterling } #include "asm_glob.h" .SEGMENT/PM Assembly_Library_Code_Space; .GLOBAL aexpand; aexpand: R12=H#FF; {Mask unwanted bits} R15=R0 AND R12; R12=H#55; {Invert odd bits} R15=R12 XOR R15; {Invert bits} R13=LSHIFT R15 BY -4; {Isolate segment} R13=BSET R13 BY 3; {Always set sign bit} R12=32; R1=9; R13=R13-R1; {Determine sight value} IF LT R12=R12-R12; {Dont OR MSB bit} IF EQ R13=R13-R13; {No less then zero bits} R1=LSHIFT R15 BY 28; {Isolate interval} R1=BSET R1 BY 27; {Set LSB of interval} R1=LSHIFT R1 BY -27; {Shift interval into bottom} R1=R1 OR LSHIFT R12 BY 0;{Add MSB if necessary} R0=LSHIFT R1 BY R13, R1=R0;{Position interval} RTS (DB); BTST R1 BY 7; {Check sign of input} IF SZ R0=-R0; {Invert output} .ENDSEG;