• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >汇编语言 > 汇编源码系列之clear

汇编源码系列之clear

作者:匿名 字体:[增加 减小] 来源:互联网 时间:2017-06-28

匿名通过本文主要向大家介绍了clear,clean clear官网,clearlove,clear是什么意思,clearlove7等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
</div>

这个都是过去DOS时代的汇编源码,虽然已经过去了,但是对于学习汇编还是有帮助的,汇编语言只是程序员一门基础语言,大多人掌握即可,不一定要深入研究.......

     name   clear
     page   55,132
     title   'CLEAR --- control PC display'
;
; CLEAR Utility to clear display
; and set character attributes
;
; Ray Duncan, Uncopyright (u) August 1983
; This program may be freely copied,
; mangled, enhanced, redistributed.
;
input  equ    080h   ;command line tail buffer
cr    equ    0dh    ;ASCII carriage return
;
cseg   segment  byte
     assume  cs:cseg,ds:cseg
;
     org    0100h   ;since this will be
               ; a COM file
;
clear:            ;initialize display...
               ;call BIOS video driver to
     mov    ah,15   ;get current display mode:
     int    10h    ;returns AL = mode, and
               ;AH = no. of columns.
     cmp    al,7   ;if we are in graphics modes
     je    clear0  ;(modes 4,5,6) then exit
     cmp    al,3   ;but if we are in mode 0-3
     ja    clear9  ;or 7 then continue.
clear0:           ;set up size of window to
               ;be initialized...
     xor    cx,cx   ;set upper left corner of
               ;window to (X,Y)=(0,0)
     mov    dh,24   ;set Y to 24 for lower right
     mov    dl,ah   ;corner, and X to the number
     dec    dl    ;of columns returned by BIOS
               ;minus 1
     mov    bh,7   ;initialize attribute byte
               ;to "normal" video display,
               ;i.e. white on black.
               ;set SI=address of command
               ;tail's length byte
     mov    si,offset input
     cld         ;clear the Direction Flag
               ;for "LODS" string instruction.
     lodsb        ;check length byte to see if
     or    al,al   ;there's any command tail.
     jz    clear8  ;no,go clear the screen
               ;with normal video attribute
               ;
clear1: lodsb        ;check the next byte of
               ;the command tail,
     cmp    al,cr   ;if carriage return
     je    clear8  ;we are done.
     or    al,20h  ;fold the character to
               ;lower case.
     cmp    al,'a'  ;make sure it's in range a-z
     jb    clear1  ;no, skip it
     cmp    al,'z'
     ja    clear1  ;no, skip it
     cmp    al,'i'  ;I=Set intensity
     jne    clear2  ;jump if not I
     or    bh,08   ;set intensity bit
     jmp    short clear1
clear2: cmp    al,'r'  ;R=Reverse
     jne    clear3  ;jump if not R
     and    bh,088h  ;mask off old foreground/
               ;background bits and
     or    bh,070h  ;change to reverse video
     jmp    short clear1
clear3: cmp    al,'u'  ;U=Underline
     jne    clear4  ;jump if not U
     and    bh,088h  ;mask off old foreground/
               ;background bits and
     or    bh,01h  ;change to underline
     jmp    short clear1
clear4: cmp    al,'b'  ;B=Blink
     jne    clear5  ;jump if not B
     or    bh,080h  ;set blink bit
     jmp    short clear1
clear5: cmp    al,'s'  ;S=Silent
     jne    clear1  ;if not S try next char.
     mov    bh,0   ;if S command, rig for
               ;silent running. Clear
               ;the foreground/background
               ;display control fields, and
               ;don't bother to look for
               ;any more command characters.
               ;
clear8:           ;now we have decoded all
               ;the characters in the
               ;command tail, and are ready
               ;to initialize the display.
               ;BH=  desired attribute
               ;CL,CH=(X,Y),upper left
               ;   corner of window
               ;DL,DH=(X,Y),lower right
               ;   corner of window
     mov    ax,0600h ;AH = function type 6,
               ;AL = lines to scroll (zero)
     int    10h    ;request initialization
               ;of window by BIOS
               ;
     mov    ah,2   ;now set the cursor to
     mov    bh,0   ;(X,Y)=(0,0), Page=0
     xor    dx,dx
     int    10h
               ;
clear9: int    20h    ;exit to PC-DOS
;
cseg   ends
;
     end    clear


</div> </div> </div> </div>
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 汇编源码系列之clean
  • 汇编源码系列之clear

相关文章

  • 2017-06-28汇编源码系列之exec
  • 2017-06-28汇编源码系列之inthand
  • 2017-06-28汇编语言编写DOS下的内存驻留程序(4)
  • 2017-06-28汇编教程之win32消息框
  • 2017-06-28事件对象在多线程编程中的应用
  • 2017-06-28WIN98SE硬盘主引导记录代码数据注释
  • 2017-06-28汇编教程:汇编语言编程实例
  • 2017-06-17文本操作
  • 2017-06-28汇编实模式与保护模式切换实例
  • 2017-06-28汇编源码系列之fxn

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • 中央处理机CPU的组成
    • 比较指令 CMP
    • 汇编语言及意义
    • 动态库的执行时间
    • 关于汇编div/idiv/mul/imul指令的用法
    • 事件对象在多线程编程中的应用
    • 什么是动态链接库
    • 几种基本的逻辑运算
    • 汇编源码系列之cobload
    • Mixer Volume Ctrler V1.0

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有