📄 zj1.asm
字号:
dseg segment para 'data'
table dw 262
dw 294
dw 330
dw 349
dw 392
dw 440
dw 494
dw 523
dseg ends
cseg segment para 'code'
assume cs:cseg,ds:dseg
main proc far
start:
mov ax,dseg
mov ds,ax
new_note:
mov ah,0
int 16h
cmp al,03h
je exit
cmp al,'0'
je stop
cmp al,0dh
je stop
mov bx,offset table
cmp al,'1'
jb new_note
cmp al,'8'
ja new_note
and ax,0fh
shl ax,1
sub ax,2
mov si,ax
mov di,[bx][si]
mov bx,10
call soundf
jmp new_note
exit:
mov ax,4c00h
int 21h
stop:
mov al,0fdh
out 61h,al
jmp new_note
main endp
soundf proc near
mov al,0b6h
out 43,al
mov dx,12h
mov ax,348ch
div di
out 42h,al
mov al,ah
out 42h,al
in al,61h
mov ah,al
or al,3
out 61h,al
wait1:
mov cx,33333
call waitf
soundf endp
waitf proc near
waitf1:
in al,61h
and al,10h
cmp al,ah
je waitf1
mov ah,al
loop waitf1
ret
waitf endp
cseg ends
end start
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -