              ; Output a calibration tone using table lookup and interpolation.
              ; 
              ; written by Quinn Jensen (jensenq@qcj.icon.com)
              ; ref: _Digital Sine-Wave Synthesis Using the DSP56001_,
              ;       Motorola app note APR1/D rev 1
              ;
              
              include "tdsg.a56"
              
              ;***************************************************************
              ;
              ;       sample rate computations
              ;
              ;***************************************************************
              
P:0076        dot
X:0020                org     x:$20
              
              include "caltone.inc"
              
X:0020 000007 dphase  dc      dphase_h
Y:0020                org     y:$20
Y:0020 DD4415         dc      dphase_l
X:0021                org     x:$21
X:0021 000000 phase   dc      0
000100        sinetab equ     $100
              
P:0076                org     p:dot
              ;
              ; non-interrupt code
              ;
              
P:0076        hf_init
P:0076 0004FA         ori     #4,omr
P:0077 00000C         rts
              
P:0078        eff1_on
P:0078        eff1_off
P:0078        eff2_on
P:0078        eff2_off
P:0078        eff3_on
P:0078        eff3_off
P:0078        eff4_on
P:0078        eff4_off
P:0078 00000C         rts
              
              ;
              ; fs = 32.552083 kHz
              ;
              
P:0079        hf_comp
P:0079 0D0066         jsr     <saveregs
              
              
              
P:007A 48A100         move            l:<phase,a
P:007B 43A000         move            l:<dphase,y
P:007C 20CF00         move            y0,b
P:007D 20002B         lsr     b
P:007E 21A500         move            b1,x1           ;x1 = frac
P:007F 200030         add     y,a
P:0080 47F400         move            #>$0000FF,y1
P:0081 0000FF
P:0082 200076         and     y1,a
P:0083 482100         move            a,l:<phase
P:0084 219800         move            a1,n0
P:0085 60F400         move            #sinetab,r0
P:0086 000100
P:0087 05FFA0         movec           #$FF,m0
P:0088 000000         nop
              
P:0089 4EE800         move            y:(r0+n0),y0
P:008A 20CE00         move            y0,a
              
              
P:008B 21C600         move            a,y0
P:008C 47F400         move            #ampl,y1
P:008D 16C311
P:008E 2000B1         mpyr    y0,y1,a
              
P:008F 560400         move            a,x:<out_l
P:0090 560500         move            a,x:<out_r
              
P:0091        bypass
P:0091 0D006F         jsr     <restregs
P:0092 00000C         rts
              
                      end

Summary of psect usage

                 section seg base last top      used       avail    total
-------------------------------------------------------------------------


Symbol Table
-------------------------------------
         ssi_int 000061
            ssix 000010
        eff4_off 000078
         eff4_on 000078
        eff3_off 000078
         eff3_on 000078
        eff2_off 000078
         eff2_on 000078
        eff1_off 000078
         eff1_on 000078
     init_stereo 000059
           start 000040
           in_rs 000003
           in_ls 000002
            in_r 000001
            in_l 000000
             dot 000076
            ampl 0.1778279000
        mainloop 000060
         hf_comp 000079
         hf_init 000076
        saveregs 000066
           savey 00000B
           savex 00000A
          saveb2 000009
         saveb10 000008
          savea2 000007
         savea10 000006
          dphase 000020
        dphase_h 000007
        dphase_l DD4415
        restregs 00006F
           phase 000021
         sinetab 000100
           out_r 000005
           out_l 000004
          bypass 000091
          m_scl1 00000F
          m_scl0 00000E
           m_scl 00C000
          m_ssl1 00000D
          m_ssl0 00000C
           m_ssl 003000
          m_hpl1 00000B
          m_hpl0 00000A
           m_hpl 000C00
          m_ibl2 000005
          m_ibl1 000004
          m_ibl0 000003
           m_ibl 000038
          m_ial2 000002
          m_ial1 000001
          m_ial0 000000
           m_ial 000007
           m_ipr 00FFFF
           m_rdf 000007
           m_tde 000006
           m_roe 000005
           m_tue 000004
           m_rfs 000003
           m_tfs 000002
           m_if1 000001
           m_if0 000000
            m_if 000002
          m_srie 00000F
          m_stie 00000E
           m_sre 00000D
           m_ste 00000C
           m_mod 00000B
           m_gck 00000A
           m_syn 000009
           m_fsl 000008
          m_sckd 000005
          m_scd2 000004
          m_scd1 000003
          m_scd0 000002
           m_scd 00001C
           m_of1 000001
           m_of0 000000
            m_of 000003
           m_psr 00000F
           m_wl1 00000E
           m_wl0 00000D
            m_wl 006000
            m_dc 001F00
            m_pm 0000FF
           m_tsr 00FFEE
            m_sr 00FFEE
           m_crb 00FFED
           m_cra 00FFEC
            m_tx 00FFEF
            m_rx 00FFEF
           m_tcm 00000F
           m_rcm 00000E
           m_scp 00000D
           m_cod 00000C
            m_cd 000FFF
            m_r8 000007
            m_fe 000006
            m_pe 000005
            m_or 000004
          m_idle 000003
          m_rdrf 000002
          m_tdre 000001
          m_trne 000000
          m_tmie 00000D
           m_tie 00000C
           m_rie 00000B
          m_ilie 00000A
            m_te 000009
            m_re 000008
          m_woms 000007
           m_rwi 000006
          m_wake 000005
           m_sbk 000004
          m_wds2 000002
          m_wds1 000001
          m_wds0 000000
           m_wds 000003
          m_sccr 00FFF2
           m_ssr 00FFF1
           m_scr 00FFF0
          m_stxa 00FFF3
          m_stxh 00FFF6
          m_stxm 00FFF5
          m_stxl 00FFF4
          m_srxh 00FFF6
          m_srxm 00FFF5
          m_srxl 00FFF4
           m_dma 000007
           m_hf1 000004
           m_hf0 000003
            m_hf 000018
           m_hcp 000002
          m_htde 000001
          m_hrdf 000000
           m_hf3 000004
           m_hf2 000003
          m_hcie 000002
          m_htie 000001
          m_hrie 000000
           m_htx 00FFEB
           m_hrx 00FFEB
           m_hsr 00FFE9
           m_hcr 00FFE8
           m_pcd 00FFE5
         m_pcddr 00FFE3
           m_pcc 00FFE1
           m_pbd 00FFE4
         m_pbddr 00FFE2
           m_pbc 00FFE0
           m_bcr 00FFFE
errors=0
