Tuesday, October 26, 2010

Compilation of various source - CLEAR


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,
; Ie 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 az
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





相关链接:



CorelDRAW 10 produced a wonderful example of



DV to AVI



Toyota Authorized Dealer



How To Add The Equivalent In The R5 Name (Alternate Name)



myine electronics ira wi fi internet radio Adapter



PMP EXAM tips



MKV to Zune



"Dalian Sigma Elevator" use EastFax



Job On The Road A Few Lessons To Remember



Premier Download Managers



Reviews Trace And Ping Tools



SWF To MP4



Getting Started with Corel Draw 10 (4) hands to create vector graphics (1)



Nanfang Daily: looking forward to the first General Secretary of micro-Bo



No comments:

Post a Comment