


Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  mainteleport.asm  Page 1



1                        ;
2                        ; Copyright 1993 by Digital Equipment Corporation, Maynard, Massachusetts.
3                        ;
4                        ; Permission to use, copy, modify, distribute, and sell this software and its
5                        ; documentation for any purpose is hereby granted without fee, provided that
6                        ; the above copyright notice appear in all copies and that both that
7                        ; copyright notice and this permission notice appear in supporting
8                        ; documentation, and that the name of Digital not be used in advertising or
9                        ; publicity pertaining to distribution of the software without specific,
10                       ; written prior permission.  Digital makes no representations about the
11                       ; suitability of this software for any purpose.  It is provided "as is"
12                       ; without express or implied warranty.
13                       ;
14                       ; DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15                       ; ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16                       ; DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
17                       ; DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
18                       ; AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19                       ; OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20                       ;
21                       ;
22                       ;------------------------------------------------------------------------------
23                       ;
24                       ;       Customized version of crt056y.asm for Lo-Fi.
25                       ;       Used by AudioFile server for LoFi too!
26                       ;
27                       ; Modfied by:
28                       ;  ?/?/91       tml     from motorola original.
29                       ;  4/11/91      tml     change boot sequence, mode bits.
30                       ;                       add host port initialization.  fix ipl levels.
31                       ;  1/23/92      tml     CHange to mode 0, placing reset at 0.
32                       ;                       Manipulate memory organization, use same crt file
33                       ;                       for AudioFile and devices area.
34                       ; 10/07/93      lcs     Add Teleport code
35                       ;------------------------------------------------------------------------------
36                                                                           ; $Id: mainteleport.asm,v 1.2 1993/11/12 17:53:08 tml E
xp $
37     
38                                 opt     so,xr
39                                 page    132,66,3,3
40     
41                                 include "lofihw.asm"
42     
43     
44        00FFF0         ACODEC0   EQU     $FFF0                             ; primary codec base address
45        00FFF8         ACODEC1   EQU     $FFF8                             ; primary codec base address
46        050000         CBb       EQU     $5<<16                            ; Bb register
47        00E800         ACSR      EQU     $E800                             ; CSR Address
48        000000         CIR       EQU     0                                 ; Codec Interrupt addr.
49     
50     
51     
52                                 include "intequ.asm"
53                       ;************************************************************************
54                       ;
55                       ;       EQUATES for DSP56000 interrupts






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  ../../include/intequ.asm  Page 2



56                       ;       Reference: DSP56000 User's Manual, Table 8.1, Interrupt Sources
57                       ;
58                       ;************************************************************************
59     
60                       intequ    ident   1,0
61     
62        000000         I_RESET   EQU     $0000                             ; hardware _RESET
63        000002         I_STACK   EQU     $0002                             ; stack error
64        000004         I_TRACE   EQU     $0004                             ; trace
65        000006         I_SWI     EQU     $0006                             ; SWI
66        000008         I_IRQA    EQU     $0008                             ; _IRQA
67        00000A         I_IRQB    EQU     $000A                             ; _IRQB
68     
69        00000C         I_SSIRD   EQU     $000C                             ; SSI receive data
70        00000E         I_SSIRDE  EQU     $000E                             ; SSI receive data with exception status
71        000010         I_SSITD   EQU     $0010                             ; SSI transmit data
72        000012         I_SSITDE  EQU     $0012                             ; SSI transmit data with exception status
73     
74        000014         I_SCIRD   EQU     $0014                             ; SCI receive data
75        000016         I_SCIRDE  EQU     $0016                             ; SCI receive data with exception status
76        000018         I_SCITD   EQU     $0018                             ; SCI transmit data
77        00001A         I_SCIIL   EQU     $001A                             ; SCI idle line
78        00001C         I_SCITM   EQU     $001C                             ; SCI timer
79     
80        000020         I_HSTRD   EQU     $0020                             ; host receive data
81        000022         I_HSTTD   EQU     $0022                             ; host transmit data
82        000024         I_HSTCM   EQU     $0024                             ; host command (default)
83                                 include "ioequlc.asm"
84                       ;
85                       ; This program originally available on the Motorola DSP bulletin board.
86                       ; It is provided under a DISCLAMER OF WARRANTY available from
87                       ; Motorola DSP Operation, 6501 Wm. Cannon Drive W., Austin, Tx., 78735.
88                       ;
89                       ; Motorola Standard I/O Equates (lower case).
90                       ;
91                       ; Last Update 25 Aug 87   Version 1.1  (fixed m_of)
92                       ;
93                       ;************************************************************************
94                       ;
95                       ;       EQUATES for DSP56000 I/O registers and ports
96                       ;
97                       ;************************************************************************
98     
99                       ioequlc   ident   1,0
100    
101                      ;------------------------------------------------------------------------
102                      ;
103                      ;       EQUATES for I/O Port Programming
104                      ;
105                      ;------------------------------------------------------------------------
106    
107                      ;       Register Addresses
108    
109       00FFFE         m_bcr     EQU     $FFFE                             ; Port A Bus Control Register
110       00FFE0         m_pbc     EQU     $FFE0                             ; Port B Control Register
111       00FFE2         m_pbddr   EQU     $FFE2                             ; Port B Data Direction Register






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  ../../include/ioequlc.asm  Page 3



