AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > 汇编语言

汇编源码--CLR

51自学网 2015-09-08 http://www.51zixue.net
	PAGE   60,132;  CLR.ASM   05/29/84;  Subroutine called by a basic program to scroll a window.;;DGROUP	GROUP	DATASEGDATASEG SEGMENT PARA PUBLIC 'DATA'FUNCT	DW	0		;function 1=6,0=7FG_COLR DW	0		;forground colorBG_COLR DW	0		;backround colorLINES	DW	0		;number of lines to scroll or 0 for clearULROW	DW	0		;upper left rowULCOL	DW	0		;upper left columnLRROW	DW	0		;lower right rowLRCOL	DW	0		;lower left columnATTRIB	DB	0		;temp hold for attribute byteCALNU	DB	0		;temp hold for call function 6 or 7DATASEG ENDS;CSEG	SEGMENT 'CODE'	ASSUME	CS:CSEG	PUBLIC CLRCLR	PROC	FAR	PUSH	BP		;BP unknown (don't care)	MOV	BP,SP		;set base for parm list	PUSH	DS		;DS -> basic work area	PUSH	ES		;ES -> basic work area	MOV	AX,DATASEG	;establish data addressability	MOV	DS,AX		;now DS -> my data	ASSUME	DS:DATASEG;;	MOV	SI,SS:[BP+6]   ;get addr of parameter	MOV	AX,ES:[SI]	;get value of parm	MOV	FUNCT,AX	MOV	SI,SS:[BP+8]   ;get addr of parameter	MOV	AX,ES:[SI]	;get value of parm	MOV	BG_COLR,AX	MOV	SI,SS:[BP+10]	;get addr of parameter	MOV	AX,ES:[SI]	;get value of parm	MOV	FG_COLR,AX	MOV	SI,SS:[BP+12]	;get addr of parameter	MOV	AX,ES:[SI]	;get value of parm	MOV	LINES,AX	MOV	SI,SS:[BP+14]	;get addr of parameter	MOV	AX,ES:[SI]	;get value of parm	MOV	ULROW,AX	MOV	SI,SS:[BP+16]	;get addr of parameter	MOV	AX,ES:[SI]	;get value of parm	MOV	ULCOL,AX	MOV	SI,SS:[BP+18]	 ;get addr of parameter	MOV	AX,ES:[SI]	;get value of parm	MOV	LRROW,AX	MOV	SI,SS:[BP+20]	 ;get addr of parameter	MOV	AX,ES:[SI]	;get value of parm	MOV	LRCOL,AX;	MOV	AX,1	SUB	LRROW,AX	;convert 1-80 cols	SUB	LRCOL,AX	; and 1-25 rows into	SUB	ULROW,AX	; 0-79 cols and	SUB	ULCOL,AX	; 0-24 rows;;  change forground & backround colors into single attribute byte;	MOV	BX,FG_COLR	;move foreground color to bx	MOV	AL,BL		;move lower byte to al	MOV	BX,BG_COLR	;move backround color to bx	MOV	AH,BL		;move lower byte to ah	CMP	AL,15		;check for color > 15 ie blinking	JG	BLNK		;if > 15 then set blink bit	AND	AL,15		;set normal fg color	JMP	N_BLNK		;BLNK:	OR	AL,128		;set blink bit 7	AND	AL,143		;zero out bit 6,5,4 used for backroundN_BLNK: AND	AH,7		;zero out bit 7,6,5,4,3 used for forground	MOV	CL,4		;4 bit shift count	SHL	AH,CL		;shift right 3 bits to pos 6,5,4	OR	AL,AH		;combine for & back to form attribute byte	MOV	ATTRIB,AL	;move it to STORAGE;;   convert 1 and 0 to 6 and 7 for routine call;	MOV	BX,FUNCT	;move function into bx	CMP	BL,0		;compare to one	JG	F6		;if 1 then function is 6	MOV	AH,7H		;set function 7	JMP	OUT1		;jump aroundF6:	MOV	AH,6H		;set function 6OUT1:	MOV	CALNU,AH	;move it to storage;;;  set up for bios rom call 10 function 6 (scroll up );	PUSH	BX	MOV	BX,LINES	;set # of lines to scroll or 0 to clear	MOV	AL,BL		;put in pass register	MOV	BX,ULROW	;set upper left row of block 0-24	MOV	CH,BL		;put in pass register	MOV	BX,ULCOL	;set upper left column of block 0-79	MOV	CL,BL		;put in pass register	MOV	BX,LRROW	;set lower right row of block 0-24	MOV	DH,BL		;put in pass register	MOV	BX,LRCOL	;set lower right column of block 0-79	MOV	DL,BL		;put in pass register	MOV	BL,CALNU	;set call number 6 to scroll up 7 down	MOV	AH,BL		;put in pass register	MOV	BL,ATTRIB	;set color attribute byte	MOV	BH,BL		;put in pass register	INT	10H		; make bios call	POP	BX;FINISH: POP	ES	POP	DS	POP	BP	RET	16		;return to basicCLR	ENDPCSEG	ENDS	END

 

 

 
上一篇:汇编源码--COMINT  下一篇:汇编源码--CLOCK