{ Mu-Law Expansion routine. Calling Parameters R0 = Input 8-bit compressed value Result Registers R0 = Expanded linear value Altered Registers R0, R12, R13, R15 Cycle Time 15 Cycles The Applications Library Gordon A. Sterling 3/20/90 } #include "asm_glob.h" .SEGMENT/PM Assembly_Library_Code_Space; .GLOBAL uexpand; uexpand: R12=H#FF; {Mask unwanted bits} R15=R0 AND R12; R15=R12 XOR R15; {Invert bits} R12=H#70; R13=R12 AND R15; {Isolate segment bits} R0=R13 XOR R15; {Remove segment bits} R12=H#FFFFFF80; R15=R0+R12; IF LT JUMP posval (DB); {Determine sign} R12=33; R13=LSHIFT R13 BY -4; {Shift segment bits to LSBs} negval: R0=R15+R15; RTS (DB), R0=R0+R12; {Add segment offset} R0=ASHIFT R0 BY R13; {Position bits} R0=R12-R0; {Remove segment offset} posval: R0=R0+R0; RTS (DB), R0=R0+R12; {Add segment offset} R0=ASHIFT R0 BY R13; {Position bits} R0=R0-R12; .ENDSEG;