112       00FFE4         m_pbd     EQU     $FFE4                             ; Port B Data Register
113       00FFE1         m_pcc     EQU     $FFE1                             ; Port C Control Register
114       00FFE3         m_pcddr   EQU     $FFE3                             ; Port C Data Direction Register
115       00FFE5         m_pcd     EQU     $FFE5                             ; Port C Data Register
116    
117    
118                      ;------------------------------------------------------------------------
119                      ;
120                      ;       EQUATES for Host Interface
121                      ;
122                      ;------------------------------------------------------------------------
123    
124                      ;       Register Addresses
125    
126       00FFE8         m_hcr     EQU     $FFE8                             ; Host Control Register
127       00FFE9         m_hsr     EQU     $FFE9                             ; Host Status Register
128       00FFEB         m_hrx     EQU     $FFEB                             ; Host Receive Data Register
129       00FFEB         m_htx     EQU     $FFEB                             ; Host Transmit Data Register
130    
131                      ;       Host Control Register Bit Flags
132    
133       000000         m_hrie    EQU     0                                 ; Host Receive Interrupt Enable
134       000001         m_htie    EQU     1                                 ; Host Transmit Interrupt Enable
135       000002         m_hcie    EQU     2                                 ; Host Command Interrupt Enable
136       000003         m_hf2     EQU     3                                 ; Host Flag 2
137       000004         m_hf3     EQU     4                                 ; Host Flag 3
138    
139                      ;       Host Status Register Bit Flags
140    
141       000000         m_hrdf    EQU     0                                 ; Host Receive Data Full
142       000001         m_htde    EQU     1                                 ; Host Transmit Data Empty
143       000002         m_hcp     EQU     2                                 ; Host Command Pending
144       000018         m_hf      EQU     $18                               ; Host Flag Mask
145       000003         m_hf0     EQU     3                                 ; Host Flag 0
146       000004         m_hf1     EQU     4                                 ; Host Flag 1
147       000007         m_dma     EQU     7                                 ; DMA Status
148    
149                      ;------------------------------------------------------------------------
150                      ;
151                      ;       EQUATES for Serial Communications Interface (SCI)
152                      ;
153                      ;------------------------------------------------------------------------
154    
155                      ;       Register Addresses
156    
157       00FFF4         m_srxl    EQU     $FFF4                             ; SCI Receive Data Register (low)
158       00FFF5         m_srxm    EQU     $FFF5                             ; SCI Receive Data Register (middle)
159       00FFF6         m_srxh    EQU     $FFF6                             ; SCI Receive Data Register (high)
160       00FFF4         m_stxl    EQU     $FFF4                             ; SCI Transmit Data Register (low)
161       00FFF5         m_stxm    EQU     $FFF5                             ; SCI Transmit Data Register (middle)
162       00FFF6         m_stxh    EQU     $FFF6                             ; SCI Transmit Data Register (high)
163       00FFF3         m_stxa    EQU     $FFF3                             ; SCI Transmit Data Address Register
164       00FFF0         m_scr     EQU     $FFF0                             ; SCI Control Register
165       00FFF1         m_ssr     EQU     $FFF1                             ; SCI Status Register
166       00FFF2         m_sccr    EQU     $FFF2                             ; SCI Clock Control Register
167    






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  ../../include/ioequlc.asm  Page 4



