ВОт код того что написал я:
Код: Выделить всё
.186
.model tiny
TITLE Resident (com)
code SEGMENT
assume CS:code, DS:code, SS:code,ES:code
org 100h
start: jmp initz
New_sound Proc far
jmp sou
gwts dw 1985
kbsave dd ?
;::::::::::список нот:::::::::::::::::::::::::::::::
Oskolok_lda:
db 1,1,1
db 02fh,015h,3 ;A
db 0deh,012h,3 ;B
db 0cah,011h,3 ;C
db 0dah,00fh,3 ;D
db 01fh,00eh,6 ;E
db 02fh,015h,3 ;A
db 0dah,00fh,6 ;D
db 02fh,015h,3 ;A
db 0cah,011h,6 ;C
db 02fh,015h,3 ;A
db 0cah,011h,6 ;C
db 0deh,012h,6 ;B
db 0cah,011h,2 ;C
db 0deh,012h,2 ;B
db 02fh,015h,4 ;A
db 0,0,0
;::::::::::::::::делитель частоты,длительность:::::::::::
mesi db "Resident is installed",0ah,0dh,'$'
mese db "Resident is erased",0ah,0dh,'$'
sou:
pusha
pushf
mov ax,cs
mov ds,ax
mov es,ax
in AL,60H ;читаем scan-код из порта 60H
cmp AL,47H; код клавиши <Home>?
jne exit
cld
lea si,oskolok_lda
mus_000:lodsb
cmp al,0
je exit
inc si
cmp al,1
je mus_001
dec si
out 42h,al
lodsb
out 42h,al
in al,61h
or al,3
out 61h,al
mus_001:lodsb
mus_002 :p ush ax
mov ah,2ch
int 21h
mov al,dl
mus_003 :p ush ax
mov ah,2ch
int 21h
pop ax
cmp dl,al
je mus_003
pop ax
dec al
jnz mus_002
in al,61h
and al,0fch
out 61h,al
jmp mus_000
EXIT: popf
popa
jmp cs:kbsave
iret
new_sound endp
;--------Процедруа инициализации---------------------------
Initz proc far
mov ax,3509h
int 21h
mov word ptr kbsave,bx
mov word ptr kbsave+2,es
add bx,3
cmp word ptr es:[bx],1985
je installed
lea dx,new_sound
mov ax,2509h
int 21h
mov ah,09h
lea dx,mesi
int 21h
lea dx,initz
int 27h
installed:
push bx
add bx,2
mov dx,es:[bx]
add bx,2
mov ds,es:[bx]
mov ax,2509h
int 21h
pop bx
mov ah,49h
int 21h
mov ax,cs
mov ds,ax
mov ah,9h
lea dx,mese
int 21h
mov ah,4ch
int 21h
initz endp
code ENDS
END start