14 Software Examples
14 – 20
AR=AX0-AY0,MX0=DM(I0,M1);
{Check if SB=-1; Get 1st sample}
IF EQ JUMP strt_shift;
{If SB=-1, shift block data 1 bit}
AX0=-2;
{Set AX0 for block exponent update}
MY0=H#2000;
{Set MY0 to shift 2 bits right}
strt_shift: CNTR=Ntimes2 - 1;
{initialize loop counter}
DO shift_loop UNTIL CE;
{Shift block of data}
MR=MX0*MY0(RND),MX0=DM(I0,M1);
{MR=shifted data,MX0=next value}
shift_loop:
DM(I1,M1)=MR1;
{Unshifted data=shifted data}
MR=MX0*MY0(RND);
{Shift last data word}
AY0=DM(blk_exponent);
{Update block exponent and}
DM(I1,M1)=MR1,AR=AY0-AX0;
{store last shifted sample}
DM(blk_exponent)=AR;
RTS;
.ENDMOD;
Listing 14.8 Radix-2 Block Floating-Point Scaling Routine