Use this macro,I have try it and it could sing !
__________________________________________________
;*************************************************************************** *
;This macro could play music which locates at data segment *
; written by:zhujianping *
; 2001.5.26 *
;Variable: *
; segid: name of the data segment where *
; the music frequency and time is stored! *
; mus_freq: the start place of the music frequency in data segment! *
; mus_time: the start place of the music last time stored in data *
; segment! *
;***************************************************************************
play macro segid,mus_freq,mus_time
;--------------------------------------------
local music,freq,end_mus,wait1,delay
;********************
push ax
push bx
push cx
push dx
push di
push si
push bp
push ds
;*******************
mov ax,segid
mov ds,ax
lea si,mus_freq
lea bp,ds:mus_time
freq: mov di,[si]
cmp di,-1
je end_mus
mov bx,ds:[bp]
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
push ax
push bx
push cx
push dx
push di
mov al,0b6h
out 43h,al
mov dx,12h
mov ax,533h*896
div di
out 42h,al
mov al,ah
out 42h,al