168                      ;       SCI Control Register Bit Flags
169    
170       000003         m_wds     EQU     $3                                ; Word Select Mask
171       000000         m_wds0    EQU     0                                 ; Word Select 0
172       000001         m_wds1    EQU     1                                 ; Word Select 1
173       000002         m_wds2    EQU     2                                 ; Word Select 2
174       000004         m_sbk     EQU     4                                 ; Send Break
175       000005         m_wake    EQU     5                                 ; Wake-up Mode Select
176       000006         m_rwi     EQU     6                                 ; Receiver Wake-up Enable
177       000007         m_woms    EQU     7                                 ; Wired-OR Mode Select
178       000008         m_re      EQU     8                                 ; Receiver Enable
179       000009         m_te      EQU     9                                 ; Transmitter Enable
180       00000A         m_ilie    EQU     10                                ; Idle Line Interrupt Enable
181       00000B         m_rie     EQU     11                                ; Receive Interrupt Enable
182       00000C         m_tie     EQU     12                                ; Transmit Interrupt Enable
183       00000D         m_tmie    EQU     13                                ; Timer Interrupt Enable
184    
185                      ;       SCI Status Register Bit Flags
186    
187       000000         m_trne    EQU     0                                 ; Transmitter Empty
188       000001         m_tdre    EQU     1                                 ; Transmit Data Register Empty
189       000002         m_rdrf    EQU     2                                 ; Receive Data Register Full
190       000003         m_idle    EQU     3                                 ; Idle Line
191       000004         m_or      EQU     4                                 ; Overrun Error
192       000005         m_pe      EQU     5                                 ; Parity Error
193       000006         m_fe      EQU     6                                 ; Framing Error
194       000007         m_r8      EQU     7                                 ; Received Bit 8
195    
196                      ;       SCI Clock Control Register Bit Flags
197    
198       000FFF         m_cd      EQU     $FFF                              ; Clock Divider Mask
199       00000C         m_cod     EQU     12                                ; Clock Out Divider
200       00000D         m_scp     EQU     13                                ; Clock Prescaler
201       00000E         m_rcm     EQU     14                                ; Receive Clock Source
202       00000F         m_tcm     EQU     15                                ; Transmit Clock Source
203    
204                      ;------------------------------------------------------------------------
205                      ;
206                      ;       EQUATES for Synchronous Serial Interface (SSI)
207                      ;
208                      ;------------------------------------------------------------------------
209    
210                      ;       Register Addresses
211    
212       00FFEF         m_rx      EQU     $FFEF                             ; Serial Receive Data Register
213       00FFEF         m_tx      EQU     $FFEF                             ; Serial Transmit Data Register
214       00FFEC         m_cra     EQU     $FFEC                             ; SSI Control Register A
215       00FFED         m_crb     EQU     $FFED                             ; SSI Control Register B
216       00FFEE         m_sr      EQU     $FFEE                             ; SSI Status Register
217       00FFEE         m_tsr     EQU     $FFEE                             ; SSI Time Slot Register
218    
219                      ;       SSI Control Register A Bit Flags
220    
221       0000FF         m_pm      EQU     $FF                               ; Prescale Modulus Select Mask
222       001F00         m_dc      EQU     $1F00                             ; Frame Rate Divider Control Mask
223       006000         m_wl      EQU     $6000                             ; Word Length Control Mask






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  ../../include/ioequlc.asm  Page 5



