home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / CRYS250.ZIP / CRYSTAL.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-01-11  |  25.9 KB  |  1,296 lines

  1. ;**************************************************************************
  2. ;*    mini player de mod sur le PC speaker ou le port parallèle
  3. ;*
  4. ;* Programmé par Sébastien Granjoux
  5. ;* Commencé en février 93
  6. ;* Dernière modif 11/01/93
  7.  
  8.  
  9. IDEAL
  10.  
  11. P386N
  12. MODEL    SMALL
  13.  
  14. PUBLIC    main
  15. PUBLIC    CHRONO
  16.  
  17.  
  18. EXTRN    putbar:near
  19. EXTRN    puttxt:near
  20. EXTRN    setmode:near
  21. EXTRN    resetmode:near
  22. EXTRN    getname:near
  23. EXTRN    getinst:near
  24. EXTRN    getdevice:near
  25. EXTRN    getmaxseq:near
  26. EXTRN    dectostr:near
  27. EXTRN    gettempo:near
  28. EXTRN    getpattern:near
  29. EXTRN    getvoice:near
  30. EXTRN    gonextpos:near
  31.  
  32. EXTRN    CHANGEVOL:far
  33. EXTRN    DETECTSND:far
  34. EXTRN    MLOADMOD:far
  35. EXTRN    FLOADMOD:far
  36. EXTRN    OLOADMOD:far
  37. EXTRN    UNLOADMOD:far
  38. EXTRN    SETMOD:far
  39. EXTRN    MAKEMOD:far
  40. EXTRN    STARTMOD:far
  41. EXTRN    STOPMOD:far
  42. EXTRN    Timer:dword
  43. EXTRN    Nb_voice:far
  44.  
  45. INCLUDE "CRYSTAL.INC"
  46.  
  47. DATASEG
  48.  
  49. VERSION_MSG    DB 0,0,1bh,'Crystal Player Version 2.50 Programmé par Sébastien Granjoux         le 11/01/95',0
  50. MUSIQUE_MSG    DB 2,1,07h,'Musique :',0
  51. MUSIQUE_NAME    DB 12,1,0bh,'                    ',0
  52. DEVICE_MSG    DB 34,1,07h,'Sur',0
  53. DEVICE_NAME    DB 38,1,0bh,'                                ',0
  54. PATTERN_MSG    DB 2,2,07h,'Pattern :',0
  55. PATTERN_NB    DB 12,2,0bh,'  4',0
  56. SEQUENCE_MSG    DB 16,2,07h,'Sequence :',0
  57. SEQUENCE_NB    DB 27,2,0bh,'  2/  8',0
  58. LIGNE_MSG    DB 36,2,07h,'Ligne :',0
  59. LIGNE_NB    DB 43,2,0bh,' 12',0
  60. TEMPO_MSG    DB 48,2,07h,'Tempo :',0
  61. TEMPO_NB    DB 55,2,0bh,' 32/125',0
  62. VOICE_BOX1    DB 0,03,9h,'┌────────────────────────┬────┬─────┬──────────────────┬───────────────────────┐',0
  63. VOICE_BOX2    DB 0,04,9h,'│                        │    │     │                  │                       │',0
  64. VOICE_BOX3    DB 0,05,9h,'│                        │    │     │                  │                       │',0
  65. VOICE_BOX4    DB 0,06,9h,'│                        │    │     │                  │                       │',0
  66. VOICE_BOX5    DB 0,07,9h,'│                        │    │     │                  │                       │',0
  67. VOICE_BOX6    DB 0,08,9h,'│                        │    │     │                  │                       │',0
  68. VOICE_BOX7    DB 0,09,9h,'│                        │    │     │                  │                       │',0
  69. VOICE_BOX8    DB 0,10,9h,'│                        │    │     │                  │                       │',0
  70. VOICE_BOX9    DB 0,11,9h,'│                        │    │     │                  │                       │',0
  71. VOICE_BOX10    DB 0,12,9h,'└────────────────────────┴────┴─────┴──────────────────┴───────────────────────┘',0
  72. INSTRUMENTV1    DB 2,04,0fh,'                      ',0
  73. VOLUMEV1    DB 26,04,03h,' 64',0
  74. NOTEV1        DB 32,04,0ah,'   ',0
  75. EFFETV1        DB 38,04,05h,'                ',0
  76. INSTRUMENTV2    DB 2,05,0fh,'                      ',0
  77. VOLUMEV2    DB 26,05,03h,' 64',0
  78. NOTEV2        DB 32,05,0ah,'   ',0
  79. EFFETV2        DB 38,05,05h,'                ',0
  80. INSTRUMENTV3    DB 2,06,0fh,'                      ',0
  81. VOLUMEV3    DB 26,06,03h,' 64',0
  82. NOTEV3        DB 32,06h,0ah,'   ',0
  83. EFFETV3        DB 38,06,05h,'                ',0
  84. INSTRUMENTV4    DB 2,07,0fh,'                      ',0
  85. VOLUMEV4    DB 26,07,03h,' 64',0
  86. NOTEV4        DB 32,07,0ah,'   ',0
  87. EFFETV4        DB 38,07,05h,'                ',0
  88. INSTRUMENTV5    DB 2,08,0fh,'                      ',0
  89. VOLUMEV5    DB 26,08,03h,' 64',0
  90. NOTEV5        DB 32,08,0ah,'   ',0
  91. EFFETV5        DB 38,08,05h,'                ',0
  92. INSTRUMENTV6    DB 2,09,0fh,'                      ',0
  93. VOLUMEV6    DB 26,09,03h,' 64',0
  94. NOTEV6        DB 32,09,0ah,'   ',0
  95. EFFETV6        DB 38,09,05h,'                ',0
  96. INSTRUMENTV7    DB 2,10,0fh,'                      ',0
  97. VOLUMEV7    DB 26,10,03h,' 64',0
  98. NOTEV7        DB 32,10,0ah,'   ',0
  99. EFFETV7        DB 38,10,05h,'                ',0
  100. INSTRUMENTV8    DB 2,11,0fh,'                      ',0
  101. VOLUMEV8    DB 26,11,03h,' 64',0
  102. NOTEV8        DB 32,11,0ah,'   ',0
  103. EFFETV8        DB 38,11,05h,'                ',0
  104. AIDES        DB 0,24,1bh,'      Sortir du programme      Stopper la musique         Changer de position   ',0
  105. AIDES_PAUSED    DB 0,24,1bh,'      Sortir du programme      Reprendre la musique       Changer de position   ',0
  106. STOPPER        DB 2,24,1ah,'Esc',0
  107. PAUSER        DB 29,24,1ah,'P',0
  108. CHANGER        DB 56,24,1ah,'+',0
  109. INSTRUMENT1    DB 4,13,0bh,'instrument1           ',0
  110. INSTRUMENT2    DB 4,14,0bh,'instrument2           ',0
  111. INSTRUMENT3    DB 4,15,0bh,'instrument3           ',0
  112. INSTRUMENT4    DB 4,16,0bh,'instrument4           ',0
  113. INSTRUMENT5    DB 4,17,0bh,'instrument5           ',0
  114. INSTRUMENT6    DB 4,18,0bh,'instrument6           ',0
  115. INSTRUMENT7    DB 4,19,0bh,'instrument7           ',0
  116. INSTRUMENT8    DB 4,20,0bh,'instrument8           ',0
  117. INSTRUMENT9    DB 4,21,0bh,'instrument9           ',0
  118. INSTRUMENT10    DB 4,22,0bh,'instrument10          ',0
  119. INSTRUMENT11    DB 4,23,0bh,'instrument11          ',0
  120. INSTRUMENT12    DB 31,13,0bh,'instrument12          ',0
  121. INSTRUMENT13    DB 31,14,0bh,'instrument13          ',0
  122. INSTRUMENT14    DB 31,15,0bh,'instrument14          ',0
  123. INSTRUMENT15    DB 31,16,0bh,'instrument15          ',0
  124. INSTRUMENT16    DB 31,17,0bh,'instrument16          ',0
  125. INSTRUMENT17    DB 31,18,0bh,'instrument17          ',0
  126. INSTRUMENT18    DB 31,19,0bh,'instrument18          ',0
  127. INSTRUMENT19    DB 31,20,0bh,'instrument19          ',0
  128. INSTRUMENT20    DB 31,21,0bh,'instrument20          ',0
  129. INSTRUMENT21    DB 31,22,0bh,'instrument21          ',0
  130. INSTRUMENT22    DB 58,13,0bh,'instrument22          ',0
  131. INSTRUMENT23    DB 58,14,0bh,'instrument23          ',0
  132. INSTRUMENT24    DB 58,15,0bh,'instrument24          ',0
  133. INSTRUMENT25    DB 58,16,0bh,'instrument25          ',0
  134. INSTRUMENT26    DB 58,17,0bh,'instrument26          ',0
  135. INSTRUMENT27    DB 58,18,0bh,'instrument27          ',0
  136. INSTRUMENT28    DB 58,19,0bh,'instrument28          ',0
  137. INSTRUMENT29    DB 58,20,0bh,'instrument29          ',0
  138. INSTRUMENT30    DB 58,21,0bh,'instrument30          ',0
  139. INSTRUMENT31    DB 58,22,0bh,'instrument31          ',0
  140.  
  141. PAGE2        EQU    200h
  142.  
  143. NB_MSG        EQU    70+20
  144. NB_REFRESH    EQU    20+16
  145. NB_HELP        EQU    4
  146.  
  147. LIST_MSG        DW OFFSET PATTERN_NB
  148.         DW OFFSET SEQUENCE_NB
  149.         DW OFFSET LIGNE_NB
  150.         DW OFFSET TEMPO_NB
  151.         DW OFFSET INSTRUMENTV1
  152.         DW OFFSET VOLUMEV1
  153.         DW OFFSET NOTEV1
  154.         DW OFFSET EFFETV1
  155.         DW OFFSET INSTRUMENTV2
  156.         DW OFFSET VOLUMEV2
  157.         DW OFFSET NOTEV2
  158.         DW OFFSET EFFETV2
  159.         DW OFFSET INSTRUMENTV3
  160.         DW OFFSET VOLUMEV3
  161.         DW OFFSET NOTEV3
  162.         DW OFFSET EFFETV3
  163.         DW OFFSET INSTRUMENTV4
  164.         DW OFFSET VOLUMEV4
  165.         DW OFFSET NOTEV4
  166.         DW OFFSET EFFETV4
  167.         DW OFFSET INSTRUMENTV5
  168.         DW OFFSET VOLUMEV5
  169.         DW OFFSET NOTEV5
  170.         DW OFFSET EFFETV5
  171.         DW OFFSET INSTRUMENTV6
  172.         DW OFFSET VOLUMEV6
  173.         DW OFFSET NOTEV6
  174.         DW OFFSET EFFETV6
  175.                 DW OFFSET INSTRUMENTV7
  176.         DW OFFSET VOLUMEV7
  177.         DW OFFSET NOTEV7
  178.         DW OFFSET EFFETV7
  179.         DW OFFSET INSTRUMENTV8
  180.         DW OFFSET VOLUMEV8
  181.         DW OFFSET NOTEV8
  182.         DW OFFSET EFFETV8
  183.         DW OFFSET VOICE_BOX2
  184.         DW OFFSET VOICE_BOX3
  185.         DW OFFSET VOICE_BOX4
  186.         DW OFFSET VOICE_BOX5
  187.                 DW OFFSET VOICE_BOX6
  188.         DW OFFSET VOICE_BOX7
  189.         DW OFFSET VOICE_BOX8
  190.         DW OFFSET VOICE_BOX9
  191.         DW OFFSET VERSION_MSG
  192.         DW OFFSET MUSIQUE_MSG
  193.         DW OFFSET MUSIQUE_NAME
  194.         DW OFFSET DEVICE_MSG
  195.         DW OFFSET DEVICE_NAME
  196.         DW OFFSET PATTERN_MSG
  197.         DW OFFSET SEQUENCE_MSG
  198.         DW OFFSET LIGNE_MSG
  199.         DW OFFSET TEMPO_MSG
  200.         DW OFFSET VOICE_BOX1
  201.         DW OFFSET VOICE_BOX10
  202. BARRE_HELP    DW OFFSET AIDES
  203.         DW OFFSET STOPPER
  204.         DW OFFSET PAUSER
  205.         DW OFFSET CHANGER
  206.         DW OFFSET INSTRUMENT1
  207.         DW OFFSET INSTRUMENT2
  208.         DW OFFSET INSTRUMENT3
  209.         DW OFFSET INSTRUMENT4
  210.         DW OFFSET INSTRUMENT5
  211.         DW OFFSET INSTRUMENT6
  212.         DW OFFSET INSTRUMENT7
  213.         DW OFFSET INSTRUMENT8
  214.         DW OFFSET INSTRUMENT9
  215.         DW OFFSET INSTRUMENT10
  216.         DW OFFSET INSTRUMENT11
  217.         DW OFFSET INSTRUMENT12
  218.         DW OFFSET INSTRUMENT13
  219.         DW OFFSET INSTRUMENT14
  220.         DW OFFSET INSTRUMENT15
  221.         DW OFFSET INSTRUMENT16
  222.         DW OFFSET INSTRUMENT17
  223.         DW OFFSET INSTRUMENT18
  224.         DW OFFSET INSTRUMENT19
  225.         DW OFFSET INSTRUMENT20
  226.         DW OFFSET INSTRUMENT21
  227.         DW OFFSET INSTRUMENT22
  228.         DW OFFSET INSTRUMENT23
  229.         DW OFFSET INSTRUMENT24
  230.         DW OFFSET INSTRUMENT25
  231.         DW OFFSET INSTRUMENT26
  232.         DW OFFSET INSTRUMENT27
  233.         DW OFFSET INSTRUMENT28
  234.         DW OFFSET INSTRUMENT29
  235.         DW OFFSET INSTRUMENT30
  236.         DW OFFSET INSTRUMENT31
  237.  
  238. LIST_NOTES      DB 'C-0',0,'C#0',0,'D-0',0,'D#0',0,'E-0',0,'F-0',0,'F#0',0
  239.         DB 'G-0',0,'G#0',0,'A-0',0,'A#0',0,'B-0',0
  240.         DB 'C-1',0,'C#1',0,'D-1',0,'D#1',0,'E-1',0,'F-1',0,'F#1',0
  241.         DB 'G-1',0,'G#1',0,'A-1',0,'A#1',0,'B-1',0
  242.         DB 'C-2',0,'C#2',0,'D-2',0,'D#2',0,'E-2',0,'F-2',0,'F#2',0
  243.         DB 'G-2',0,'G#2',0,'A-2',0,'A#2',0,'B-2',0,'   ',0
  244.  
  245.         DB 'C-3',0,'C#3',0,'D-3',0,'D#3',0,'E-3',0,'F-3',0,'F#3',0
  246.         DB 'G-3',0,'G#3',0,'A-3',0,'A#3',0,'B-3',0
  247.         DB 'C-4',0,'C#4',0,'D-4',0,'D#4',0,'E-4',0,'F-4',0,'F#4',0
  248.         DB 'G-4',0,'G#4',0,'A-4',0,'A#4',0,'B-4',0
  249.         DB 'C-5',0,'C#5',0,'D-5',0,'D#5',0,'E-5',0,'F-5',0,'F#5',0
  250.         DB 'G-5',0,'G#5',0,'A-5',0,'A#5',0,'B-5',0,'   ',0
  251.  
  252.         DB 'C-6',0,'C#6',0,'D-6',0,'D#6',0,'E-6',0,'F-6',0,'F#6',0
  253.         DB 'G-6',0,'G#6',0,'A-6',0,'A#6',0,'B-6',0
  254.         DB 'C-7',0,'C#7',0,'D-7',0,'D#7',0,'E-7',0,'F-7',0,'F#7',0
  255.         DB 'G-7',0,'G#7',0,'A-7',0,'A#7',0,'B-7',0,'   ',0
  256.  
  257. LIST_EFFET    DB 'ARPEGGIO        '
  258.         DB 'PORTAMENTO UP   '
  259.         DB 'PORTAMENTO DOWN '
  260.         DB 'TONE PORTAMENTO '
  261.         DB 'VIBRATO         '
  262.         DB 'PORTAMENTO+SLIDE'
  263.         DB 'VIBRATO+SLIDE   '
  264.         DB 'TREMOLO         '
  265.         DB 'PHASOR EFFECT   '
  266.         DB 'PLAY SAMPLE PART'
  267.         DB 'VOLUME SLIDE    '
  268.         DB 'POSITION JUMP   '
  269.         DB 'SET VOLUME      '
  270.         DB 'PATTERN BREAK   '
  271.         DB '                '
  272.         DB 'SET SPEED       '
  273.         DB 'SET FILTER      '
  274.         DB 'FINE PORT UP    '
  275.         DB 'FINE PORT DOWN  '
  276.         DB 'SET GLISSANDO   '
  277.         DB 'SET VIBRATO     '
  278.         DB 'SET FINETUNE    '
  279.         DB 'LOOP            '
  280.         DB 'SET TREMOLO     '
  281.         DB 'STOP            '
  282.         DB 'RETTRIG SAMPLE  '
  283.         DB 'FINE SLIDE UP   '
  284.         DB 'FINE SLIDE DOWN '
  285.         DB 'NOTE CUT        '
  286.         DB 'NOTE DELAY      '
  287.         DB 'PATTERN DELAY   '
  288.         DB '                '
  289.  
  290. PROGRAM_MSG    DB 'Crystal Player V2.50 Par Sébastien Granjoux',09h,09h,09h,09h,'11/01/95',0dh,0ah
  291.         DB 0ah,0dh
  292.         DB 'Ce programme est un freeware permettant de jouer des fichiers MOD.',0ah,0dh
  293.         DB 'La musique peut être sortie sur le PC speaker, un DAC sur un port parallèle,',0ah,0dh
  294.         DB 'une soundblaster ou une Gravis Ultra Sound.',0ah,0dh
  295.         DB 'Il s''utilise de la manière suivante :',0dh,0ah,0dh,0ah
  296.         DB 09h,'CRYS [/SK] [/DCl] [/SBp,i] [GSp] [/FRf] nom du fichier mod',0dh,0ah
  297.                 DB 0ah,0dh
  298.                 DB 09h,'  /SK permet d''utiliser le speaker',0dh,0ah
  299.         DB 09h,'  /DCl permet d''utiliser un DAC sur le port parallèle l(1-4)',0dh,0ah
  300.         DB 09h,'  /SBp,i permet d''utiliser une soundblaster sur le port p avec l''irq i',0dh,0ah
  301.         DB 09h,'  /GSp permet d''utiliser une GUS sur le port p',0dh,0ah
  302.         DB 09h,'  /FRf permet de donner la fréquence de mixage en centaine de Hz',0dh,0ah
  303.         DB 0dh,0ah,'Par défaut le player recherche dans les variables d''environnement la carte',0dh,0ah
  304.                 DB 'sonore à utiliser ou les paramètres manquant et joue à 19kHZ.',0dh,0ah
  305.         DB 0dh,0ah
  306.         DB '$'
  307.  
  308.  
  309. FIRST_ERROR    EQU    1
  310. LAST_ERROR    EQU    17
  311.  
  312. UNKNOW_ERROR    DB    'Erreur inconnu$'
  313. ERROR1        DB    'Fonction inconnu$'
  314. ERROR2        DB    'Fichier introuvable$'
  315. ERROR3        DB    'Chemin introuvable$'
  316. ERROR4        DB    'Trop de fichier ouvert$'
  317. ERROR5        DB    'Accès refusé$'
  318. ERROR6        DB    'Handle inconnu$'
  319. ERROR7        DB    'Bloc de contrôle mémoire détruit$'
  320. ERROR8        DB    'Mémoire insuffisante$'
  321. ERROR9        DB    'Adresse mémoire incorrect$'
  322. ERROR10        DB    'Environnement incorrect$'
  323. ERROR11        DB    'Trop de pattern$'
  324. ERROR12        DB    'Sample trop grand$'
  325. ERROR13        DB    'Port parallèle introuvable$'
  326. ERROR14        DB    'Sound blaster introuvable$'
  327. ERROR15        DB    'GUS introuvable$'
  328. ERROR16        DB    'Pas assez de mémoire sur la GUS$'
  329.  
  330. MSG_ERROR    DW    OFFSET ERROR1
  331.         DW    OFFSET ERROR2
  332.         DW    OFFSET ERROR3
  333.         DW    OFFSET ERROR4
  334.         DW    OFFSET ERROR5
  335.         DW    OFFSET ERROR6
  336.         DW    OFFSET ERROR7
  337.         DW    OFFSET ERROR8
  338.         DW    OFFSET ERROR9
  339.         DW    OFFSET ERROR10
  340.         DW    OFFSET ERROR11
  341.         DW    OFFSET ERROR12
  342.         DW    OFFSET ERROR13
  343.         DW    OFFSET ERROR14
  344.         DW    OFFSET ERROR15
  345.         DW    OFFSET ERROR16
  346.         DW    OFFSET PROGRAM_MSG
  347.  
  348. BAD_ARG        EQU    17
  349.  
  350. TNOMBRE         EQU 12
  351.  
  352. NOMBRE          DB TNOMBRE DUP (0)
  353.         DB '$'
  354.  
  355. T_INITIAL       DD 0
  356. CHRONO          DD 0
  357. PASSAGE         DD 0
  358. Old_int9    DD 0
  359.  
  360. Device        DB THE_BEST
  361. Port        DW 0
  362. Irq        DB 0
  363. Dma        DB 0
  364. MixSpeed    DW 0
  365.  
  366. USINGMSG    DB    'Utilisation $'
  367. DEVICEMSG    DW    OFFSET NOS_DEV,0
  368.         DW    OFFSET SPK_DEV,0
  369.         DW    OFFSET DAC_DEV,1
  370.         DW    OFFSET SB_DEV,3
  371.         DW    OFFSET GUS_DEV,1
  372.  
  373. NOS_DEV        DB    'd''aucun son $'
  374. SPK_DEV        DB    'du haut parleur interne $'
  375. DAC_DEV        DB    'd''un DAC sur le port parallèle $'
  376. SB_DEV        DB    'd''une SoundBlaster à l''adresse $'
  377. GUS_DEV        DB    'd''une Gravis Ultra Sound à l''adresse $'
  378.  
  379. IRQMSG        DB    ' utilisant l''IRQ $'
  380. DMAMSG        DB    ' et le DMA 1$'
  381. NEWLINE        DB    0ah,0dh,'$'
  382. GUSMSG        DB    'Chargement des samples ...',0ah,0dh,'$'
  383.  
  384. Pause        DB 0
  385. MVol        DB 255
  386.  
  387. Filename    DB 128+4 DUP (0);
  388.  
  389. CODESEG
  390.  
  391. PROC    main
  392.  
  393.  
  394.     push    es
  395.     push    ds
  396.     pop    es
  397.     pop    ds
  398.     mov    si,80h
  399.     mov    di,OFFSET Filename
  400.     call    getarg
  401.     push    es
  402.     pop    ds
  403.     cmp    al,1
  404.     jae    @@mod_file_ok
  405.     mov    ax,BAD_ARG
  406.     jmp    error
  407. @@mod_file_ok:
  408.  
  409.     mov    si,OFFSET Filename
  410.     mov    di,si
  411.     mov    bx,OFFSET Irq
  412. @@get_arg:
  413.     lodsb
  414.         cmp    al,'-'
  415.         je    @@get_switch
  416.     cmp    al,','
  417.     je    @@get_sup
  418.         or    al,al
  419.     je    @@line_used
  420.  
  421. @@get_file:
  422.         stosb
  423.     lodsb
  424.     or    al,al
  425.     jne    @@get_file
  426.         jmp    @@get_arg
  427.  
  428. @@get_sup:
  429.     mov    ax,BAD_ARG
  430.     cmp    bx,OFFSET Dma
  431.     ja    error
  432.     call    get_dec
  433.     jc    @@no_sup
  434.         mov    [bx],al
  435. @@no_sup:
  436.     inc    si
  437.     inc    bx
  438.         jmp    @@get_arg
  439.  
  440. @@get_switch:
  441.     mov    bx,OFFSET Irq
  442.         lodsw
  443.     cmp    ax,'RF'
  444.     je    @@get_freq
  445.     cmp    ax,'BS'
  446.         je    @@get_sb
  447.         cmp    ax,'KS'
  448.     je    @@get_spk
  449.     cmp    ax,'CD'
  450.         je    @@get_dac
  451.         cmp    ax,'SG'
  452.     je    @@get_gus
  453.     mov    ax,BAD_ARG
  454.         jmp    error
  455. @@get_freq:
  456.     call    get_dec
  457.     inc    si
  458.     mov    [MixSpeed],ax
  459.         jmp    @@get_arg
  460. @@get_spk:
  461.     mov    [Device],PC_SPEAKER
  462.     lodsb
  463.     or    al,al
  464.     je    @@get_arg
  465.     mov    ax,BAD_ARG
  466.         jmp    error
  467. @@get_dac:
  468.     mov    [Device],DAC_ON_LPT
  469.     jmp    @@get_device
  470. @@get_sb:
  471.     mov    [Device],SOUNDBLASTER
  472.     jmp    @@get_device
  473. @@get_gus2:
  474.     mov    [Device],GUS+1
  475.     jmp    @@get_device
  476. @@get_gus:
  477.     mov    [Device],GUS
  478. @@get_device:
  479.     call    get_hex
  480.     inc    si
  481.     jc    @@get_arg
  482.         mov    [Port],ax
  483.         jmp    @@get_arg
  484.  
  485. @@line_used:
  486.     mov    eax,[ds:di-4]
  487. @@search_ext:
  488.     cmp    al,'.'
  489.     je    @@find_ext
  490.     shr    eax,8
  491.     jne    @@search_ext
  492.     mov    [dword ptr ds:di],'DOM.'
  493.     add    di,4
  494. @@find_ext:
  495.     xor    al,al
  496.     stosb
  497.  
  498.     push    ds
  499.     push    OFFSET Device
  500.     push    ds
  501.     push    OFFSET Port
  502.     push    ds
  503.     push    OFFSET Irq
  504.     push    ds
  505.     push    OFFSET Dma
  506.     call    Detectsnd
  507.  
  508.     cmp    [byte ptr ds:Device],5
  509.     jb    @@device_found
  510.     mov    [byte ptr ds:Device],1
  511. @@device_found:
  512.  
  513.     push    ds
  514.     push    OFFSET Filename
  515.     call      far Floadmod
  516.     jc    error
  517.  
  518.     mov    [dword ptr cs:OFFSET Timer],0
  519.     mov    [dword ptr ds:OFFSET PASSAGE],0
  520.     mov    [dword ptr ds:OFFSET  CHRONO],0
  521.  
  522.     call    putcard
  523.  
  524.     push    [MixSpeed]
  525.     push    [word ptr ds:OFFSET Device]
  526.     push    [word ptr ds:OFFSET Port]
  527.     push    [word ptr ds:OFFSET Irq]
  528.  
  529.     call    far Setmod
  530.     jc    error
  531.  
  532.     mov    ax,ds
  533.     mov    es,ax
  534.     mov    di,OFFSET MUSIQUE_NAME+3
  535.     call    getname
  536.  
  537.     mov    di,OFFSET DEVICE_NAME+3
  538.     mov    dl,[Device]
  539.     call    getdevice
  540.  
  541.     call    getmaxseq
  542.     mov    di,OFFSET SEQUENCE_NB+7
  543.     call    dectostr
  544.  
  545.     mov    di,OFFSET INSTRUMENT1+3
  546.     mov    cl,31
  547. @@next_inst:
  548.     push    cx
  549.     push    di
  550.     call    getinst
  551.     pop    di
  552.  
  553.     push    es
  554.     mov    ax,ds
  555.     mov    es,ax
  556.     mov    cx,23
  557.     xor    al,al
  558. @@continue:
  559.     repne    scasb
  560.     or    cx,cx
  561.     je    @@fin_remplacement
  562.     mov    [byte ptr es:di-1],' '
  563.     jmp    @@continue
  564. @@fin_remplacement:
  565.     pop    es
  566.     add    di,3
  567.     pop    cx
  568.     dec    cl
  569.     jne    @@next_inst
  570.  
  571.     call    setmode
  572.  
  573.     mov    cx,NB_MSG
  574.     mov    bx,OFFSET LIST_MSG
  575. @@next_msg:
  576.     mov    si,[ds:bx]
  577.     add    bx,2
  578.     mov        dx,[ds:si]
  579.     mov    ah,[ds:si+2]
  580.     add    si,3
  581.     call    puttxt
  582.     dec    cx
  583.     jne    @@next_msg
  584.  
  585.     mov    cx,NB_MSG
  586.     mov    bx,OFFSET LIST_MSG
  587. @@next_msg2:
  588.     mov    si,[ds:bx]
  589.     add    bx,2
  590.     mov        dx,[ds:si]
  591.     mov    ah,[ds:si+2]
  592.     add    si,3
  593.     call    puttxt
  594.     dec    cx
  595.     jne    @@next_msg2
  596.  
  597.       call    far Makemod
  598.       call    far Makemod
  599.  
  600.       push    es
  601.       mov    ax,3509h
  602.       int       21h
  603.       mov       [word ptr ds:OFFSET Old_int9],bx
  604.       mov       [word ptr ds:OFFSET Old_int9+2],es
  605.       cli
  606.       pop    es
  607.       push    ds
  608.       mov    ax,cs
  609.       mov    ds,ax
  610.       mov       dx,OFFSET hitkey
  611.       mov    ax,2509h
  612.       int       21h
  613.       pop    ds
  614.  
  615.       sti
  616.  
  617.       call      far Startmod
  618.  
  619. boucle:
  620.  
  621.       call    refresh
  622.  
  623.       push    es
  624.       mov    ax,SEG Timer
  625.       mov    es,ax
  626.       mov       eax,[dword ptr es:OFFSET Timer]
  627.       mov       [dword ptr ds:T_INITIAL],eax
  628.     call      far MAKEMOD
  629.       mov    ax,SEG Timer
  630.       mov    es,ax
  631.       mov       eax,[dword ptr es:OFFSET Timer]
  632.       pop    es
  633.  
  634.       sub       eax,[dword ptr ds:T_INITIAL]
  635.       cmp       eax,[dword ptr ds:CHRONO]
  636.       jbe       plus_court
  637.       mov       [dword ptr ds:CHRONO],eax
  638. plus_court:
  639.  
  640.     mov    al,[cs:Key]
  641.     cmp    al,1
  642.     je    @@exit
  643.     cmp    al,25
  644.     je    @@pause
  645.     cmp    al,78
  646.     je    @@next_pos
  647.     cmp    al,74
  648.     je    @@vol_down
  649.  
  650.     jmp    boucle
  651.  
  652.  
  653.     mov    ax,3100h
  654.     int    21h
  655.  
  656.  
  657. @@pause:
  658.       cmp    [Pause],0
  659.       je    @@start_pause
  660.  
  661.       mov    [Pause],0
  662.       call    far Startmod
  663.       mov    [word ptr ds:OFFSET BARRE_HELP],OFFSET AIDES
  664.       jmp    @@show_help_bar
  665.  
  666. @@start_pause:
  667.       mov    [Pause],1
  668.       call    far Stopmod
  669.       mov    [word ptr ds:OFFSET BARRE_HELP],OFFSET AIDES_PAUSED
  670.  
  671. @@show_help_bar:
  672.  
  673.     mov    cx,NB_HELP
  674.     mov    bx,OFFSET BARRE_HELP
  675. @@next_msg3:
  676.     mov    si,[ds:bx]
  677.     add    bx,2
  678.     mov        dx,[ds:si]
  679.     mov    ah,[ds:si+2]
  680.     add    si,3
  681.     call    puttxt
  682.     dec    cx
  683.     jne    @@next_msg3
  684.  
  685.     mov    [cs:Key],0
  686.     jmp    boucle
  687.  
  688. @@next_pos:
  689.     mov    [cs:Key],0
  690.  
  691.     call    gonextpos
  692.  
  693.     jmp    boucle
  694. @@vol_down:
  695.     mov    [cs:Key],0
  696.     dec    [ds:MVol]
  697.     mov    al,[ds:MVol]
  698.     push    ax
  699.     call    CHANGEVOL
  700.     jmp    boucle
  701.  
  702. @@exit:
  703.     cli
  704.  
  705.       call      far Stopmod
  706.       push    ds
  707.       mov    ax,2509h
  708.       lds       dx,[dword ptr ds:OFFSET Old_int9]
  709.       int       21h
  710.       pop    ds
  711.       sti
  712.  
  713.       call    resetmode
  714.  
  715.       call      Unloadmod
  716.  
  717.       mov       cx,TNOMBRE
  718.       mov       di,OFFSET NOMBRE+TNOMBRE-1
  719.  
  720.       mov       eax,[ds:OFFSET CHRONO]
  721.       xor       edx,edx
  722.       mov       ebx,10
  723. affiche:
  724.       div       ebx
  725.       add       dl,'0'
  726.       mov       [ds:di],dl
  727.       dec       di
  728.       xor       edx,edx
  729.       loop      affiche
  730.  
  731.       mov       ah,09h
  732.       mov       dx,di
  733.       int       21h
  734.  
  735.       mov       ax,4c00h
  736.       int       21h
  737.  
  738. no_arg:
  739.  
  740.     mov    dx,OFFSET PROGRAM_MSG
  741.     mov    ah,09h
  742.     int    21h
  743.  
  744.     mov    ax,4c13h
  745.     int    21h
  746.  
  747. error:
  748.     cmp    ax,256
  749.         jbe    @@dos_error
  750.     sub    ax,246
  751. @@dos_error:
  752.     mov    bx,_DATA
  753.     mov    ds,bx
  754.     sub    ax,FIRST_ERROR
  755.     jb    @@unknow
  756.     cmp    ax,LAST_ERROR
  757.     ja    @@unknow
  758.     mov    bx,ax
  759.     shl    bx,1
  760.     mov     dx,[ds:bx+MSG_ERROR]
  761.     mov    ah,09h
  762.     int    21h
  763.     mov    ax,bx
  764.     shl    bx,1
  765.     mov    ah,4ch
  766.     int    21h
  767.  
  768. @@unknow:
  769.     mov    dx,OFFSET UNKNOW_ERROR
  770.     mov    ah,09h
  771.     int    21h
  772.     mov    ax,4cffh
  773.     int    21h
  774.  
  775. ENDP
  776.  
  777. ;***************************************************************************
  778. ;*    Convertit un nombre sous forme de chaine de caractère en ds:si
  779. ;*    en binaire dans ax,ds:si pointant sur la fin du nombre
  780. ;*
  781. ;* Entrée:
  782. ;*    DS:SI    représentation décimal du nombre
  783. ;* Sortie:
  784. ;*    AX    nombre
  785. ;*    C=1    si la chaine n'est pas un nombre
  786.  
  787. PROC    get_dec
  788.  
  789.     xor    ax,ax
  790.     xor    dh,dh
  791.     mov    dl,[ds:si]
  792.     sub    dl,'0'
  793.     jl    @@error
  794.     cmp    dl,9
  795.     ja    @@error
  796.  
  797. @@next_digit:
  798.     inc    si
  799.  
  800.     lea    ax,[eax*4+eax]
  801.     shl    ax,1
  802.     add     ax,dx
  803.  
  804.     mov    dl,[ds:si]
  805.     sub    dl,'0'
  806.     jl    @@no_digit
  807.     cmp    dl,9
  808.     jbe    @@next_digit
  809.  
  810. @@no_digit:
  811.     clc
  812.     ret
  813. @@error:
  814.     stc
  815.     ret
  816. ENDP
  817.  
  818. ;***************************************************************************
  819. ;*    Convertit un nombre sous forme de chaine de caractère en ds:si
  820. ;*    en binaire dans ax,ds:si pointant sur la fin du nombre
  821. ;*
  822. ;* Entrée:
  823. ;*    DS:SI    représentation hexadécimal du nombre
  824. ;* Sortie:
  825. ;*    AX    nombre
  826. ;*    C=1    si la chaine n'est pas un nombre
  827.  
  828. PROC    get_hex
  829.  
  830.     xor    ax,ax
  831.     xor    dh,dh
  832.     mov    dl,[ds:si]
  833.     sub    dl,'0'
  834.     jl    @@error
  835.     cmp    dl,9
  836.     jbe    @@next_digit
  837.         and    dl,1fh
  838.         xor    dl,18h
  839.     inc    dl
  840.     cmp    dl,0fh
  841.         ja    @@error
  842. @@next_digit:
  843.     inc    si
  844.  
  845.     shl    ax,4
  846.     add     ax,dx
  847.  
  848.     mov    dl,[ds:si]
  849.     sub    dl,'0'
  850.     jl    @@no_digit
  851.     cmp    dl,9
  852.     jbe    @@next_digit
  853.         and    dl,1fh
  854.         xor    dl,18h
  855.         inc    dl
  856.     cmp    dl,0fh
  857.         jbe    @@next_digit
  858. @@no_digit:
  859.     clc
  860.     ret
  861. @@error:
  862.     stc
  863.     ret
  864. ENDP
  865.  
  866.  
  867. Key    DB    0
  868.  
  869. ;***************************************************************************
  870. ;*      interruption qui remplace l'interruption 09 et permet de sortir du
  871. ;*              programme quand on frappe une touche
  872.  
  873. PROC    hitkey FAR
  874.  
  875.     push    ax
  876.  
  877.     in      al,60h
  878.     or      al,al
  879.     js      @@relache
  880.  
  881.     mov     [cs:OFFSET Key],al
  882.  
  883.     mov     al,20h
  884.     out     20h,al
  885.  
  886.     pop     ax
  887.     iret
  888.  
  889. @@relache:
  890.     mov     al,20h
  891.     out     20h,al
  892.  
  893.     pop     ax
  894.     iret
  895.  
  896. ENDP
  897.  
  898. ;*************************************************************************
  899. ;*    Rafraichit l'ecran
  900.  
  901. PROC    refresh
  902.  
  903.     call    gettempo
  904.     push    ax
  905.     mov    di,OFFSET TEMPO_NB+3
  906.     call    dectostr
  907.     pop    ax
  908.     mov    al,ah
  909.     mov    di,OFFSET TEMPO_NB+7
  910.     call    dectostr
  911.  
  912.     call    getpattern
  913.     push    ax
  914.     mov    al,dl
  915.     mov    di,OFFSET LIGNE_NB+3
  916.     call    dectostr
  917.     pop    ax
  918.     push    ax
  919.     mov    di,OFFSET SEQUENCE_NB+3
  920.     call    dectostr
  921.     pop    ax
  922.     mov    al,ah
  923.     mov    di,OFFSET PATTERN_NB+3
  924.     call    dectostr
  925.  
  926.         push    ds
  927.         mov    ax,SEG Nb_voice
  928.         mov    ds,ax
  929.         ASSUME    ds:SEG Nb_voice
  930.     mov    cl,[ds:OFFSET Nb_voice]
  931.     pop    ds
  932.         ASSUME ds:_DATA
  933.     mov    di,OFFSET INSTRUMENTV1
  934. @@next_voice:
  935.     push    cx
  936.     push    di
  937.     call    putvoice
  938.         pop    di
  939.     add    di,OFFSET INSTRUMENTV2-OFFSET INSTRUMENTV1
  940.         pop    cx
  941.         dec    cl
  942.         jne    @@next_voice
  943.  
  944.     mov    cx,NB_REFRESH
  945.     mov    bx,OFFSET LIST_MSG
  946. @@next_msg2:
  947.     mov    si,[ds:bx]
  948.     add    bx,2
  949.     mov        dx,[ds:si]
  950.     mov    ah,[ds:si+2]
  951.     add    si,3
  952.     call    puttxt
  953.     dec    cx
  954.     jne    @@next_msg2
  955.  
  956.     ret
  957.  
  958. ENDP
  959.  
  960. ;**************************************************************************
  961. ;*    Place les informations des 4 voix
  962. ;*
  963. ;* Entrée:
  964. ;*    DS:DI    position des instruments de la voix
  965.  
  966. PROC    putvoice
  967. LOCAL    voice:WORD,instrument:BYTE,volume:BYTE,note:BYTE,effet:BYTE=varloc
  968.  
  969.     enter    varloc,0
  970.  
  971.     mov    [voice],di
  972.     call    getvoice
  973.     mov    [volume],ah
  974.     mov    [note],bl
  975.     mov    [effet],bh
  976.     mov    [instrument],al
  977.     mov    di,[voice]
  978.     mov    dx,[word ptr ds:di]
  979.     mov    dl,39h
  980.     mov    al,'■'
  981. ;    shr    cl,2
  982.     call    putbar
  983.     movzx    bx,[instrument]
  984.     or    bx,bx
  985.     je    @@no_inst
  986.     add    bx,NB_MSG-32
  987.     shl    bx,1
  988.     add    bx,OFFSET LIST_MSG
  989.     mov    si,[ds:bx]
  990.     add    si,3
  991.     mov    di,[voice]
  992.     add    di,3
  993.     mov    cx,11
  994.     push    es
  995.     mov    ax,ds
  996.     mov     es,ax
  997.     rep    movsw
  998.     pop    es
  999. @@no_inst:
  1000.     mov    al,[volume]
  1001.     mov    di,[voice]
  1002.     add    di,26+3
  1003.     call    dectostr
  1004.  
  1005.     movzx    bx,[note]
  1006.     shl    bx,1
  1007.     add    bx,OFFSET LIST_NOTES
  1008.     mov    eax,[ds:bx]
  1009.     mov    di,[voice]
  1010.     add    di,26+3+7
  1011.     mov    [ds:di],eax
  1012.  
  1013.     movzx    si,[effet]
  1014.     shl    si,4
  1015.     add    si,OFFSET LIST_EFFET
  1016.     mov    cx,8
  1017.     mov    di,[voice]
  1018.     add    di,26+3+7+7
  1019.     push    es
  1020.     mov    ax,ds
  1021.     mov    es,ax
  1022.     rep    movsw
  1023.     pop    es
  1024.  
  1025.     leave
  1026.  
  1027.     ret
  1028.  
  1029. ENDP
  1030.  
  1031.  
  1032. SCREEN_POS    DW 640
  1033.  
  1034. ;***************************************************************************
  1035. ;*    Ecrit un nombre en EAX sur 32 bits en chaine de caractère
  1036. ;*    correspondant à se représentation hexadécimal
  1037. ;*
  1038. ;* Entrée:
  1039. ;*    EDX    nombre à convertir
  1040.  
  1041. PROC    writelong
  1042.  
  1043.     push    es
  1044.     mov    ax,0b800h
  1045.     mov    es,ax
  1046.     mov    di,[cs:SCREEN_POS]
  1047.     add    di,16
  1048.  
  1049.     mov    ax,'h'
  1050.     std
  1051.     stosb
  1052.  
  1053.     mov    cl,4
  1054. @@next_digit:
  1055.     movzx    ax,dl
  1056.     shr    edx,8
  1057.     shl    ax,4
  1058.     shr    al,4
  1059.     xchg    al,ah
  1060.     and    ax,0f0fh
  1061.     add    ax,3030h
  1062.     cmp    al,3Ah
  1063.     jb    @@al_ok
  1064.     add    al,7
  1065. @@al_ok:
  1066.     cmp    ah,3Ah
  1067.     jb    @@ah_ok
  1068.     add    ah,7
  1069. @@ah_ok:
  1070.     xchg    al,ah
  1071.     dec    di
  1072.     stosb
  1073.     dec    di
  1074.     mov    al,ah
  1075.     stosb
  1076.     dec    cl
  1077.     jne    @@next_digit
  1078.  
  1079.     cld
  1080.  
  1081.     add    di,19
  1082.     mov    al,' '
  1083.     stosb
  1084.     inc    di
  1085.  
  1086.     pop    es
  1087.  
  1088.     cmp    di,4000
  1089.     jb    @@ok
  1090.     mov    di,0
  1091. @@ok:
  1092.     mov    [cs:SCREEN_POS],di
  1093.  
  1094.  
  1095.     ret
  1096.  
  1097. ENDP
  1098.  
  1099.  
  1100.  
  1101. ;***************************************************************************
  1102. ;*    Cette routine sépare les arguments de la ligne de commande par un
  1103. ;*    zero,deplus les switchs sont mis en majuscule.Les switchs doivents
  1104. ;*    commencer par '-','/' ou '+' et le '/' est toujours transformé en '-'
  1105. ;*    deplus les virgules se retrouve toujours en début de mots.Enfin
  1106. ;*    si une chaine est mis entre '"' elle n'est pas modifié.
  1107. ;*
  1108. ;* Entrée:
  1109. ;*    DS:SI    adresse de la ligne de commande
  1110. ;*      ES:DI    adresse du buffer devant contenir la ligne modifié
  1111. ;* Sortie:
  1112. ;*    AL    nombre d'arguments sans les switchs
  1113.  
  1114. PROC    getarg
  1115.  
  1116.     lodsb
  1117.     mov    cl,al
  1118.         xor    ch,ch
  1119.  
  1120. @@search_letter:
  1121.     dec    cl
  1122.     jl    @@nothing_left
  1123.     lodsb
  1124.     cmp    al,' '
  1125.     je    @@search_letter
  1126.     cmp    al,09
  1127.     je    @@search_letter
  1128.     inc    ch
  1129.     cmp    al,'+'
  1130.     je    @@switch
  1131.     cmp    al,'-'
  1132.     je    @@switch
  1133.     cmp    al,'/'
  1134.     jne    @@letter
  1135.     mov    al,'-'
  1136. @@switch:
  1137.     stosb
  1138.     dec    ch
  1139.  
  1140. @@majuscule:
  1141.     dec    cl
  1142.     jl    @@nothing_left
  1143.     lodsb
  1144.     mov    ah,al
  1145.     and    ah,0dfh
  1146.     cmp    ah,'A'
  1147.     jb    @@search_white
  1148.     cmp    ah,'Z'
  1149.     ja    @@search_white
  1150.     mov    al,ah
  1151.     stosb
  1152.     jmp    @@majuscule
  1153.  
  1154. @@string:
  1155.     stosb
  1156.     dec    cl
  1157.     jl    @@nothing_left
  1158.     lodsb
  1159.     cmp    al,'"'
  1160.     jne    @@string
  1161.  
  1162. @@letter:
  1163.     stosb
  1164.     lodsb
  1165.     dec    cl
  1166.     jl    @@nothing_left
  1167.  
  1168. @@search_white:
  1169.     cmp    al,'"'
  1170.     je    @@string
  1171.     cmp    al,' '
  1172.     je    @@find_white
  1173.     cmp    al,09
  1174.     je    @@find_white
  1175.     cmp    al,','
  1176.     jne    @@letter
  1177.     mov    ah,al
  1178.     xor    al,al
  1179.     stosw
  1180.         cmp    [byte ptr ds:si],','
  1181.         jne    @@search_letter
  1182.         stosb
  1183.     jmp    @@search_letter
  1184.  
  1185. @@find_white:
  1186.     xor    al,al
  1187.     stosb
  1188.     jmp    @@search_letter
  1189.  
  1190. @@nothing_left:
  1191.     xor    ax,ax
  1192.     stosw
  1193.     mov    al,ch
  1194.  
  1195.     ret
  1196.  
  1197. ENDP
  1198.  
  1199. ;**************************************************************************
  1200. ;*    Affiche une ligne de texte donnant la carte sonore utilisé
  1201. ;*
  1202. ;* Attention:
  1203. ;*    Les variables Device,Port,Irq et DMA doivent être définis ainsi
  1204. ;*    que des messages
  1205.  
  1206. PROC    putcard
  1207.  
  1208.     mov    ah,09h
  1209.     mov    dx,OFFSET USINGMSG
  1210.     int    21h
  1211.  
  1212.     mov    bl,[byte ptr ds:OFFSET Device]
  1213.     xor    bh,bh
  1214.     shl    bx,2
  1215.     add    bx,OFFSET DEVICEMSG
  1216.     mov    dx,[ds:bx]
  1217.     mov    ah,09h
  1218.     int    21h
  1219.  
  1220.     mov    cl,[ds:bx+2]
  1221.     or    cl,cl
  1222.     je    @@thats_all
  1223.  
  1224.     mov    bx,[ds:Port]
  1225.     or    bh,bh
  1226.     je    @@no_first_digit
  1227.  
  1228.     mov    dl,bh
  1229.     add    dl,'0'
  1230.     mov    ah,02h
  1231.     int    21h
  1232.  
  1233.     mov    dl,bl
  1234.     shr    dl,4
  1235.     and    dl,0fh
  1236.     add    dl,'0'
  1237.     cmp    dl,'9'
  1238.     jbe    @@no_hexa
  1239.     add    dl,7
  1240. @@no_hexa:
  1241.     mov    ah,02h
  1242.     int    21h
  1243.  
  1244.     and    bl,0fh
  1245. @@no_first_digit:
  1246.     mov    dl,bl
  1247.     add    dl,'0'
  1248.     mov    ah,02h
  1249.     int    21h
  1250.  
  1251.     dec    cl
  1252.     je    @@thats_all
  1253.  
  1254.     mov    ah,09h
  1255.     mov    dx,OFFSET IRQMSG
  1256.     int    21h
  1257.  
  1258.     mov    dl,[ds:Irq]
  1259.     add    dl,'0'
  1260.     mov    ah,02h
  1261.     int    21h
  1262.  
  1263.     dec    cl
  1264.     je    @@thats_all
  1265.  
  1266.     mov    ah,09h
  1267.     mov    dx,OFFSET DMAMSG
  1268.     int    21h
  1269.  
  1270. @@thats_all:
  1271.  
  1272.     mov    ah,09h
  1273.     mov    dx,OFFSET NEWLINE
  1274.     int    21h
  1275.  
  1276.     cmp    [ds:Device],4
  1277.     je    @@loadsamp
  1278.  
  1279.     ret
  1280. @@loadsamp:
  1281.  
  1282.     mov    ah,09h
  1283.     mov    dx,OFFSET GUSMSG
  1284.     int    21h
  1285.  
  1286.     ret
  1287.  
  1288. ENDP
  1289.  
  1290. ENDS
  1291.  
  1292. STACK    400h
  1293.  
  1294. END
  1295.  
  1296.