or al, 3 ; clear low bits
out 61h, al ; send new value to port
; loop while note is sounding
mov cx, 6d60h
rpta:
loop rpta ; 1/10 sec delay
; turn off speaker, check note count, set up next note
xor al, 3
out 61h, al ; turn off speaker
mov cx, 0af0h
rptb:
loop rptb ; 1/100 sec delay
inc si ; increment note pointer
inc si
dec bx ; decrement note counter
jnz nloop ; loop until bx = 0
mov ax, 4c00h ; terminate program
int 21h
sound endp
cseg ends
end start