224       00000D         m_wl0     EQU     13                                ; Word Length Control 0
225       00000E         m_wl1     EQU     14                                ; Word Length Control 1
226       00000F         m_psr     EQU     15                                ; Prescaler Range
227    
228                      ;       SSI Control Register B Bit Flags
229    
230       000003         m_of      EQU     $3                                ; Serial Output Flag Mask
231       000000         m_of0     EQU     0                                 ; Serial Output Flag 0
232       000001         m_of1     EQU     1                                 ; Serial Output Flag 1
233       00001C         m_scd     EQU     $1C                               ; Serial Control Direction Mask
234       000002         m_scd0    EQU     2                                 ; Serial Control 0 Direction
235       000003         m_scd1    EQU     3                                 ; Serial Control 1 Direction
236       000004         m_scd2    EQU     4                                 ; Serial Control 2 Direction
237       000005         m_sckd    EQU     5                                 ; Clock Source Direction
238       000008         m_fsl     EQU     8                                 ; Frame Sync Length
239       000009         m_syn     EQU     9                                 ; Sync/Async Control
240       00000A         m_gck     EQU     10                                ; Gated Clock Control
241       00000B         m_mod     EQU     11                                ; Mode Select
242       00000C         m_ste     EQU     12                                ; SSI Transmit Enable
243       00000D         m_sre     EQU     13                                ; SSI Receive Enable
244       00000E         m_stie    EQU     14                                ; SSI Transmit Interrupt Enable
245       00000F         m_srie    EQU     15                                ; SSI Receive Interrupt Enable
246    
247                      ;       SSI Status Register Bit Flags
248    
249       000002         m_if      EQU     $2                                ; Serial Input Flag Mask
250       000000         m_if0     EQU     0                                 ; Serial Input Flag 0
251       000001         m_if1     EQU     1                                 ; Serial Input Flag 1
252       000002         m_tfs     EQU     2                                 ; Transmit Frame Sync
253       000003         m_rfs     EQU     3                                 ; Receive Frame Sync
254       000004         m_tue     EQU     4                                 ; Transmitter Underrun Error
255       000005         m_roe     EQU     5                                 ; Receiver Overrun Error
256       000006         m_tde     EQU     6                                 ; Transmit Data Register Empty
257       000007         m_rdf     EQU     7                                 ; Receive Data Register Full
258    
259                      ;------------------------------------------------------------------------
260                      ;
261                      ;       EQUATES for Exception Processing
262                      ;
263                      ;------------------------------------------------------------------------
264    
265                      ;       Register Addresses
266    
267       00FFFF         m_ipr     EQU     $FFFF                             ; Interrupt Priority Register
268    
269                      ;       Interrupt Priority Register Bit Flags
270    
271       000007         m_ial     EQU     $7                                ; IRQA Mode Mask
272       000000         m_ial0    EQU     0                                 ; IRQA Mode Interrupt Priority Level (low)
273       000001         m_ial1    EQU     1                                 ; IRQA Mode Interrupt Priority Level (high)
274       000002         m_ial2    EQU     2                                 ; IRQA Mode Trigger Mode
275       000038         m_ibl     EQU     $38                               ; IRQB Mode Mask
276       000003         m_ibl0    EQU     3                                 ; IRQB Mode Interrupt Priority Level (low)
277       000004         m_ibl1    EQU     4                                 ; IRQB Mode Interrupt Priority Level (high)
278       000005         m_ibl2    EQU     5                                 ; IRQB Mode Trigger Mode
279       000C00         m_hpl     EQU     $C00                              ; Host Interrupt Priority Level Mask






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  ../../include/ioequlc.asm  Page 6



280       00000A         m_hpl0    EQU     10                                ; Host Interrupt Priority Level Mask (low)
281       00000B         m_hpl1    EQU     11                                ; Host Interrupt Priority Level Mask (high)
282       003000         m_ssl     EQU     $3000                             ; SSI Interrupt Priority Level Mask
283       00000C         m_ssl0    EQU     12                                ; SSI Interrupt Priority Level Mask (low)
284       00000D         m_ssl1    EQU     13                                ; SSI Interrupt Priority Level Mask (high)
285       00C000         m_scl     EQU     $C000                             ; SCI Interrupt Priority Level Mask
286       00000E         m_scl0    EQU     14                                ; SCI Interrupt Priority Level Mask (low)
287       00000F         m_scl1    EQU     15                                ; SCI Interrupt Priority Level Mask (high)
288    
289                      ;
290                      ;  This file contains the definitions for the DSP/Host common mailbox area.
291                      ;  It is automatically (with CPP) derived from "dsp.h"
292                      ;
293                                include "dsp.asm"
294    
295    
296    
297    
298    
299    
300    
301    
302    
303    
304    
305    
306    
307    
308    
309    
310    
311    
312    
313    
314    
315    
316    
317    
318    
319    
320    
321    
322    
323    
324    
325    
326    
327    
328    
329    
330    
331    
332    
333    
334    
335    






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  dsp.asm  Page 7



