home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / asm_sour / reply.asm < prev    next >
Assembly Source File  |  1984-05-29  |  2KB  |  42 lines

  1.                 TITLE SNDCLR : CALLER (SOUND.ASM)
  2.                 PAGE,132
  3.                 NAME MAIN_AEM
  4.                 ;
  5.                 ;HERE IS THE CODE FOR THE CALLING PROGRAM
  6.                 ;
  7.                 CSEG    SEGMENT PARA    PUBLIC  'CODE'
  8.                 BEEP  PROC    FAR
  9.                         ASSUME  CS:CSEG
  10.                 ;FIXUP THE STACK TO RETURN TO DOS OR DEBUG
  11.                 ;
  12.                 begin:
  13.         push    ds
  14.         sub     ax,ax
  15.         push    ax
  16.         mov     ax,cseg         ;get the return program return segment
  17.         mov     ds,ax
  18.                         MOV     BX,05       ;duration in hundredths of seconds
  19.                         MOV     DI,3580         ;frequency to sound
  20.                         MOV     AL,0B6H         ;WRITE TIMER MODE REGISTER
  21.                         OUT     43H,AL          ;LOAD THE PORT
  22.                         MOV     DX,14H
  23.                         MOV     AX,4F38H        ;1331000/FREQUENCY PULSE
  24.                         DIV     DI
  25.                         OUT     42H,AL          ;WRITE TIMER LOW BYTE
  26.                         MOV     AL,AH
  27.                         OUT     42H,AL
  28.                         IN      AL,61H          ;GET CURRENT PORT B SETTING
  29.                         MOV     AH,AL           ;AND MOVE IT TO AH
  30.                         OR      AL,3            ;SWITCH SPEAKER ON
  31.                         OUT     61H,AL
  32.                 WAIT:   MOV     CX,2801         ;WAIT 10 MILLISECONDS
  33.                 SPK_ON: LOOP    SPK_ON
  34.                         DEC     BX              ;SPEAKER ON TIME EXPIRED?
  35.                         JNZ     WAIT            ;IF NOT KEEP SPEAKER ON
  36.                         MOV     AL,AH
  37.                         OUT     61H,AL          ;PORT VALUE RECOVERED..CONTINUE
  38.                         RET
  39.       beep    endp
  40.                 CSEG    ENDS
  41.                         END     begin
  42.