专截320*200的截画程序
2008-04-28 09:33:00 来源:WEB开发网;;截画程序
code segment
assume cs:code,ds:code
org 100h
begin:jmp init
int9 dd ?
ddxx db 0
mess db 'Now Start With $'
handle dw ?
buffer db 256*3 dup (0)
path db 'pic*.',0
dta db 45 dup(?)
new_int proc far
sti
push ax
push es
xor ax,ax
mov es,ax
in al,60h
test al,80h
jnz exit1
test byte ptr es:[0417h],100b
jz exit1
cmp al,59
jnz exit1
push ax
push bx
push cx
push dx
push bp
push di
push si
push ds
push cs
pop ds
in al,61h
push ax
or al,80h
out 61h,al
pop ax
out 61h,al
mov al,20h
out 20h,al
call savescr
exit:
pop ds
pop si
pop di
pop bp
pop dx
pop cx
pop bx
pop ax
exit1:
pop es
pop ax
jmp cs:int9
new_int endp
savescr proc near
push cs
pop ds
mov ax,1017h
mov bx,0
mov cx,256
mov dx,cs
mov es,dx
mov dx,offset buffer
int 10h
mov dx,offset dta+30
mov ah,3ch
mov cx,0000
int 21h
mov handle,ax
mov bx,handle
mov dx,offset buffer
mov cx,768
mov ah,40h
int 21h
mov dx,0
mov cx,5
rewrite:
push cx
mov cx,65535
rr:
mov dl,cs:ddxx
call write
inc byte ptr cs:ddxx
pop cx
loop rewrite
jmp writeend
write proc near
mov ax,4f05h
mov bx,0
int 10h
mov dx,0
mov ax,0a000h
mov ds,ax
mov ah,40h
mov bx,cs:handle
int 21h
ret
write endp
writeend:
mov ah,3eh
int 21h
push cs
pop ds
mov bx,offset dta+35
mov al,[bx-1]
inc al
cmp al,58
jnz nn
mov cl,[bx-2]
inc cl
mov [bx-2],cl
mov al,'0'
nn:
mov [bx-1],al
quit :ret
savescr endp
init :
cli
push cs
pop ds
mov dx,offset dta
mov ah,1ah
int 21h
mov dx,offset path
mov ah,4eh
mov cx,0
int 21h
start:
cmp ax,0002
jz end
cmp ax,0003
je end
cmp ax,0018
je end
findnext:
mov dx,offset path
mov ah,4fh
int 21h
jb end
jmp start
end:
mov si,offset dta+35
mov byte ptr [si],'$'
mov al,[si-1]
inc al
cmp al,58
jnz n
mov al,'0'
mov bl,[si-2]
inc bl
mov [si-2],bl
n:
mov [si-1],al
mov ah,9
mov dx,offset mess
int 21h
mov dx,offset dta+30
int 21h
mov si,offset dta+35
mov byte ptr [si],0
mov ax,3509h
int 21h
mov di,offset int9
mov [di],bx
mov [di+2],es
push cs
pop ds
mov dx,offset new_int
mov ax,2509h
int 21h
sti
mov dx,offset init
int 27h
code ends
end begin
赞助商链接