336    
337    
338    
339    
340    
341    
342    
343    
344    
345    
346    
347    
348    
349    
350    
351    
352    
353    
354    
355    
356    
357    
358    
359    
360    
361    
362    
363    
364    
365    
366    
367    
368    
369    
370    
371    
372    
373    
374    
375    
376    
377    
378    
379    
380    
381    
382    
383    
384    
385    
386    
387    
388    
389    
390    
391    






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  dsp.asm  Page 8



392    
393    
394    
395    
396    
397    
398    
399    
400    
401    
402    
403    
404    
405    
406    
407    
408    
409    
410    
411    
412    
413    
414    
415    
416    
417    
418       000200         mbx_start equ     $200
419       000201         codec_time equ    $200+1
420    
421                      codec_start0
422       000202                   equ     $200+2
423       000203         codec_len0 equ    $200+3
424       000204         codec_ofs0 equ    $200+4
425    
426                      codec_start1
427       000205                   equ     $200+5
428       000206         codec_len1 equ    $200+6
429       000207         codec_ofs1 equ    $200+7
430    
431       000208         hifi_time equ     $200+8
432    
433                      hifi_start0
434       000209                   equ     $200+9
435       00020A         hifi_len0 equ     $200+10
436       00020B         hifi_ofs0 equ     $200+11
437    
438                      hifi_start1
439       00020C                   equ     $200+12
440       00020D         hifi_len1 equ     $200+13
441       00020E         hifi_ofs1 equ     $200+14
442    
443       00020F         portc_bits equ    $200+15
444    
445       000210         dsp_cra   equ     $200+16
446       000211         dsp_crb   equ     $200+17
447    






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  dsp.asm  Page 9



448       000212         dsp_lctl  equ     $200+18
449       000213         dsp_rctl  equ     $200+19
450       000214         dsp_maski equ     $200+20
451       000215         dsp_masko equ     $200+21
452       000216         dsp_lstat equ     $200+22
453       000217         dsp_rstat equ     $200+23
454    
455    
456    
457    
458    
459    
460    
461                      ;------------------------------------------------------------------------------
462                      ;
463                      ;  Local (on-chip) RAM
464                      ;
465                      ;    Some variables are shadowed here to minimize the number of accesses to
466                      ;    shared, off-chip RAM.
467                      ;
468    
469                                section local_ram
470                                global  local_hifi_time
471                                global  local_codec_time
472       X:0000                   org     x:$0
473    
474                      local_hifi_time
475       X:0000                   dc      $0
476                      local_codec_time
477       X:0001                   dc      $0
478    
479                                endsec
480    
481                      ;------------------------------------------------------------------------------
482                      ;
483                      ;  This reset code resides in "high" memory at 0xe000 and is used
484                      ;  exactly once (at reset/startup).
485                      ;
486                                section hw_reset
487       P:E000                   org     p:$e000
488       P:E000 0501BB            movec             #1,sp                   ;init stack pointer
489       P:E001 0500B9            movec             #0,sr                   ;clear loop flag/interrupt mask bits
490    
491       P:E002 0500BA            movec             #$0,omr                 ; mode 0
492       P:E003 000000            nop
493    
494                      ;
495                      ; Copy program into on-chip program memory (512 words).  (Takes advantage of
496                      ; the fact that the 32K word shared memory is mapped to 0x0000 and 0x8000)
497                      ;
498    
499       P:E004 310000            move              #$0,r1
500       P:E005 390100            move              #$1,n1
501       P:E006 60F400            move              #$8000,r0
                 008000
