Made Netstat application run on P5 processors

git-svn-id: svn://kolibrios.org@1528 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2010-07-27 16:10:11 +00:00
parent c6d66896a5
commit f01c3da0f2
2 changed files with 85 additions and 68 deletions

View File

@ -518,6 +518,31 @@ struct FILEINFO
Size dq ? Size dq ?
ends ends
if __CPU_type eq p5 ; CMOVcc isnt supported on the P5
cmove fix cmovz
macro cmovz reg1, reg2 {
local .jumpaddr
jnz .jumpaddr
mov reg1, reg2
.jumpaddr:
}
cmovne fix cmovnz
macro cmovnz reg1, reg2 {
local .jumpaddr
jz .jumpaddr
mov reg1, reg2
.jumpaddr:
}
end if
; constants ; constants
; events ; events

View File

@ -11,7 +11,7 @@ use32
db 'MENUET01' ; 8 byte id db 'MENUET01' ; 8 byte id
dd 0x01 ; header version dd 0x01 ; header version
dd START ; start of code dd START ; start of code
dd IM_END ; size of image dd I_END ; size of image
dd (I_END+0x100) ; memory for app dd (I_END+0x100) ; memory for app
dd (I_END+0x100) ; esp dd (I_END+0x100) ; esp
dd I_PARAM , 0x0 ; I_Param , I_Icon dd I_PARAM , 0x0 ; I_Param , I_Icon
@ -25,11 +25,9 @@ include '..\debug-fdo.inc'
START: ; start of execution START: ; start of execution
; TODO: check Parameters ; TODO: check Parameters
DEBUGF 1, 'Hello!\n' DEBUGF 1, 'Netstat application loaded!\n'
redraw: redraw:
mcall 12, 1 mcall 12, 1
mcall 0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc , , name mcall 0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc , , name
@ -42,7 +40,7 @@ START: ; start of execution
cmove esi, edi cmove esi, edi
mcall 8, 25 shl 16 + 65, 25 shl 16 + 20 mcall 8, 25 shl 16 + 65, 25 shl 16 + 20
@@: .morebuttons:
inc edx inc edx
add ebx, 75 shl 16 add ebx, 75 shl 16
mov esi, 0x00aaaaff mov esi, 0x00aaaaff
@ -52,12 +50,12 @@ START: ; start of execution
mcall mcall
cmp edx, 105 cmp edx, 105
jle @r jle .morebuttons
mcall 4, 28 shl 16 + 31, 0x80000000, modes mcall 4, 28 shl 16 + 31, 0x80000000, modes
cmp [mode], 101 cmp [mode], 101
jne @f jne .no_eth
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
add ebx, 18 add ebx, 18
@ -89,10 +87,10 @@ START: ; start of execution
call draw_mac call draw_mac
jmp end_of_draw jmp end_of_draw
@@: .no_eth:
cmp [mode], 102 cmp [mode], 102
jne @f jne .no_ip
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
add ebx, 18 add ebx, 18
@ -146,10 +144,10 @@ START: ; start of execution
jmp end_of_draw jmp end_of_draw
@@: .no_ip:
cmp [mode], 103 cmp [mode], 103
jne @f jne .no_arp
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
add ebx, 18 add ebx, 18
@ -161,7 +159,7 @@ START: ; start of execution
jmp end_of_draw jmp end_of_draw
@@: .no_arp:
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
add ebx, 18 add ebx, 18
@ -176,7 +174,7 @@ START: ; start of execution
mainloop: mainloop:
mcall 23,50 ; wait for event with timeout (0,5 s) mcall 23,500 ; wait for event with timeout (0,5 s)
cmp eax, 1 cmp eax, 1
je redraw je redraw
@ -461,11 +459,9 @@ draw_mac:
add edx, 15 shl 16 add edx, 15 shl 16
mcall mcall
mov eax, [esp]
add esp, 6+4
sub edx, 5*15 shl 16 sub edx, 5*15 shl 16
jmp eax ret 6
draw_ip: draw_ip:
@ -493,15 +489,11 @@ draw_ip:
mcall mcall
sub edx, 3*30 shl 16 sub edx, 3*30 shl 16
mov eax, [esp] ret 4
add esp, 8
jmp eax
; DATA AREA ; DATA AREA
IM_END:
name db 'Netstat',0 name db 'Netstat',0
mode db 101 mode db 101
device db 0 device db 0