home *** CD-ROM | disk | FTP | other *** search
- ;***************************************************************
- ;* MACROS.ASM -- General Purpose Macros *
- ;* *
- ;* Copyright (C) 1990-1992 by Alef Null. All rights reserved. *
- ;* Author(s): Jarkko Vuori, OH2LNS *
- ;* Modification(s): *
- ;***************************************************************
-
- ;********************
- ;* DSP CARD 3 *
- ;* equates *
- ;********************
-
- ; DCD light handling
- dcdon macro
- bset #$2,x:m_pcd
- endm
- dcdoff macro
- bclr #$2,x:m_pcd
- endm
-
- ; PTT handling
- ptton macro
- bset #$4,x:m_pcd
- endm
- pttoff macro
- bclr #$4,x:m_pcd
- endm
-
-
- ;********************
- ;* Useful macros *
- ;********************
-
- ; macro for immediate move
- movi macro data,dest
- move #data,a1
- move a1,dest
- endm
- movib macro data,dest
- move #data,b1
- move b1,dest
- endm
-
-
- ;********************
- ;* Contex swapping *
- ;* macros *
- ;********************
-
- ; macro for entering interrupt service routine
- enter macro contex
- move x,l:<contex+0
- move y,l:<contex+1
- move a10,l:<contex+2
- move b10,l:<contex+3
- move a2,x:<contex+4
- move b2,y:<contex+4
- endm
-
-
- ; macro for leaving interrupt service routine
- leave macro contex
- move l:<contex+0,x
- move l:<contex+1,y
- move l:<contex+2,a10
- move l:<contex+3,b10
- move x:<contex+4,a2
- move y:<contex+4,b2
- rti
- endm
-
-
- ; macro for ALU contex space reserving
- roomab macro
- ds 5
- endm
-
-
- ;********************
- ;* TLC32044 *
- ;********************
-
- ; primary communication controls
- noadj equ %00<<8
- retard equ %01<<8
- advance equ %10<<8
-
-
- ; output to ssi
- outssi macro data
- jclr #m_tde,x:m_sr,*
- movep #data,x:m_tx
- endm
-
-
- ; program the Texas A/D & D/A converter chip
- pgmtlc macro ctrl,tra,tra2,trb
- outssi $000000 ; flush any garbage out
- outssi $000300 ; begin secondary communication
- outssi ((ctrl<<2)|%11)<<8 ; set control word
- outssi $000300 ; begin secondary communication
- outssi ((tra<<9)|(tra<<2)|%00)<<8 ; set TA and RA registers
- outssi $000300 ; begin secondary communication
- outssi ((tra2<<9)|(tra2<<2)|%01)<<8 ; set TA' and RA' registers
- outssi $000300 ; begin secondary communication
- outssi ((trb<<9)|(trb<<2)|%10)<<8 ; set TB and RB registers
- endm
-
-
- ;********************
- ;* Global LPC *
- ;* codec parameters *
- ;********************
-
- N equ 240 ; window size
- M equ 160 ; frame size
- P equ 10 ; number of LPC coefficients
- voiced equ 6 ; confidence threshold for voicing
- boost equ 3 ; gain boosting for unvoiced sounds
- monopit equ 70 ; constant pitch in monotonic mode
- filter equ 79 ; filter lenght for Gold-Rabiner low-pass
- poly equ $10800 ; random number generator polynomial (x^17 + x^12 + 1)
-
- whisper equ 0 ; whisper mode flag bit
- silence equ 1 ; silence flag bit
- loopb equ 2 ; loopback mode flag bit
- monot equ 3 ; monotone mode flag bit
- ipolate equ 8 ; interpolate flag (for synthesis part only)
-