502       P:E008 380100            move              #$1,n0






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  mainteleport.asm  Page 10



503       P:E009 060082            do      #$200,end2
                 00E00C
504       P:E00B 07D888            move              p:(r0)+,a0
505       P:E00C 075988            move              a0,p:(r1)+
506                      end2
507    
508       P:E00D 300000            move              #0,r0                   ; zero x and y internal memory
509       P:E00E 380100            move              #1,n0
510       P:E00F 280000            move              #0,a0
511       P:E010 060082            do      #$200,end3
                 00E014
512       P:E012 506000            move              a0,x:(r0)
513       P:E013 585800            move                          a0,y:(r0)+
514       P:E014 000000            nop
515                      end3
516       P:E015 0AF080            jmp     start
                 000013
517    
518                                endsec
519    
520                      ;------------------------------------------------------------------------------
521                      ;
522                      ;  Exception vectors (gets loaded into low memory)
523                      ;
524    
525    
526                                section reset
527    
528       P:0008                   org     p:I_IRQA
529       P:0008 0D0087            jsr     <codec_isr                        ; CODEC interrupt
530    
531       P:0010                   org     p:I_SSITD
532       P:0010 0D0048            jsr     <ssi_int                          ; SSI tx data
533    
534       P:0012                   org     p:I_SSITDE
535       P:0012 0D0048            jsr     <ssi_int                          ; SSI tx data w/ error
536    
537    
538                      ;------------------------------------------------------------------------------
539                      ;
540                      ;  The remaining code resides in the on-chip program memory.
541                      ;
542    
543                                global  start
544                      start
545    
546       P:0013 00F3B8            and     #$f3,mr
547       P:0014 00BFB9            and     #$bf,ccr
548    
549       P:0015 08F4BF            movep             #$0,x:m_ipr             ; all disabled.
                 000000
550       P:0017 08F4BE            movep             #$6,x:m_bcr             ; 0 wait in memory, 6 in Y:IO
                 000006
551       P:0019 08F4A0            movep             #$1,x:m_pbc             ; Enable port B as Host port.
                 000001
552    






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  mainteleport.asm  Page 11



553       P:001B 0AA822            bset    #2,x:$ffe8                        ; enable host commands
554    
555                      ;
556                      ;   Configure the DSP port
557                      ;       CRA and CRB set the DSP port configuration.  The values come from
558                      ;       x:dsp_cra, and x:dsp_crb, which are set by the host before startup.
559                      ;
560    
561       P:001C 08F0AC            movep             x:dsp_cra,x:<<m_cra
                 000210
562       P:001E 08F0AD            movep             x:dsp_crb,x:<<m_crb
                 000211
563    
564                      ;  Intialize the SSI port (Port C)
565                      ;       For many DSP port devices, these bits set the sample rate.  The
566                      ;       value comes from x:portc_bits, and is set by the host before
567                      ;       startup.
568                      ;
569       P:0020 08F4A1            movep             #$0001f8,x:m_pcc        ; set up SCI pins as parallel port
                 0001F8
570       P:0022 08F4A3            movep             #$7,x:m_pcddr           ; output bits
                 000007
571    
572       P:0024 08F0A5            movep             x:portc_bits,x:m_pcd    ; set the port C bits
                 00020F
573    
574       P:0026 08F4AF            movep             #$0,x:<<m_tx            ; init SSI
                 000000
575    
576                      ;
577                      ;  Initialize the buffer address registers.  The values are read from the
578                      ;  shared memory area and are assumed to be initialized by the host before
579                      ;  the DSP is let out of reset.
580                      ;
581       P:0028 60F000            move              x:codec_start0,r0
                 000202
582       P:002A 05F020            move              x:codec_len0,m0
                 000203
583       P:002C 70F000            move              x:codec_ofs0,n0
                 000204
584    
585       P:002E 61F000            move              x:codec_start1,r1
                 000205
586       P:0030 05F021            move              x:codec_len1,m1
                 000206
587       P:0032 71F000            move              x:codec_ofs1,n1
                 000207
