报时小闹钟
本程序是一个用汇编编的精致的图形时钟,运行时双击clock图标即可,
钟表显示的时间为本机系统的时间。
按b键可扩大画面 ;按s键可缩小画面;按c键可改变颜色;按e键可听音乐;
按q键退出本程序.
PUBLIC GENSOUND
CODE SEGMENT PARA 'CODE'
ASSUME CS: CODE
GENSOUND PROC FAR
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH DI
MOV AL, 0B6H
OUT 43H, AL
MOV DX, 12H
751com.cn
IN AL, 61H
OR AL, 3
OUT 61H, AL
WAIT1: MOV CX, 8FF0H
DELAY: LOOP DELAY
DEC BX
JNZ WAIT1
MOV AL, AH
OUT 61H, AL
POP DI
POP DX
POP CX
POP BX
POP AX
RET
GENSOUND ENDP
CODE ENDS
END
EXTRN GENSOUND:FAR
PUBLIC MUSIC
STACK SEGMENT PARA STACK 'STACK'
DB 64 DUP ('STACK')
STACK ENDS
DATA SEGMENT PARA 'DATA'
MUS_FREQ DW 330, 294, 262, 294, 3 DUP (330)
DW 3 DUP (294), 330,392,392
DW 330, 294, 262, 294, 4 DUP (330)
DW 293, 294, 330, 294, 262,-1
MUS_TIME DW 6 DUP (25*8), 50*8
DW 2 DUP (25*8, 25*8, 50*8)
DW 12 DUP (25*8), 100*8
DATA ENDS
CODE SEGMENT PARA 'CODE'
ASSUME CS: CODE, SS: STACK
ASSUME DS: DATA
MUSIC PROC FAR
PUSH DS
PUSH DX
PUSH CX
PUSH BX
PUSH AX
MOV AX, DATA
MOV DS, AX
LEA SI, MUS_FREQ
LEA BP, DS: MUS_TIME
FREQ: MOV DI, [SI]
CMP DI, -1
JE END_MUS
MOV BX, DS: [BP]
CALL GENSOUND
ADD SI, 2
ADD BP, 2
JMP FREQ
END_MUS:
POP AX
POP BX
POP CX
POP DX
POP DS
RET
MUSIC ENDP
CODE ENDS
END
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页