*/ --------------------------------------------------------------------------------------
*/ 出自: 编程中国 http://www.bc-cn.net
*/ 作者: zhulei1978
*/ 时间: 2007-7-28 编程论坛首发
*/ 声明: 尊重作者劳动,转载请保留本段文字
*/ --------------------------------------------------------------------------------------
输入格式:
先输入抓取屏幕的左上角行列号,再输入抓取屏幕的右下角行列号.输入第3行要输入03
0=<行号<=24,0=<列号<=79
DATA SEGMENT
num db ?,?,?,?
nm1 db ?
nm2 db ?
message1 db 'row1:','$'
buf1 db 3,?
data1 db ?
data2 db ?
message2 db ' col1:','$'
buf2 db 3,?
data3 db ?
data4 db ?
message3 db ' row2:','$'
buf3 db 3,?
data5 db ?
data6 db ?
message4 db ' col2:','$'
buf4 db 3,?
data7 db ?
data8 db ?
shuju db 2000 dup(?)
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
lea dx,message1
mov ah,9
int 21h
MOV DX,OFFSET buf1
MOV AH,0AH
INT 21H
mov cx,0
mov al,data1
sub al,30h
mov bl,10
mul bl
add cx,ax
mov al,data2
sub al,30h
add cx,ax
mov num,cl
mov dl,13
mov ah,2
int 21h
mov dl,10
mov ah,2
int 21h
lea dx,message2
mov ah,9
int 21h
MOV DX,OFFSET buf2
MOV AH,0AH
INT 21H
mov cx,0
mov al,data3
sub al,30h
mul bl
add cx,ax
mov al,data4
sub al,30h
add cx,ax
mov num+1,cl
mov dl,13
mov ah,2
int 21h
mov dl,10
mov ah,2
int 21h
lea dx,message3
mov ah,9
int 21h
MOV DX,OFFSET buf3
MOV AH,0AH
INT 21H
mov cx,0
mov al,data5
sub al,30h
mul bl
add cx,ax
mov al,data6
sub al,30h
add cx,ax
mov num+2,cl
mov dl,13
mov ah,2
int 21h
mov dl,10
mov ah,2
int 21h
lea dx,message4
mov ah,9
int 21h
MOV DX,OFFSET buf4
MOV AH,0AH
INT 21H
mov cx,0
mov al,data7
sub al,30h
mul bl
add cx,ax
mov al,data8
sub al,30h
add cx,ax
mov num+3,cl
mov al,num
cmp al,0
js exit1
cmp al,25
jns exit1
mov al,num+2
cmp al,0
js exit1
cmp al,25
jns exit1
mov al,num+1
cmp al,0
js exit1
cmp al,80
jns exit1
mov al,num+3
cmp al,0
js exit1
cmp al,80
jns exit1
mov al,num
mov ah,num+2
cmp ah,al
js exit1
mov al,num+1
mov ah,num+3
cmp ah,al
js exit1
mov al,num
mov ah,num+2
sub ah,al
add ah,1
mov nm1,ah
mov al,num+1
mov ah,num+3
sub ah,al
add ah,1
mov nm2,ah
mov ax,0b800h
mov es,ax
mov al,num
mov bl,80
mul bl
mov bh,0
mov bl,num+1
add ax,bx
mov bl,2
mul bx
mov bx,ax
jmp flag1
exit1:
jmp exit
flag1:
lea si,shuju
mov ch,0
mov cl,nm1
again1:
push cx
mov cl,nm2
push bx
push si
again2:
mov ah,byte ptr es:[bx]
mov [si],ah
add bx,2
add si,1
loop again2
pop si
add si,80
pop bx
add bx,160
pop cx
loop again1
lea si,shuju
mov ch,0
mov cl,nm1
again3:
mov dl,13
mov ah,2
int 21h
mov dl,10
mov ah,2
int 21h
push cx
mov cl,nm2
mov bx,0
push si
again4:
mov dl,[si]
mov ah,2
int 21h
add si,1
loop again4
pop si
add si,80
pop cx
loop again3
exit:
MOV AH,4CH
INT 21H
CODE ENDS
END START
[此贴子已经被作者于2007-7-30 14:50:42编辑过]