588    
589       P:0034 62F000            move              x:hifi_start0,r2
                 000209
590       P:0036 05F022            move              x:hifi_len0,m2
                 00020A
591       P:0038 72F000            move              x:hifi_ofs0,n2
                 00020B
592    
593       P:003A 63F000            move              x:hifi_start1,r3






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  mainteleport.asm  Page 12



                 00020C
594       P:003C 05F023            move              x:hifi_len1,m3
                 00020D
595       P:003E 73F000            move              x:hifi_ofs1,n3
                 00020E
596    
597                      ;
598                      ;    Set the host flags to tell the host we are here.
599                      ;
600       P:0040 0AA823            bset    #3,x:m_hcr                        ; set host flag #2 (HF2)
601       P:0041 0AA824            bset    #4,x:m_hcr                        ; set host flag #3 (HF3)
602    
603       P:0042 44F400            move              #>1,x0                  ; always 1
                 000001
604       P:0044 08F4BF            movep             #$3401,x:m_ipr          ; set IPLs:
                 003401
605                                                                          ;     CODEC = 1, Host = 1, SSI = 2
606    
607       P:0046 00FCB8            and     #$fc,mr                           ; enable all IPLs
608    
609                      wait
610       P:0047 0C0047            jmp     wait                              ; spin loop
611    
612                      ;------------------------------------------------------------------------------
613                      ;
614                      ;  SSI Interrupt handler
615                      ;
616                      ;    This routine gets called for each WORD.  The transmit frame
617                      ;    sync (TFS) bit in the SSI status register (SR) is used to differentiate
618                      ;    between channels.  If the TFS bit is set, then the word is the first
619                      ;    in the frame (channel A).  If it is clear, then the word is for Channel
620                      ;    B.
621                      ;
622                      ;  **NOTE:  this routine assumes exclusive use of the A register
623                      ;
624                                global  ssi_int
625                      ssi_int
626       P:0048 0AAEA2            jset    #m_tfs,x:<<m_sr,ssi_rx_b          ; which channel?
                 00006B
627    
628                      ; Channel 0 (A)
629       P:004A 0AAD21            bset    #1,x:<<m_crb                      ; toggle OF1 (SC1)
630                      ; OUTPUT
631       P:004B 54EA00            move              x:(r2+n2),a1            ; transmit data, send it
632       P:004C 45F000            move              x:dsp_masko,x1          ; load mask
                 000215
633       P:004E 200066            and     x1,a1                             ; mask off ctl bit positions
634       P:004F 45F000            move              x:dsp_lctl,x1
                 000212
635       P:0051 200062            or      x1,a1                             ; or in ctl bits
636       P:0052 08CC2F            movep             a1,x:m_tx               ; transmit data, send it
637    
638       P:0053 2C0000            move              #0,a1
639       P:0054 546A00            move              a1,x:(r2+n2)            ; backfill silence
640    
641                      ; INPUT






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  mainteleport.asm  Page 13



642       P:0055 084C2F            movep             x:m_rx,a1               ; get receive data to register
643       P:0056 546200            move              a1,x:(r2)               ; data to buffer
644       P:0057 45F000            move              x:dsp_maski,x1          ; load mask
                 000214
645       P:0059 200066            and     x1,a1                             ; mask off except ctl
646       P:005A 45F000            move              x:dsp_lstat,x1
                 000216
647       P:005C 280000            move              #0,a0
648       P:005D 200065            cmp     x1,a                              ; compare with old value
649       P:005E 0AF0AA            jeq     ssi_nc_a                          ; jmp around hport
                 000064
650       P:0060 547000            move              a1,x:dsp_lstat          ; update previous value
                 000216
651       P:0062 08F4AB            movep             #11,x:m_htx             ; trigger host interrupt
                 00000B
652                      ssi_nc_a
653                      ; COMMON
654                      ;  Increment and update the hifi clock
655       P:0064 56F000            move              x:hifi_time,a
                 000208
656       P:0066 200040            add     x0,a                              ; x0 should always be 1
657       P:0067 547000            move              a1,x:hifi_time
                 000208
