Réponse acceptée !
justement, je me suis aperçu que nasm n'était pas approprié pour ça ...
j'ai donc pris tasm.
et maintenant ca fonctionne !
voilà le code :
Code Segment
Org 100h
Assume Cs:Code
Start: Jmp Main ; Go to the Entry Point
;####################################################################
;########################### Vars & Consts ##########################
NewIntMsgS DB 'This interrupt has been erased','$'
IntDet Equ 19h
TstFnc Equ 19h
TstFncR Equ 0FFh
;####################################################################
;############################ Procedures ############################
CheckInstalled Proc Near
Mov AH,19h
Mov AX,TstFnc
Int 19h
Cmp AH,TstFncR
Je CheckInstalled_OK
Jne CheckInstalled_ERR
Ret
CheckInstalled_OK:
Call DetourneInt
Call GoTSR
CheckInstalled_ERR:
Mov DX,Offset(AiMsg)
Call PrintStr
Int 20h
CheckInstalled EndP
DetourneInt Proc Near
;Détourne l'interrupt
Mov AH,25H
Mov AL,IntDet
Mov DX,Offset(NewInt)
Int 21h
Ret
DetourneInt EndP
GoTSR Proc Near
;Met le programme en TSR
Mov DX,Offset(DynVarsEnd)
Inc DX
Int 27h
Ret
GoTSR EndP
NewInt Proc Near
Cmp AX,TstFnc
Jne NewIntMsg
NewIntTest:
Mov AH,TstFncR
Jmp IntRet
NewIntMsg:
Mov AL,'X'
Mov BL,7
Mov CX,1
;Call PrintChr
IntRet:
IRet
NewInt EndP
PrintChr Proc Near
;Affiche un chr. à l'écran avec l'int 10h (Al=chr, Bl=couleur, Cx=répet.)
Mov AH,09h
Mov BH,00h
Int 0h
PrintChr EndP
PrintStr Proc Near
;Affiche une chaine de caractères à l'écran (DS:DX)
Mov AH,09h
Int 21h
Ret
PrintStr EndP
;####################################################################
;########################### Entry Point ############################
Main Proc Near
;Entry Point
;Affiche le titre
Mov DX,Offset(CmdMsg)
Call PrintStr
;Call CheckInstalled ;Il va rebooter !!
Call DetourneInt
Call GoTSR
; Ret
Main EndP
;####################################################################
;########################### Dynamics Vars ############################
DynVars: ;Début des vars. dyn.
CmdMsg DB '+------------------------------------+',13,10
DB '| Anti-Reboot(AR) Protection |',13,10
DB '+------------------------------------+',13,10
DB '$'
AiMsg DB 'Program already installed !','$'
DynVarsEnd: ;Fin des vars dyn.
;####################################################################
;############################ Code Ends #############################
Code Ends
End Start
PS: j'utilise notepad++ comme éditeur ... il peut éditer n'importe quoi !!