AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > 汇编语言

Mixer Volume Ctrler V1.0

51自学网 http://www.wanshiok.com
Dos 下的声卡音量控制程序,以内存驻留键盘激活的方式控制CD-Audio,MIDI,Voice以及Master的音量(未作键盘的解封锁处理,有兴趣可加上)
CTRL-F1 -- TURN MASTER VOL UP
CTRL-F2 -- TURN MASTER VOL DOWN
CTRL-F3 -- TURN CD VOL UP
CTRL-F4 -- TURN CD VOL DOWN
CTRL-F5 -- TURN FM VOL UP
CTRL-F6 -- TURN FM VOL DOWN
CTRL-F7 -- TURN VOICE VOL UP
CTRL-F8 -- TURN VOICE VOL DOWN

源码:
code segment
assume cs:code,ds:code
org 100h
begin:jmp init
r1 equ 224h
r2 equ 225h
int9 dd ?
mark db 'zd'
new_int proc far
sti
push ax
push es
xor ax,ax
mov es,ax
in al,60h
test al,80h
jnz exit1
test byte ptr es:[0417h],100b
jz exit1

cmp al,59 ;F1
jz ok
cmp al,60 ;F2
jz ok
cmp al,61 ;F3
jz ok
cmp al,62 ;F4
jz ok
cmp al,63 ;F5
jz ok
cmp al,64 ;F6
jz ok

cmp al,65 ;F7
jz ok
cmp al,66 ;F8
jz ok
jmp exit1
ok:
push ax
push bx
push cx
push dx
push bp
push di
push si
push ds
mov bl,al
push cs
pop ds
in al,61h
push ax
or al,80h
out 61h,al
pop ax
out 61h,al
mov al,20h
out 20h,al
call my

pop ds
pop si
pop di
pop bp
pop dx
pop cx
pop bx
pop ax

exit1:
pop es
pop ax
jmp cs:int9
new_int endp

my proc near ;;;;;;;;;;;;;;;;;;;;;;;my app;;;;;;;;;;;;;;;;;;;;;;;;;;

o: cmp bl,59
jnz o1
mov cl,32h
call up
jmp quit

o1:cmp bl,61
jnz o2
mov cl,38h
call up
jmp quit

o2:cmp bl,63
jnz o3
mov cl,36h
call up
jmp quit

o3:cmp bl,65
jnz o4
mov cl,14h
call up
jmp quit

;down

o4: cmp bl,60
jnz o5
mov cl,32h
call down
jmp quit

o5:cmp bl,62
jnz o6
mov cl,38h
call down
jmp quit

o6:cmp bl,64
jnz o7
mov cl,36h
call down
jmp quit

o7:cmp bl,66
jnz o8
mov cl,14h
call down
jmp quit
o8:

quit:ret
my endp

up proc near ;;;;;;;;;;;;;;;UP;;;;;;;;;;;;;;;;;;
xor ax,ax
mov al,cl
mov dx,r1
out dx,al
mov dx,r2
in al,dx
add ax,11h
cmp ax,0ffh
jle goon
mov ax,0ffh
goon:
push ax
mov al,cl
mov dx,r1
out dx,al
pop ax
mov dx,r2
out dx,al
ret
up endp

down proc near ;;;;;;;;;;;;;DOWN;;;;;;;;;;;;;
xor ax,ax
mov al,cl
mov dx,r1
out dx,al
mov dx,r2
in al,dx
sub ax,11h
cmp ax,0h
jge go
mov ax,0h
go:
push ax

mov al,cl
mov dx,r1
out dx,al

pop ax

mov dx,r2
out dx,al
ret
down endp

init :
cli
push cs
pop ds

mov dx,offset zd
mov ah,9
int 21h

mov ax,3509h
int 21h
cmp word ptr es:[bx-2],'dz'
jnz install
mov dx,offset mes1
mov ah,9
int 21h
mov ah,4ch
int 21h

install:
mov di,offset int9
mov [di],bx
mov [di+2],es
push cs
pop ds
mov dx,offset new_int
mov ax,2509h
int 21h
sti
mov dx,offset mes
mov ah,9
int 21h

mov dx,offset init
int 27h
zd db 'MIXER VOLUME CTRL V1.0 ZDsoft 1995',0dh,0ah,'$'
mes db 'CTRL-F1 -- TURN MASTER VOL UP',0dh,0ah
mes2 db 'CTRL-F2 -- TURN MASTER VOL DOWN ',0dh,0ah
mes3 db 'CTRL-F3 -- TURN CD VOL UP ',0dh,0ah
mes4 db 'CTRL-F4 -- TURN CD VOL DOWN ',0dh,0ah
mes5 db 'CTRL-F5 -- TURN FM VOL UP ',0dh,0ah
mes6 db 'CTRL-F6 -- TURN FM VOL DOWN ',0dh,0ah
mes7 db 'CTRL-F7 -- TURN VOICE VOL UP ',0dh,0ah
mes8 db 'CTRL-F8 -- TURN VOICE VOL DOWN ',0dh,0ah,'$'
mes1 db 'Already Install!$'

code ends
end begin

 

 

 
上一篇:汇编源码--basload  下一篇:Game Faster V1.0