658    
659       P:0069 045A12            lua     (r2)+,r2                          ; increment
660       P:006A 000004            rti
661    
662                      ; Channel 1 (B)
663    
664                      ssi_rx_b
665       P:006B 0AAD01            bclr    #1,x:<<m_crb
666    
667                      ; OUTPUT
668       P:006C 54EB00            move              x:(r3+n3),a1            ; transmit data, send it
669                      ;       move    x:(r2),a1               ; transmit data, send it
670       P:006D 45F000            move              x:dsp_masko,x1          ; load mask
                 000215
671       P:006F 200066            and     x1,a1                             ; mask off ctl bit positions
672       P:0070 45F000            move              x:dsp_rctl,x1
                 000213
673       P:0072 200062            or      x1,a1                             ; or in ctl bits
674       P:0073 08CC2F            movep             a1,x:m_tx               ; transmit data, send it
675    
676       P:0074 2C0000            move              #0,a1
677       P:0075 546B00            move              a1,x:(r3+n3)            ; backfill silence
678                      ; INPUT
679       P:0076 084C2F            movep             x:m_rx,a1               ; get receive data to register
680       P:0077 546300            move              a1,x:(r3)               ; data to buffer
681       P:0078 45F000            move              x:dsp_maski,x1          ; load mask
                 000214
682       P:007A 200066            and     x1,a1                             ; mask off except ctl
683       P:007B 45F000            move              x:dsp_rstat,x1
                 000217
684       P:007D 280000            move              #0,a0
685       P:007E 200065            cmp     x1,a                              ; compare with old value
686       P:007F 0AF0AA            jeq     ssi_nc_b                          ; jmp around hport






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  mainteleport.asm  Page 14



                 000085
687       P:0081 547000            move              a1,x:dsp_rstat          ; update previous value
                 000217
688       P:0083 08F4AB            movep             #11,x:m_htx             ; trigger host interrupt
                 00000B
689                      ssi_nc_b
690    
691                      ; COMMON
692       P:0085 045B13            lua     (r3)+,r3                          ; increment
693       P:0086 000004            rti
694    
695    
696                      ;------------------------------------------------------------------------------
697                      ;
698                      ;  CODEC Interrupt Handler (IRQA)
699                      ;
700                      ;
701                      ;  **NOTE:  this routine assumes exclusive use of the B register
702                      ;
703                                global  codec_isr
704    
705                      codec_isr
706    
707                      ; Clear interrupt by reading CODEC 0's IR
708       P:0087 290000            move              #CIR,b0
709       P:0088 597000            move                          b0,y:ACSR
                 00E800
710       P:008A 094930            movep             y:<<ACODEC0,b0          ; do read
711    
712       P:008B 51F400            move              #CBb,b0
                 050000
713       P:008D 597000            move                          b0,y:ACSR   ; point to B channel buffer
                 00E800
714    
715                      ; Fetch and write outgoing data (backfill with silence)
716    
717       P:008F 55F400            move              #$ffffff,b1             ; silence
                 FFFFFF
718       P:0091 09E8B0            movep             x:(r0+n0),y:<<ACODEC0   ; send it
719       P:0092 556800            move              b1,x:(r0+n0)
720       P:0093 09E9B8            movep             x:(r1+n1),y:<<ACODEC1   ; send it
721       P:0094 556900            move              b1,x:(r1+n1)
722    
723                      ; Read and store incoming data
724    
725       P:0095 0958B0            movep             y:<<ACODEC0,x:(r0)+     ; store and increment
726       P:0096 0959B8            movep             y:<<ACODEC1,x:(r1)+     ; store and increment
727    
728                      ;  Increment and update the codec clock
729       P:0097 57F000            move              x:codec_time,b
                 000201
730       P:0099 200048            add     x0,b                              ; x0 should always be 1
731       P:009A 557000            move              b1,x:codec_time
                 000201
732    
733       P:009C 000004            rti






Motorola DSP56000 Assembler  Version 3.1.11.1  93-11-19  08:19:25  mainteleport.asm  Page 15



734    
735                                endsec

0    Errors
0    Warnings
