文章分类 | 推荐文章 | 最新文章 | 热点文章 | 最新软件 | 精品软件 | 下载排行 | 推荐下载 | 免费看大片 | WPS | 杀毒软件
清风网络
首 页 软件下载 网络学院 数码学院
QQ 电脑入门 游戏 操作系统 图形处理 办公软件 媒体动画 精文荟萃 工具软件 网络编程 程序开发 网络技术 认证考试 网站建设 文章专栏
当前位置:清风网络学院程序开发其他语言汇编的的各类源码--sound
精品推荐
特别推荐
·控制面板知多少
·给你十条学习Ruby语言的理由
·分页管理机制
·Perl 语言的重要价值体现
·经验技巧:分享两条Delphi开发经验
·Java编程思想:面向对象的逻辑思维方法
·Samba系统简介
热点TOP10
·AIX 5L 学习大纲/简易教程(2)(未经许可,请勿COPY)
·DENX U-Boot及Linux使用手册
·EZ-USB 68013A开发指南
·图象处理中的边缘检测------canny算子
·Visual C++ ADO数据库编程入门
·利用 wordXP 实现自动排班
·UDT协议-基于UDP的可靠数据传输协议
·XPCOM--LINUX下的组件开发技术
·MyEclipse JSF 快速入门中文版(上)
·samba和openldap结合实战
·AIX 5L 学习大纲/简易教程(1)(未经许可,请勿COPY)
·Microsoft Windows XP Embedded 开发工具概述
·eMbedded Visual C++开发入门
·在VC6中创建wxWidgets项目[附图]
·数值计算程序大放送-线性代数方程组
·列表视图控件
·visual studio 2005 简体中文团队开发版 SQL server 2005简体中文版下载
·Visual Studio 2005:在 Visual C++ 中开发自定义的绘图控件
·汇编语言工具下载
·多文档界面(MDI)

汇编的的各类源码--sound

日期:2007年5月2日 作者: 查看:[大字体 中字体 小字体]


; sound.asm

; 

; This is a small sound example for the IBM PC

; It will play 12 notes of the octave starting at middle C.

;-----------------------------------------------------------------------------

; How to generate sound on the IBM PC :

;

; The 8255 (port 61H) bit 0 controls the 8253 timer

;                     bit 1 controls the speaker

;

; The output channel 2 from the 8253 timer will be ANDed with the 

; speaker control bit in order to turn on/off the speaker.

;

; Timer channel 2 internal count register (port 42h) is loaded in

; two successive OUT operations with the lower byte being loaded first.

; For this to work properly, timer command register has to be loaded first

; with B6H.

;

; Since the input clock to the timer chip is 1.19318 MHz, the counter value

; to generate the frequency X can be calculated by 1193180 / X.

;-----------------------------------------------------------------------------

; CX is used as a note counter with the frequency effectively being

; incremented by a half tone and the corresponding count being loaded

; into the count register on each iteration.

;

; No stack segment is needed for this small program, so don't panic

; when you receive the 'No stack segment' warning.

;

; Arne Asplem 880731 (MASM 4.0)







dseg    segment                         ; data segment

notes   dw      262,277,294,311,330,349,370,392,415,440,466,494

dseg    ends



cseg    segment



sound   proc far

        assume  cs:cseg, ds:dseg, ss:nothing



start:  

        mov     ax, dseg

        mov     ds, ax                  ; set up data segment (DS) reg.

        xor     si, si

        mov     bx, 12                  ; note count



; set up timer command register and counter register



        mov     al, 0b6h                ; set 8253 command register

        out     43h, al                 ; for channel 2, mode 3



nloop:

        mov     ax, 34dch               ; low part of clock freq.

        mov     dx, 12h                 ; hight part of clock freq.

        div     [notes + si]            ; get note from data segment

        out     42h, al                 ; 8253 command register (low byte)

        mov     al, ah

        out     42h, al                 ; 8253 command regsieter (high byte)



; turn on low bits in 8255 output port



        in      al, 61h                 ; read current value of 8255 port

[1] [2] 下一页 




上一篇:汇编的的各类源码--showmem

下一篇:汇编的数据无类型

汇编的的各类源码--sound 相关文章:
·破解基础知识汇编
·专门修复各类文件关联
·视频下载不求人 突破封锁保存各类视频资源
·魔兽世界:各类珍珠的掉落点
·Photoshop各类外挂插件的使用方法
·汇编语言工具下载
·录制MP3工具MP3 Sound Recorder
·用Sound Recorder给QQ录音
·Cisco各类线缆
·献给汇编初学者-函数调用堆栈变化分析
汇编的的各类源码--sound 相关软件:
·Windows环境下32位汇编语言程序设计
·Cooolsoft MP3 Sound Cutter (音频截取工具) V1.41 绿色版
·Sound ForgeV8.0d build 128
·清朝史料汇编
·Sony Sound Forge9.0a
·Dreamweaver MX试题汇编
·汇编语言共34讲csf东南大学朱敏
·汇编语言入门教程PPT
·实用系列-各类认证标志
·Fireworks MX试题汇编

特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
[打印本页] [关闭窗口] 转载请注明来源:http://www.vipcn.com
| 帮助(?) | 版权声明 | 友情连接 | 关于我们 | 信息发布
Copyright 2007 www.vipcn.com All Rights Reserved. 鄂ICP备05000083号Powered by:vipcn