forked from KolibriOS/kolibrios
Made Netstat application run on P5 processors
git-svn-id: svn://kolibrios.org@1528 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
c6d66896a5
commit
f01c3da0f2
@ -518,6 +518,31 @@ struct FILEINFO
|
||||
Size dq ?
|
||||
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
|
||||
|
||||
; events
|
||||
|
@ -11,7 +11,7 @@ use32
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
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) ; esp
|
||||
dd I_PARAM , 0x0 ; I_Param , I_Icon
|
||||
@ -25,11 +25,9 @@ include '..\debug-fdo.inc'
|
||||
START: ; start of execution
|
||||
; TODO: check Parameters
|
||||
|
||||
DEBUGF 1, 'Hello!\n'
|
||||
|
||||
DEBUGF 1, 'Netstat application loaded!\n'
|
||||
|
||||
redraw:
|
||||
|
||||
mcall 12, 1
|
||||
|
||||
mcall 0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc , , name
|
||||
@ -42,7 +40,7 @@ START: ; start of execution
|
||||
cmove esi, edi
|
||||
mcall 8, 25 shl 16 + 65, 25 shl 16 + 20
|
||||
|
||||
@@:
|
||||
.morebuttons:
|
||||
inc edx
|
||||
add ebx, 75 shl 16
|
||||
mov esi, 0x00aaaaff
|
||||
@ -52,12 +50,12 @@ START: ; start of execution
|
||||
mcall
|
||||
|
||||
cmp edx, 105
|
||||
jle @r
|
||||
jle .morebuttons
|
||||
|
||||
mcall 4, 28 shl 16 + 31, 0x80000000, modes
|
||||
|
||||
cmp [mode], 101
|
||||
jne @f
|
||||
jne .no_eth
|
||||
|
||||
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
||||
add ebx, 18
|
||||
@ -89,10 +87,10 @@ START: ; start of execution
|
||||
call draw_mac
|
||||
jmp end_of_draw
|
||||
|
||||
@@:
|
||||
.no_eth:
|
||||
|
||||
cmp [mode], 102
|
||||
jne @f
|
||||
jne .no_ip
|
||||
|
||||
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
||||
add ebx, 18
|
||||
@ -146,10 +144,10 @@ START: ; start of execution
|
||||
|
||||
jmp end_of_draw
|
||||
|
||||
@@:
|
||||
.no_ip:
|
||||
|
||||
cmp [mode], 103
|
||||
jne @f
|
||||
jne .no_arp
|
||||
|
||||
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
||||
add ebx, 18
|
||||
@ -161,7 +159,7 @@ START: ; start of execution
|
||||
|
||||
jmp end_of_draw
|
||||
|
||||
@@:
|
||||
.no_arp:
|
||||
|
||||
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
||||
add ebx, 18
|
||||
@ -176,7 +174,7 @@ START: ; start of execution
|
||||
|
||||
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
|
||||
je redraw
|
||||
@ -461,11 +459,9 @@ draw_mac:
|
||||
add edx, 15 shl 16
|
||||
mcall
|
||||
|
||||
mov eax, [esp]
|
||||
add esp, 6+4
|
||||
sub edx, 5*15 shl 16
|
||||
|
||||
jmp eax
|
||||
ret 6
|
||||
|
||||
|
||||
draw_ip:
|
||||
@ -493,15 +489,11 @@ draw_ip:
|
||||
mcall
|
||||
|
||||
sub edx, 3*30 shl 16
|
||||
mov eax, [esp]
|
||||
add esp, 8
|
||||
jmp eax
|
||||
ret 4
|
||||
|
||||
|
||||
; DATA AREA
|
||||
|
||||
IM_END:
|
||||
|
||||
name db 'Netstat',0
|
||||
mode db 101
|
||||
device db 0
|
||||
|
Loading…
Reference in New Issue
Block a user