hi,
i'm trying to write a program that changes the 23h interrupt with my own handler which is to display "bonjour"32000 time and when ctrl break is pushed a msg"do you want to exit the program? y/n" is displayed.if the user select y the program will exit else the "bonjour" displaying will continue.i wrote a code but there are errors that i honestly can't fix,i spent a week without finding a solution,i'm new in this language so i did what i can,if you could help me plz
here is my code:
Title interruption23h
redirige_int macro
mov ax,3523h
int 21h
mov [vecteur],bx
mov [vecteur+2],es
push cs
pop ds
mov ax,2523h
mov dx,offset cs:traiter_ctrl_break
int 21h
mov es,cs:[002Ch] ; free environment block
mov ah,49h
int 21h
mov ax,3100h ; termination and stay resident
int 21h
traiter_ctrl_break:
mov ah,9
mov dx,offset msg2
int 21h
verif1:
mov ah,1
int 21h
cmp al,'o'
jne verif2
jmp fin_propre
verif2:
mov ah,1
int 21h
cmp al,'n'
jne verif1
jmp afficher_bonjour
fin_propre:
mov bx,[vecteur]
mov es,[vecteur+2]
mov al,20h
out 20h,al ;End Of Interrupt
popad
iret
endm
.model small
.stack 100h
.386
.data
v dw 32000
vecteur dw 00h,00h
msg1 db 10,13,"bonjour$"
msg2 db 10,13,"souhaitez vous vraiment fermer le programme?(o/n)$"
num_int db 23h
.code
main proc
mov dx,@data
mov ds,dx
mov cx,0
redirige_int
afficher_bonjour:
mov ah,9
mov dx,offset msg1
int 21h
inc cx
cmp cx,v
jne afficher_bonjour
mov ah,4ch
int 21h
main endp
end main