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,15 +15,12 @@ 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
@ -31,20 +28,28 @@ tsr:
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 showreg:
pop word ptr cs:fcs pushf
pop dword ptr cs:ffl pushad
mov cs:fesp,esp mov bp,sp
push ds es mov ax,ss:[bp+28h]
pusha mov cs:[csr],ax
push word ptr cs:fip mov ax,ss:[bp+26h]
push gs mov cs:[ipr],ax
push fs mov ax,ss:[bp+2Ah]
push ss mov cs:[flr],ax
push es mov cs:[ebxr],ebx
mov cs:[ecxr],ecx
mov cs:[edxr],edx
mov cs:[esir],esi
mov cs:[edir],edi
mov cs:[espr],esp
mov cs:[ebpr],ebp
mov cs:[dsr],ds
mov cs:[esr],es
mov cs:[fsr],fs
mov cs:[gsr],gs
mov cs:[ssr],ss
push ds push ds
push word ptr cs:fcs pop fs
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
push cs
pop es
pop ds pop ds
mov ah,26 mov ah,28h
int 47h int 47h
mov ax,0002
int 47H
mov ah,2 mov ah,2
int 47h int 47h
mov ah,21 mov si,offset etat
mov cl,4
int 47h
mov ah,13 mov ah,13
int 47h
mov ah,6
int 47h
mov ah,6
int 47h
mov si,offset reg mov si,offset reg
int 47h mov di,offset regdata
mov ah,6 mov bx,7
int 47h showregs:
mov ah,21 cmp byte ptr cs:[si+4],":"
mov cl,7 jne endshowregs
int 47h
mov ah,13 mov ah,13
mov si,offset fla
int 47h int 47h
pop edx 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 cx,32
mov ah,11 mov ah,0Ah
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 int 47h
add di,4
jmp showmax
segsss:
xor edx,edx xor edx,edx
pop dx mov dx,cs:[di]
mov cx,16 mov cx,16
popo: mov ah,0Ah
mov ah,13
int 47h
mov ah,10
int 47h
mov ah,5
int 47h int 47h
push si push si
mov si,offset gr
mov ah,13 mov ah,13
mov si,offset blank
int 47h int 47h
mov ah,8 pop si
int 47h add di,2
mov si,offset dr showmax:
add si,7
mov ebp,edx
push si
mov si,offset beginds
mov ah,13 mov ah,13
int 47h int 47h
pop si pop si
add si,5 mov cx,8
dec bx mov al,0
jnz showallreg mov bx,bp
mov ah,34 letshow:
mov di,offset infos mov dl,fs:[bx]
inc bx
mov ah,0Ah
int 47h int 47h
mov ah,25 inc al
mov bl,cs:infos cmp al,10
xor bh,bh jb letshow
dec bl push si
int 47h mov si,offset ende
mov si,offset app
mov ah,13 mov ah,13
int 47h int 47h
mov ah,32 mov si,offset begines
mov bl,cs:infos mov ah,13
xor bh,bh
mov di,ax
dec di
mov cl,116
int 47h int 47h
pop es ds pop si
sti mov bx,bp
waitt: mov cx,8
cmp cs:isstate,0 mov al,0
jne waitt letshow2:
mov ah,27 mov dl,es:[bx]
inc bx
mov ah,0Ah
int 47h int 47h
popa inc al
pop es ds cmp al,10
push dword ptr cs:ffl jb letshow2
push word ptr cs:fcs push si
push word ptr cs:fip 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 jmp endof
reg db ' Etats des registres',0 popes dd 0
fla db 'Eflags:',0
regs db 'EAX:',0 regdata:
db 'EBX:',0 eaxr dd 0
db 'ECX:',0 ebxr dd 0
db 'EDX:',0 ecxr dd 0
db 'ESI:',0 edxr dd 0
db 'EDI:',0 esir dd 0
db 'EBP:',0 edir dd 0
db 'ESP:',0 espr dd 0
db ' CS:',0 ebpr dd 0
db ' DS:',0 ipr dw 0
db ' ES:',0 csr dw 0
db ' FS:',0 dsr dw 0
db ' GS:',0 esr dw 0
db ' SS:',0 fsr dw 0
db ' IP:',0 gsr dw 0
gr db '(',0 ssr dw 0
dr db ')',0 flr dw 0
app db 'Appuyez sur espace pour quitter...',0
ffl dd 0 etat db ' Etat des registres processeurs',0
fcs dw 0
fip dw 0 reg db "eax : ",0
fesp dd 0 db "ebx : ",0
feax dd 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