;;截画程序 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 db56*3 dup (0) path db 'pic*.',0 dta db5 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 out1h,al pop ax out1h,al mov al,20h out0h,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 int1h mov handle,ax mov bx,handle mov dx,offset buffer mov cx,768 mov ah,40h int1h 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 int1h ret write endp writeend: mov ah,3eh int1h 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 int1h mov dx,offset path mov ah,4eh mov cx,0 int1h start: cmp ax,0002 jz end cmp ax,0003 je end cmp ax,0018 je end findnext: mov dx,offset path mov ah,4fh int1h 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 int1h mov dx,offset dta+30 int1h mov si,offset dta+35 mov byte ptr [si],0 mov ax,3509h int1h mov di,offset int9 mov [di],bx mov [di+2],es push cs pop ds mov dx,offset new_int mov ax,2509h int1h sti mov dx,offset init int7h code ends end begin
|