home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / e_os300b / wc_asm / wc_asm.asm < prev   
Encoding:
Assembly Source File  |  1996-11-26  |  3.0 KB  |  102 lines

  1. ;╔══════════════════════════════════════════════════════════════════════════╗
  2. ;║                                                                          ║
  3. ;║ This example show how to use EOS and the Diamond player with the watcom  ║
  4. ;║ and Flat memory model                                                    ║
  5. ;║                                                                          ║
  6. ;║ Tabs : 13 21 29 37                                                       ║
  7. ;║                                                                          ║
  8. ;╚══════════════════════════════════════════════════════════════════════════╝
  9.  
  10. .386
  11. .model flat
  12. .stack 4096
  13. .data
  14. INCLUDE ..\RESOURCE\EOS.INC
  15.  
  16. Module_Name db '..\data\test.mod',0
  17.  
  18. Msg_Module  db '    ■ Module Not Found...',13,10,36
  19. Msg_Playing db '    ■ Playing Module',13,10,36
  20. Msg_Paused  db '    ■ Paused',13,10,36
  21.  
  22.  
  23. public      _psp                    ; Simulate the _psp variable from watcom
  24. _psp        dw 0
  25.  
  26. .code
  27.  
  28. Start32:
  29.             mov [_psp],es           ; These instruction must be first
  30.             call Init_EOS           ; execute to enable all EOS function
  31.             push ds                 ;
  32.             pop es                  ;
  33.  
  34.             mov ah,Detect_Sound_Card
  35.             xor bx,bx               ; Find the Best One (Gravis ;))
  36.             mov cx,1                ; Display the results
  37.             Int_EOS                 ; You must use this function before using
  38.                                     ; the player
  39.  
  40.             mov ah,Load_Module
  41.             mov al,0                ; Normal Load
  42.             mov bx,44000            ; Set Replay Rate For SB
  43.             mov edx,O Module_Name
  44.             Int_EOS
  45.             jnc Load_Ok             ; Can Load ??
  46.  
  47.             mov ah,Exit_Error       ; No Exit with Exit_Error function
  48.             mov edx,O Msg_Module    ; en Display Message
  49.             Int_EOS
  50. Load_Ok:
  51.  
  52.             mov ah,Play_Module      ; Start playing module
  53.             Int_EOS
  54.  
  55.             mov ah,9                ; Display Message
  56.             mov edx,O Msg_Playing
  57.             int 21h
  58.  
  59.             xor ah,ah               ; Wait A key
  60.             Int 16h
  61.  
  62.             mov ah,Stop_Module      ; Stop  playing module
  63.             Int_EOS
  64.  
  65.             mov ah,9                ; Display Message
  66.             mov edx,O Msg_Paused
  67.             int 21h
  68.  
  69.             xor ah,ah               ; Wait A key
  70.             Int 16h
  71.  
  72.             mov ah,Play_Module      ; ReStart playing module
  73.             Int_EOS
  74.  
  75.             mov ah,9                ; Display Message
  76.             mov edx,O Msg_Playing
  77.             int 21h
  78.  
  79.             xor ah,ah               ; Wait A key
  80.             Int 16h
  81.  
  82.             mov ah,Stop_Module      ; Stop  playing module
  83.             Int_EOS
  84.  
  85.             mov ah,Clear_Module     ; Unload module From memory
  86.             Int_EOS
  87.  
  88.             mov ax,4c00h            ; Exit with error code 0
  89.             int 21h
  90.  
  91.  
  92.  
  93.             END Start32
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.