📄 libtblptrset.s
字号:
/*********************************************************************
* *
* Software License Agreement *
* *
* The software supplied herewith by Microchip Technology *
* Incorporated (the "Company") for its dsPIC controller *
* is intended and supplied to you, the Company's customer, *
* for use solely and exclusively on Microchip dsPIC *
* products. The software is owned by the Company and/or its *
* supplier, and is protected under applicable copyright laws. All *
* rights are reserved. Any use in violation of the foregoing *
* restrictions may subject the user to criminal sanctions under *
* applicable laws, as well as to civil liability for the breach of *
* the terms and conditions of this license. *
* *
* THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO *
* WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, *
* BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND *
* FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE *
* COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, *
* INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. *
* *
*********************************************************************/
.equ __33FJ256GP710, 1
.include "p33Fxxxx.inc"
.include "g711lib_common.inc"
;------------------------------------------------------------------------------
;Global Declarations:
;------------------------------------------------------------------------------
.global _libTblPtrSet
.global _pTblpag
.global _pTblOff
.global _byteCount
;------------------------------------------------------------------------------
;Variables stored in Program space
;------------------------------------------------------------------------------
.section bss, near
_pTblpag: .space 2 ; allocating 1 word of space for storing data table page-
; register value.
_pTblOff: .space 2 ; allocating 1 word of space for storing offset to the-
; data table page.
_byteCount: .space 2 ; allocating one byte space for pointer to the bytes in-
; a program memory word.
;------------------------------------------------------------------------------
;Code Section in Program Memory
;------------------------------------------------------------------------------
.section .text, code
/******************************************************************************
*
* Function Name: _libTblPtrSet
*
* System: RISC
*
* Platform: dsPIC33F
*
* Description: This function does not take any inputs.This function is
* used for initializing a 4 byte pointer to data table
* containing encoded speech samples on program memory.It
* declares two pointer variables _pTblpag and _pTblOff.
* pTblpag pointer variable is used to store the upper EA
* word and _pTblOff is used store the lower EA word of
* the program memory location.Working registers w2 and w3
* are used.
*
***************************************************************************** */
_libTblPtrSet:
; Set up w2:w3 to point to the first byte of the encoded speech samples table.
cp.b w0 ,#0x01
BRA NZ, table2
mov #tblpage(TABLENAME1), w3
mov #tbloffset(TABLENAME1), w2
BRA tblpagset
table2: cp.b w0,#0x02
BRA NZ, table3
mov #tblpage(TABLENAME2), w3
mov #tbloffset(TABLENAME2), w2
BRA tblpagset
table3: cp.b w0,#0x03
BRA NZ, table4
mov #tblpage(TABLENAME3), w3
mov #tbloffset(TABLENAME3), w2
BRA tblpagset
table4: cp.b w0,#0x04
BRA NZ, table5
mov #tblpage(TABLENAME4), w3
mov #tbloffset(TABLENAME4), w2
BRA tblpagset
table5: cp.b w0,#0x05
BRA NZ, tblpagset
mov #tblpage(TABLENAME5), w3
mov #tbloffset(TABLENAME5), w2
BRA tblpagset
table6: cp.b w0,#0x06
BRA NZ, table7
mov #tblpage(TABLENAME6), w3
mov #tbloffset(TABLENAME6), w2
BRA tblpagset
table7: cp.b w0,#0x07
BRA NZ, table8
mov #tblpage(TABLENAME7), w3
mov #tbloffset(TABLENAME7), w2
BRA tblpagset
table8: cp.b w0,#0x08
BRA NZ, table9
mov #tblpage(TABLENAME8), w3
mov #tbloffset(TABLENAME8), w2
BRA tblpagset
table9: cp.b w0,#0x09
mov #tblpage(TABLENAME9), w3
mov #tbloffset(TABLENAME9), w2
tblpagset: mov w3 , _pTblpag ;Store the address of first byte
;in data table to _pTblpag
mov w2 , _pTblOff ;Store the address of first byte
;in table to _pTblOff
clr w4
mov w4 , _byteCount
;Initialize byte pointer in program
;memory word to 0
return
;--------End of All Code Sections ---------------------------------------------
.end ;End of program code in this file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -