fix: f10 correction de l'arret du programme vers commande.exe. Changement de focntionnement sur F12 mais pas encore terminé

This commit is contained in:
Nicolas Hordé 2004-11-11 16:18:54 +00:00
parent d5a9a53cd6
commit 9465b99c3f
1 changed files with 246 additions and 165 deletions

View File

@ -15,36 +15,41 @@ tsr:
db 2eh,0ffh,1eh db 2eh,0ffh,1eh
dw offsets dw offsets
cli cli
mov cs:feax,eax add dword ptr cs:popes,1
in al,60h
cmp cs:isstate,1 cmp cs:isstate,1
jne nostate je endofforce
cmp al,57 mov cs:isstate,1
jne endof mov cs:eaxr,eax
mov cs:isstate,0 in al,60h
jmp endof
nostate:
cmp al,68 cmp al,68
je F10 je F10
cmp al,87 cmp al,87
je F11 je F11
cmp al,88 cmp al,88
je F12 je F12
endof: endof:
mov eax,cs:feax mov cs:isstate,0
mov eax,cs:eaxr
endofforce:
sti sti
iret iret
isstate db 0 isstate db 0
infos db 40 dup (0) infos db 40 dup (0)
feax dd 0
F10: F10:
mov ax,6000h push cs
push ax pop ds
mov di,0100h mov si,offset com
push di mov ah,5
sti int 49h
mov cs:isstate,0
push gs
push 0100h
db 0CBh db 0CBh
com db 'COMMANDE.EXE',0
F11: F11:
push ax di es push ax di es
push cs push cs
@ -65,154 +70,230 @@ notabove:
f12: f12:
mov cs:isstate,1
pop word ptr cs:fip
pop word ptr cs:fcs
pop dword ptr cs:ffl
mov cs:fesp,esp
push ds es
pusha
push word ptr cs:fip
push gs
push fs
push ss
push es
push ds
push word ptr cs:fcs
push dword ptr cs:fesp
push ebp
push edi
push esi
push edx
push ecx
push ebx
push eax
push dword ptr cs:ffl
push cs
push cs
pop es
pop ds
mov ah,26
int 47h
mov ah,2
int 47h
mov ah,21
mov cl,4
int 47h
mov ah,13
mov si,offset reg
int 47h
mov ah,6
int 47h
mov ah,21
mov cl,7
int 47h
mov ah,13
mov si,offset fla
int 47h
pop edx
mov cx,32
mov ah,11
int 47h
mov ah,5
int 47h
mov ah,10
int 47h
mov si,offset regs
mov bx,8+7
mov ah,21
mov cl,6
int 47h
showallREG:
mov ah,6
int 47h
cmp bx,8
jb nodr
pop edx
mov cx,32
jmp popo
nodr:
mov ah,21
mov cl,1
int 47h
xor edx,edx
pop dx
mov cx,16
popo:
mov ah,13
int 47h
mov ah,10
int 47h
mov ah,5
int 47h
push si
mov si,offset gr
mov ah,13
int 47h
mov ah,8
int 47h
mov si,offset dr
mov ah,13
int 47h
pop si
add si,5
dec bx
jnz showallreg
mov ah,34
mov di,offset infos
int 47h
mov ah,25
mov bl,cs:infos
xor bh,bh
dec bl
int 47h
mov si,offset app
mov ah,13
int 47h
mov ah,32
mov bl,cs:infos
xor bh,bh
mov di,ax
dec di
mov cl,116
int 47h
pop es ds
sti
waitt:
cmp cs:isstate,0
jne waitt
mov ah,27
int 47h
popa
pop es ds
push dword ptr cs:ffl
push word ptr cs:fcs
push word ptr cs:fip
jmp endof
reg db ' Etats des registres',0 showreg:
fla db 'Eflags:',0 pushf
regs db 'EAX:',0 pushad
db 'EBX:',0 mov bp,sp
db 'ECX:',0 mov ax,ss:[bp+28h]
db 'EDX:',0 mov cs:[csr],ax
db 'ESI:',0 mov ax,ss:[bp+26h]
db 'EDI:',0 mov cs:[ipr],ax
db 'EBP:',0 mov ax,ss:[bp+2Ah]
db 'ESP:',0 mov cs:[flr],ax
db ' CS:',0 mov cs:[ebxr],ebx
db ' DS:',0 mov cs:[ecxr],ecx
db ' ES:',0 mov cs:[edxr],edx
db ' FS:',0 mov cs:[esir],esi
db ' GS:',0 mov cs:[edir],edi
db ' SS:',0 mov cs:[espr],esp
db ' IP:',0 mov cs:[ebpr],ebp
gr db '(',0 mov cs:[dsr],ds
dr db ')',0 mov cs:[esr],es
app db 'Appuyez sur espace pour quitter...',0 mov cs:[fsr],fs
ffl dd 0 mov cs:[gsr],gs
fcs dw 0 mov cs:[ssr],ss
fip dw 0 push ds
fesp dd 0 pop fs
feax dd 0 push cs
pop ds
mov ah,28h
int 47h
mov ax,0002
int 47H
mov ah,2
int 47h
mov si,offset etat
mov ah,13
int 47h
mov ah,6
int 47h
mov ah,6
int 47h
mov si,offset reg
mov di,offset regdata
mov bx,7
showregs:
cmp byte ptr cs:[si+4],":"
jne endshowregs
mov ah,13
int 47h
cmp byte ptr cs:[si+3],"g"
je segsss
cmp byte ptr cs:[si+2]," "
je segsss
mov edx,cs:[di]
mov cx,32
mov ah,0Ah
int 47h
add di,4
jmp showmax
segsss:
xor edx,edx
mov dx,cs:[di]
mov cx,16
mov ah,0Ah
int 47h
push si
mov ah,13
mov si,offset blank
int 47h
pop si
add di,2
showmax:
add si,7
mov ebp,edx
push si
mov si,offset beginds
mov ah,13
int 47h
pop si
mov cx,8
mov al,0
mov bx,bp
letshow:
mov dl,fs:[bx]
inc bx
mov ah,0Ah
int 47h
inc al
cmp al,10
jb letshow
push si
mov si,offset ende
mov ah,13
int 47h
mov si,offset begines
mov ah,13
int 47h
pop si
mov bx,bp
mov cx,8
mov al,0
letshow2:
mov dl,es:[bx]
inc bx
mov ah,0Ah
int 47h
inc al
cmp al,10
jb letshow2
push si
mov si,offset ende
mov ah,13
int 47h
mov si,offset beginint
mov ah,13
int 47h
pop si
mov edx,ebp
mov ah,8
int 47h
push si
mov si,offset endint
mov ah,13
int 47h
pop si
mov ah,6
int 47h
jmp showregs
endshowregs:
mov ah,6
int 47h
mov si,offset pile
mov ah,13
int 47h
mov ah,6
int 47h
mov bp,sp
mov di,0ffffh
sub di,bp
xor si,si
showstack:
mov dl,'+'
mov ah,07h
int 47h
mov ah,0Ah
mov cx,8
mov dx,si
int 47h
mov dl,':'
mov ah,07h
int 47h
mov dx,ss:[bp+si]
mov ah,0Ah
mov cx,16
int 47h
mov ah,06
int 47h
inc si
inc si
cmp si,di
jb showstack
mov ah,0ah
mov edx,cs:popes
mov cx,32
int 47h
xor ax,ax
int 16h
mov ah,29h
int 47h
popad
popf
jmp endof
popes dd 0
regdata:
eaxr dd 0
ebxr dd 0
ecxr dd 0
edxr dd 0
esir dd 0
edir dd 0
espr dd 0
ebpr dd 0
ipr dw 0
csr dw 0
dsr dw 0
esr dw 0
fsr dw 0
gsr dw 0
ssr dw 0
flr dw 0
etat db ' Etat des registres processeurs',0
reg db "eax : ",0
db "ebx : ",0
db "ecx : ",0
db "edx : ",0
db "esi : ",0
db "edi : ",0
db "esp : ",0
db "ebp : ",0
db "ip : ",0
db "cs : ",0
db "ds : ",0
db "es : ",0
db "fs : ",0
db "gs : ",0
db "ss : ",0
db "flag: ",0
pile db 'Stack :',0
blank db ' ',0
beginint db ' (',0
endint db ') ',0
begines db ' es[',0
beginds db ' ds[',0
ende db '] ',0
end start end start