⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quan.asm

📁 利用G.723协议在DSP实现音频信号的压缩与解压缩实验
💻 ASM
字号:


;/*
; * quan()
; *
; * quantizes the input val against the table of size short integers.
; * It returns i if table[i - 1] <= val < table[i].
; *
; * Using linear search for simple coding.
; */
;static int
;quan(
;	int		val,
;	short		*table,
;	int		size)
;{
;	int		i;
;
;	for (i = 0; i < size; i++)
;		if (val < *table++)
;			break;
;	return (i);
;}
;-----------------------------------------------------
       ; B=val, AR3=table
             .title   "quan.asm"  
             .include "g723_global.asm"         
             .include "g723_stat.asm"
var_val      .set     0
             .text
quan:
        frame  #-1
        nop
        nop
        stl   B, *SP(var_val)
        stm   #15-1, AR4
        mvmm  AR3, AR5
         
cmp: 
        sub   *AR5+, B
        bc    end_cmp, BLT  
        ld    *SP(var_val), B  
        banz  cmp, *AR4-
end_cmp
        nop
        nop
        ldm   AR4, B
        nop
        nop      
        sub   #14, B
        neg   B
        frame  #1
        ret     ;B=i ;AR3=table
            
             .end       

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -