📄 sound1.asm
字号:
data segment
a1 db 'hello!',0dh,0ah,'$'
data ends
code segment
assume cs:code,ds:data
start:mov ax,data
mov ds,ax
mov dx,offset a1
mov ah,09h
int 21h
mov cx,10
XOR BX,BX
MOV BL,0FFH
sing: call sound
loop sing
mov ah,4ch
int 21h
;---------sound-------
sound proc near
push ax
push bx
push cx
mov al,0b6h
out 43h,al
MOV AX,1983
out 42h,al
mov al,ah
out 42h,al
in al,61h ;read PB
mov ah,al
OR al,00000011B ;开发声器
out 61h,al
wait1: SUB CX,CX ;置CX=65536
delay: loop delay
dec BL
jnz wait1
mov al,ah
out 61h,al
pop cx
pop bx
pop ax
ret
sound endp
code ends
end start
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -