pop ax ;restore registers iret ;return to caller new_int_9h endp begin proc near push es ;save psp base address mov dx,seg msgs mov ds,dx mov dx,offset msg_0 mov ah,9 逆风者 int 21h mov ax,3500h free_vector int 21h mov di,bx ;ES:DI ===> start of INT 0CDh ISR mov si,offset copyright mov ax,cs mov ds,ax ;DS:SI ===> THIS code copyright notice mov cx,cright_len cld repe cmpsb ;compare je loaded ;if equal then already loaded mov ax,2500h free_vector mov dx,cs mov ds,dx mov dx,offset copyright int 21h ;point free_vector INT vector to ;our copyright notice mov ax,3509h int 21h ;get pointer to INT 9 ISR mov cs:old_int_9_ofs,bx mov cs:old_int_9_seg,es ;put it IN the new INT 9 ISR mov ax,2509h mov dx,offset new_int_9h push cs pop ds int 21h ;point INT 9 vector to our ISR mov dx,seg msgs mov ds,dx mov dx,offset msg_1 mov ah,9 int 21h ;print loaded msg pop ds ;get saved psp base address mov es,ds:(2Ch) mov ah,49h int 21h ;free environment's memory ;assume no error mov dx,offset begin ;everything up to BEGIN add dx,10Fh ;and all the bytes needed to mov cl,4 ;make a full paragraph ... shr dx,cl mov ax,3100h ;... stay resident int 21h ;and return exit code = 0 loaded: pop ax ;get psp address out of stack ;any register will do mov dx,seg msgs mov ds,dx ;point DS to our data area mov dx,offset msg_2 mov ah,9 int 21h ;print already loaded msg mov ax,4C01h int 21h ;terminate with exit code = 1 begin endp nocad ends msgs segment word 'DATA' msg_0 db 10,13,'NOCAD: Prevent CTRL ALT DEL from restarting the ' db 'system',10,13,'Author: Antonio Quezada-Duarte',10,13,'$' msg_1 db 10,13,'NOCAD Loaded OK.',10,13,'$' msg_2 db 10,13,'NOCAD Already Loaded.',10,13,'$' msgs ends stack segment para stack 'STACK' dw 1024 dup (?) stack ends end begin
本文章更多内容:<<上一页 - 1 - 2 |