www.pudn.com > Demo_asm_80x86.rar > Welcome.asm


;****************************************************** 
;* 文件名:Welcome.asm 
;* 创建日期:2001.4.12 
;* 作者:陈文尧 
;* 功能:显示欢迎词并用喇叭播放《友谊地久天长》 
;****************************************************** 
include system.inc 
 
;****************************************************** 
;* 以下代码由汇编专家产生,不要随便修改 
;****************************************************** 
.CODE 
	ifdef __COM__ 
		org	100h 
	endif 
@@Start: 
;------------------------------------------------------ 
; 初始化数据段 
;------------------------------------------------------ 
	InitDS	cs 
;------------------------------------------------------ 
; 调用主函数 
;------------------------------------------------------ 
	call	main 
;------------------------------------------------------ 
; 正常返回DOS 
;------------------------------------------------------ 
	ReturnDos 
 
;++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
;+ 主函数,加入实现程序功能的代码 
;++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
main	proc 
      LibCall	Cls 
      LibCall	HideCursor 
      mov		di,CR_WHITE	 
      LibCall	PutStringDirect,,0,di 
First: 
      mov		si,offset MUSIC 
Next: 
      mov		bx,[si]	 
      LibCall	PutStringDirect,,80d*08d+25d,di 
      inc		di 
      add		si,02h 
      cmp		di,10h 
      jne		Skip 
      mov		di,01h 
Skip: 
      mov		ax,bx  
      shr		ax,06h 
      and		bx,003fh 
      LibCall	Sound,ax 
LoopTop: 
      LibCall	Delay,40h 
      dec		bx 
      jg		LoopTop 
      LibCall	NoSound 
      mov		ah,0bh 
      int		21h 
      cmp		al,00h 
      jnz		ProgramEnd 
      cmp		si,MUSIC_END 
      jl		Next 
      LibCall	Delay,2500d 
      jmp		First 
ProgramEnd: 
      LibCall	ShowCursor,00h ;显示正常光标(非实心光标) 
      LibCall	Cls 
      ; 
	ret 
main	endp 
 
MUSIC     DW  196*64+2*MULT,262*64+3*MULT,262*64+1*MULT,262*64+2*MULT 
          DW  330*64+2*MULT,294*64+3*MULT,262*64+1*MULT,294*64+2*MULT 
          DW  330*64+1*MULT,294*64+1*MULT,262*64+4*MULT,330*64+2*MULT 
          DW  394*64+2*MULT,440*64+4*MULT,440*64+2*MULT,394*64+3*MULT 
          DW  330*64+1*MULT,330*64+1*MULT,262*64+1*MULT,294*64+3*MULT 
          DW  262*64+1*MULT,294*64+2*MULT,330*64+1*MULT,294*64+1*MULT 
          DW  262*64+3*MULT,230*64+1*MULT,230*64+2*MULT,196*64+2*MULT 
          DW  262*64+7*MULT,440*64+2*MULT,394*64+3*MULT,330*64+1*MULT 
          DW  330*64+1*MULT,262*64+1*MULT,294*64+3*MULT,262*64+1*MULT 
          DW  294*64+2*MULT,440*64+2*MULT,394*64+3*MULT,330*64+1*MULT 
          DW  330*64+2*MULT,394*64+2*MULT,440*64+7*MULT,523*64+2*MULT 
          DW  394*64+3*MULT,330*64+1*MULT,330*64+1*MULT,262*64+1*MULT 
          DW  294*64+3*MULT,262*64+1*MULT,294*64+2*MULT,330*64+1*MULT 
          DW  294*64+1*MULT,262*64+3*MULT,230*64+1*MULT,230*64+2*MULT 
          DW  196*64+2*MULT,262*64+7*MULT,440*64+2*MULT,394*64+3*MULT 
          DW  330*64+1*MULT,330*64+1*MULT,262*64+1*MULT,294*64+3*MULT 
          DW  262*64+1*MULT,294*64+2*MULT,440*64+2*MULT,394*64+3*MULT 
          DW  330*64+1*MULT,330*64+2*MULT,394*64+2*MULT,440*64+7*MULT 
          DW  523*64+2*MULT,394*64+3*MULT,330*64+1*MULT,330*64+1*MULT 
          DW  262*64+1*MULT,294*64+3*MULT,262*64+1*MULT,294*64+2*MULT 
          DW  330*64+1*MULT,294*64+1*MULT,262*64+3*MULT,230*64+1*MULT 
          DW  230*64+2*MULT,196*64+2*MULT,262*64+7*MULT 
MUSIC_END =   offset $ 
MULT      =   08h 
 
WelcomeMsg	db    '陈文尧欢迎您使用《未来汇编》!',00h 
ReturnMsg	db    '按任意键结束...',00h 
;****************************************************** 
;* 标志程序结束并指定程序入口 
;****************************************************** 
	end	@@Start