clear:汇编源码系列的clear

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

     name   clear
     page   55,132
     title   'CLEAR --- control PC display'
;
; CLEAR Utility to clear display
; and 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
;
cseg   segment 
     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:
         10h    ;s AL = mode, and
               ;AH = no. of columns.
     cmp    al,7   ; we are in graphics modes
     je    clear0  ;(modes 4,5,6) then exit
     cmp    al,3   ;but we are in mode 0-3
     ja    clear9  ;or 7 then continue.
clear0:           ; up size of window to
               ;be initialized...
     xor    cx,cx   ; upper left corner of
               ;window to (X,Y)=(0,0)
     mov    dh,24   ; Y to 24 for lower right
     mov    dl,ah   ;corner, and X to the number
     dec    dl    ;of columns ed by BIOS
               ;minus 1
     mov    bh,7   ;initialize attribute
               ;to "normal" video display,
               ;i.e. white _disibledevent=0
     xor    dx,dx
         10h
               ;
clear9:     20h    ;exit to PC-DOS
;
cseg   ends
;
     end    clear



Tags:  cleanclear cleartype usbclear clear

延伸阅读

最新评论

发表评论