home *** CD-ROM | disk | FTP | other *** search
/ Sound Sensations! / sound_sensations.iso / soundb / voicekit / ctv-asm.asm < prev    next >
Assembly Source File  |  1990-02-03  |  5KB  |  280 lines

  1.  
  2.        PAGE   60,132
  3.        TITLE  Assembly routine for C.
  4.  
  5.  
  6.            ;-----------------------------------------------
  7.            ;                                              :
  8.            ; usage:                                       :
  9.            ;        name()                                :
  10.            ;-----------------------------------------------
  11.  
  12.  
  13.            EXTRN   _voice_drv             : DWORD
  14.  
  15.            PUBLIC  _ctv_version, _ctv_io_addx,
  16.            PUBLIC  _ctv_intr_num, _ctv_initial
  17.            PUBLIC  _ctv_speaker, _ctv_status_addx
  18.            PUBLIC  _ctv_output, _ctv_input
  19.            PUBLIC  _ctv_terminate, _ctv_uninstall
  20.            PUBLIC  _ctv_pause, _ctv_continue
  21.            PUBLIC  _ctv_break_loop
  22.  
  23. GET_VERSION_NUM         EQU        0
  24. SET_BASE_IO_ADDX        EQU        1
  25. SET_INTERRUPT_NUM       EQU        2
  26. INITIAL_DRIVER          EQU        3
  27. ON_OFF_SPEAKER          EQU        4
  28. SET_STATUS_ADDX         EQU        5
  29. OUTPUT_VOICE            EQU        6
  30. INPUT_VOICE             EQU        7
  31. TERMINATE_PROCESS       EQU        8
  32. UNINSTALL_DRIVER        EQU        9
  33. PAUSE_VOICE             EQU        10
  34. CONTINUE_VOICE          EQU        11
  35. BREAK_LOOP              EQU        12
  36. SET_USER_FUNCTION       EQU        13
  37.  
  38.  
  39. _TEXT  SEGMENT  WORD PUBLIC 'CODE'
  40. _TEXT  ENDS
  41. _DATA  SEGMENT  WORD PUBLIC 'DATA'
  42. _DATA  ENDS
  43. CONST  SEGMENT  WORD PUBLIC 'CONST'
  44. CONST  ENDS
  45. _BSS   SEGMENT  WORD PUBLIC 'BSS'
  46. _BSS   ENDS
  47.  
  48.  
  49. DGROUP GROUP   CONST, _BSS, _DATA
  50.        ASSUME  CS: _TEXT, DS: DGROUP, SS: DGROUP
  51.  
  52.  
  53. _DATA  SEGMENT  WORD PUBLIC 'DATA'
  54.        ASSUME   CS: _TEXT, DS: DGROUP, SS: DGROUP
  55.  
  56. _DATA  ENDS
  57.  
  58.        
  59. _TEXT  SEGMENT           WORD PUBLIC 'CODE'
  60.  
  61.  
  62. _ctv_version  PROC
  63.  
  64.        MOV    BX,GET_VERSION_NUM
  65.        CALL   _voice_drv
  66.        RET
  67.  
  68. _ctv_version  ENDP
  69.  
  70.  
  71. _ctv_io_addx   PROC
  72.  
  73.        PUSH   BP
  74.        MOV    BP,SP
  75.  
  76.        MOV    BX,SET_BASE_IO_ADDX
  77.        MOV    AX,[BP+4]
  78.        CALL   _voice_drv
  79.  
  80.        POP    BP
  81.        RET
  82.  
  83. _ctv_io_addx   ENDP
  84.  
  85.  
  86. _ctv_intr_num   PROC
  87.  
  88.        PUSH   BP
  89.        MOV    BP,SP
  90.  
  91.        MOV    BX,SET_INTERRUPT_NUM
  92.        MOV    AX,[BP+4]
  93.        CALL   _voice_drv
  94.  
  95.        POP    BP
  96.        RET
  97.  
  98. _ctv_intr_num   ENDP
  99.  
  100.  
  101. _ctv_initial   PROC
  102.  
  103.        MOV    BX,INITIAL_DRIVER
  104.        CALL   _voice_drv
  105.        RET
  106.  
  107. _ctv_initial   ENDP
  108.  
  109.  
  110. _ctv_speaker   PROC
  111.  
  112.        PUSH   BP
  113.        MOV    BP,SP
  114.  
  115.        MOV    BX,ON_OFF_SPEAKER
  116.        MOV    AX,[BP+4]
  117.        CALL   _voice_drv
  118.        POP    BP
  119.        RET
  120.  
  121. _ctv_speaker   ENDP
  122.  
  123.  
  124. STATUS_STK     STRUC
  125.  
  126.                    DW   ?
  127.                    DW   ?
  128.     STATUS_ADDX    DD   ?
  129.  
  130. STATUS_STK     ENDS
  131.  
  132. _ctv_status_addx   PROC
  133.  
  134.        PUSH   BP
  135.        MOV    BP,SP
  136.  
  137.        PUSH   ES
  138.        PUSH   DI
  139.  
  140.        LES    DI,DWORD PTR [BP + STATUS_ADDX]
  141.        MOV    BX,SET_STATUS_ADDX
  142.        CALL   _voice_drv
  143.  
  144.        POP    DI
  145.        POP    ES
  146.  
  147.        POP    BP
  148.        RET
  149.  
  150. _ctv_status_addx   ENDP
  151.  
  152.  
  153. OUTPUT_STK    STRUC
  154.  
  155.                  DW     ?
  156.                  DW     ?
  157.     OUTPUT_BUF   DD     ?
  158.  
  159. OUTPUT_STK    ENDS
  160.  
  161. _ctv_output   PROC
  162.  
  163.        PUSH   BP
  164.        MOV    BP,SP
  165.  
  166.        PUSH   ES
  167.        PUSH   DI
  168.  
  169.        MOV    BX,OUTPUT_VOICE
  170.  
  171.        LES    DI,[BP+OUTPUT_BUF]
  172.        CALL   _voice_drv
  173.  
  174.        POP    DI
  175.        POP    ES
  176.  
  177.        POP    BP
  178.        RET
  179.  
  180. _ctv_output   ENDP
  181.  
  182.  
  183. INPUT_STK    STRUC
  184.  
  185.                  DW     ?
  186.                  DW     ?
  187.     INPUT_BUF    DD     ?
  188.     BUFSIZE_L    DW     ?
  189.     BUFSIZE_H    DW     ?
  190.     SR           DW     ?
  191.  
  192. INPUT_STK    ENDS
  193.  
  194. _ctv_input   PROC
  195.  
  196.        PUSH   BP
  197.        MOV    BP,SP
  198.  
  199.        PUSH   ES
  200.        PUSH   DI
  201.  
  202.        MOV    BX,INPUT_VOICE
  203.        MOV    AX,[BP+SR]
  204.        MOV    DX,[BP+BUFSIZE_H]
  205.        MOV    CX,[BP+BUFSIZE_L]
  206.        LES    DI,[BP+INPUT_BUF]
  207.  
  208.        CALL   _voice_drv
  209.  
  210.        POP    DI
  211.        POP    ES
  212.  
  213.        POP    BP
  214.        RET
  215.  
  216. _ctv_input   ENDP
  217.  
  218.  
  219. _ctv_terminate   PROC
  220.  
  221.        PUSH   BP
  222.  
  223.        MOV    BX,TERMINATE_PROCESS
  224.        CALL   _voice_drv
  225.        POP    BP
  226.        RET
  227.  
  228. _ctv_terminate   ENDP
  229.  
  230.  
  231. _ctv_uninstall   PROC
  232.  
  233.        PUSH   BP
  234.  
  235.        MOV    BX,UNINSTALL_DRIVER
  236.        CALL   _voice_drv
  237.        POP    BP
  238.        RET
  239.  
  240. _ctv_uninstall   ENDP
  241.  
  242.  
  243. _ctv_pause       PROC
  244.  
  245.        MOV    BX,PAUSE_VOICE
  246.        CALL   _voice_drv
  247.        RET
  248.  
  249. _ctv_pause       ENDP
  250.  
  251.  
  252. _ctv_continue    PROC
  253.  
  254.        MOV    BX,CONTINUE_VOICE
  255.        CALL   _voice_drv
  256.        RET
  257.  
  258. _ctv_continue    ENDP
  259.  
  260.  
  261. _ctv_break_loop  PROC
  262.  
  263.        PUSH   BP
  264.        MOV    BP,SP
  265.  
  266.        MOV    AX,[BP+4]
  267.        MOV    BX,BREAK_LOOP
  268.        CALL   _voice_drv
  269.  
  270.        POP    BP
  271.        RET
  272.  
  273. _ctv_break_loop  ENDP
  274.  
  275. _TEXT  ENDS
  276.        END
  277.  
  278.  
  279.  
  280.