Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 485 → Rev 484

/programs/network/mp3s/trunk/mp3s.asm
File deleted
/programs/network/mp3s/trunk/build_en.bat
File deleted
\ No newline at end of file
/programs/network/mp3s/trunk/build_ru.bat
File deleted
\ No newline at end of file
/programs/network/popc/trunk/popc.asm
9,7 → 9,7
;; Compile with FASM for Menuet ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include '..\..\..\macros.inc'
 
version equ '0.1'
 
use32
30,7 → 30,7
 
mov eax,70
mov ebx,filel
mcall
int 0x40
 
test eax,eax
jz @f
52,8 → 52,6
 
mov ebp,0
mov edx,I_END
 
redraw: ; redraw
call draw_window ; at first, draw the window
 
still:
60,10 → 58,10
 
mov eax,5
mov ebx,1
mcall
int 0x40
 
mov eax,11 ; wait here for event
mcall
int 0x40
 
cmp eax,1 ; redraw
je redraw
108,7 → 106,7
mov [ebx+12],eax
 
mov eax,70
mcall
int 0x40
 
popa
 
152,7 → 150,7
mov eax,53
mov ebx,7
mov ecx,[socket]
mcall
int 0x40
mov [mcounter],0
 
cmp [esi],dword 'quit'
177,12 → 175,12
mov ecx,[socket]
mov edx,14
mov esi,quitc
mcall
int 0x40
mov [mcounter],0
 
mov eax,5
mov ebx,150
mcall
int 0x40
 
call read_incoming_data
 
189,16 → 187,16
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
 
mov eax,5
mov ebx,2
mcall
int 0x40
 
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
 
mov [server_active],0
 
211,10 → 209,16
;;
 
 
redraw: ; redraw
 
call draw_window
jmp still
 
 
key:
 
mov eax,2
mcall
int 0x40
 
jmp still
 
222,13 → 226,13
button: ; button
 
mov eax,17 ; get id
mcall
int 0x40
 
cmp ah,60
jne no_open
mov eax, 70
mov ebx, tinypad_start
mcall
int 0x40
jmp still
no_open:
 
235,7 → 239,7
cmp ah,1 ; close program
jne noclose
mov eax,-1
mcall
int 0x40
noclose:
 
cmp ah,51
266,10 → 270,10
mov [ccounter],0
 
mov eax,3
mcall
int 0x40
 
mov eax,3
mcall
int 0x40
mov ecx,eax
and ecx,0xffff
 
278,7 → 282,7
mov edx,110
mov esi,dword [ip]
mov edi,1
mcall
int 0x40
mov [socket], eax
 
ret
290,7 → 294,7
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
mov [header_sent],0
mov [mail_rp],0
mov [server_active],0
316,7 → 320,7
mov eax,53
mov ebx,6
mov ecx,[socket]
mcall
int 0x40
 
mov [status],eax
 
331,7 → 335,7
mov ebx,200*65536+30
mov ecx,160*65536+10
mov edx,0xffffff
mcall
int 0x40
 
pop ecx
 
342,7 → 346,7
mov ebx,3*65536
mov edx,200*65536+160
mov esi,0x000000
mcall
int 0x40
 
nopr:
 
445,11 → 449,11
 
f11:
mov eax,10
mcall
int 0x40
cmp eax,2
jne read_done
mov eax,2
mcall
int 0x40
shr eax,8
cmp eax,13
je read_done
545,7 → 549,7
shl ecx,16
mov cx,9
mov edx,0xffffff
mcall
int 0x40
 
cmp [len],l3
je noprt
556,7 → 560,7
add ebx,[ya]
mov ecx,0x000000
mov esi,23
mcall
int 0x40
 
noprt:
 
774,7 → 778,7
mov eax, 53
mov ebx, 2
mov ecx, [socket]
mcall
int 0x40
 
mov ecx,-1
 
784,7 → 788,7
mov eax, 53
mov ebx, 3
mov ecx, [socket]
mcall
int 0x40
 
mov ecx,0
 
806,7 → 810,7
 
mov eax,12
mov ebx,1
mcall
int 0x40
 
mov eax,0 ; draw window
mov ebx,5*65536+435
813,7 → 817,7
mov ecx,5*65536+232
mov edx,0x13ffffff
mov edi,labelt
mcall
int 0x40
 
mov [old_status],300
 
822,7 → 826,7
mov ecx,155*65536+10
mov edx,22
mov esi,0x44cc44
mcall
int 0x40
 
; mov eax,8 ; button: close socket
mov ebx,295*65536+22
829,7 → 833,7
mov ecx,155*65536+10
mov edx,24
mov esi,0xcc4444
mcall
int 0x40
 
; mov eax,8 ; button: text entries
mov ebx,243*65536+8
837,7 → 841,7
mov edx,51
mov esi,0x4488dd
newi:
mcall
int 0x40
inc edx
add ecx,12*65536
cmp edx,53
848,13 → 852,13
mov ecx,190*65536+14
mov edx,60
mov esi,0x5577dd
mcall
int 0x40
 
mov eax,38 ; line
mov ebx,5*65536+430
mov ecx,114*65536+114
mov edx,0x000000
mcall
int 0x40
 
mov ebx,5*65536+133 ; info text
mov ecx,0x000000
862,7 → 866,7
mov esi,70
newline:
mov eax,4
mcall
int 0x40
add ebx,12
add edx,70
cmp [edx],byte 'x'
873,7 → 877,7
 
mov eax,12
mov ebx,2
mcall
int 0x40
 
popa
 
898,12 → 902,12
mov bx,word [rxs]
imul bx,6
mov edx,0xffffff
mcall
int 0x40
popa
push ecx
mov eax,4
mov ecx,0
mcall
int 0x40
add edx,[rxs]
add ebx,10
pop ecx
/programs/network/popc/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm popc.asm popc
@erase lang.inc
@pause
/programs/network/popc/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm popc.asm popc
@erase lang.inc
@pause
/programs/network/ftps/trunk/FTPS.ASM
20,7 → 20,7
dd 0x7FFF0 ; esp = 0x7FFF0
dd 0, 0 ; no params, no path
 
include '..\..\..\macros.inc'
include 'macros.inc'
; Various states of client connection
USER_NONE equ 0 ; Awaiting a connection
USER_CONNECTED equ 1 ; User just connected, prompt given
55,7 → 55,7
mov eax,53
mov ebx,6 ; Get socket status
mov ecx,[CmdSocket]
mcall
int 0x40
 
mov ebx, [CmdSocketStatus]
mov [CmdSocketStatus], eax
97,7 → 97,7
waitev:
mov eax,23 ; wait here for event
mov ebx,1 ; Delay for up to 1s
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
je red
111,7 → 111,7
mov eax, 53
mov ebx, 2 ; Get # of bytes in input queue
mov ecx, [CmdSocket]
mcall
int 0x40
test eax, eax
jz still
 
119,7 → 119,7
mov eax, 53
mov ebx, 3 ; Get a byte from socket in bl
mov ecx, [CmdSocket]
mcall
int 0x40
 
call ftpRxCmdData ; process incoming ftp command
 
127,7 → 127,7
mov eax, 53
mov ebx, 2 ; Get # of bytes in input queue
mov ecx, [CmdSocket]
mcall
int 0x40
cmp eax, 0
jne read_input
 
145,12 → 145,12
 
key: ; KEY
mov eax,2 ; get but ignore
mcall
int 0x40
jmp still
 
button:
mov eax,17
mcall
int 0x40
cmp ah,1
jne still
 
158,11 → 158,11
mov eax,53
mov ebx,8
mov ecx,[CmdSocket]
mcall
int 0x40
 
; ... terminate program
or eax,-1
mcall
mov eax,-1
int 0x40
jmp still
 
 
175,7 → 175,7
 
mov eax,12
mov ebx,1
mcall
int 0x40
 
xor eax,eax ; DRAW WINDOW
mov ebx,100*65536+491 + 8 +15
182,7 → 182,7
mov ecx,100*65536+270 + 20 ; 20 for status bar
mov edx,0x13000000
mov edi,labelt
mcall
int 0x40
 
; draw status bar
mov eax, 13
189,7 → 189,7
mov ebx, 4*65536+484 + 8 +15
mov ecx, 270*65536 + 3
mov edx, 0x00557799
mcall
int 0x40
 
 
mov esi,contlen-contt ; display connected status
203,7 → 203,7
mov eax,4 ; status text
mov ebx,380*65536+276
mov ecx,0x00ffffff
mcall
int 0x40
 
; Draw the text on the screen, clearing it first
; This can go when we loose debuggin info.
217,7 → 217,7
 
mov eax,12
mov ebx,2
mcall
int 0x40
 
popa
 
262,7 → 262,7
shl ebx, 16
mov bx, 6
mov eax, 13
mcall
int 0x40
popa
 
; draw character
278,7 → 278,7
mov eax,4
mov edx,esi
mov esi,1
mcall
int 0x40
popa
 
noletter:
431,7 → 431,7
mov eax,53
mov ebx,7
mov ecx,[CmdSocket]
mcall
int 0x40
pop edx
pop esi
442,7 → 442,7
pusha
mov eax,5
mov ebx,1 ; Delay for up 100ms
mcall
int 0x40
popa
jmp outputStr
os_exit:
468,7 → 468,7
mov eax,53
mov ebx,7
mov ecx,[DataSocket]
mcall
int 0x40
pop edx
pop esi
 
479,7 → 479,7
pusha
mov eax,5
mov ebx,20 ; Delay for upto 200ms
mcall
int 0x40
popa
jmp outputDataStr
ods_exit:
580,7 → 580,7
mov eax, 53 ; Stack Interface
mov ebx,8 ; Close TCP socket
mov ecx,[CmdSocket]
mcall
int 0x40
ret
 
602,13 → 602,13
pusha
mov eax,5
mov ebx,200 ; Delay for 2s
mcall
int 0x40
popa
 
mov eax, 53 ; Stack Interface
mov ebx,8 ; Close TCP socket
mov ecx,[DataSocket]
mcall
int 0x40
ret
 
 
634,7 → 634,7
mov edx, 0 ; No remote port
mov ecx, 21 ; ftp command port id
mov edi, 0 ; passive open
mcall
int 0x40
mov [CmdSocket], eax
 
popa
663,7 → 663,7
mov edx, [DataPort] ; remote port
mov ecx, 20 ; ftp data port id
mov edi, 1 ; active open
mcall
int 0x40
mov [DataSocket], eax
 
popa
853,7 → 853,7
sd001:
; Read the next DirBlocksPerCall (=16) blocks
mov eax, 70
mcall
int 0x40
; Did we read anything?
test eax, eax
jz @f
1067,7 → 1067,7
sf002a:
; now read the file..
mov eax,70
mcall
int 0x40
test eax, eax
jz @f
cmp eax, 6
1083,7 → 1083,7
; wait a bit
mov eax, 5
mov ebx, 10
mcall
int 0x40
mov ebx, fileinfoblock
add dword [ebx+4], edx
jmp sf002a
1132,7 → 1132,7
mov eax, 53
mov ebx, 2 ; Get # of bytes in input queue
mov ecx, [DataSocket]
mcall
int 0x40
test eax, eax
je gf_sleep
1139,7 → 1139,7
mov eax, 53
mov ebx, 3 ; Get a byte from socket in bl
mov ecx, [DataSocket]
mcall ; returned data in bl
int 0x40 ; returned data in bl
mov esi, text + 0x1300
add esi, dword [fsize]
1156,7 → 1156,7
mov eax,53
mov ebx,6 ; Get socket status
mov ecx,[DataSocket]
mcall
int 0x40
 
cmp eax, 7
jne gf001 ; still open, so just sleep a bit
1166,7 → 1166,7
mov [fileinfoblock+12], eax
mov eax,70
mov ebx,fileinfoblock
mcall
int 0x40
 
ret ; Finished
 
1174,7 → 1174,7
; wait a bit
mov eax,5
mov ebx,10 ; Delay for up 100ms
mcall
int 0x40
jmp gf000 ; try for more data
1289,7 → 1289,7
and dword [ebx+12], 0
and dword [ebx+16], 0
mov eax, 70
mcall
int 0x40
pop dword [ebx+16]
pop dword [ebx+12]
1327,13 → 1327,13
; wait a bit
mov eax,5
mov ebx,10 ; Delay for up 100ms
mcall
int 0x40
 
; check connection status
mov eax,53
mov ebx,6 ; Get socket status
mov ecx,[DataSocket]
mcall
int 0x40
 
cmp eax, 4
jne cl001
1363,13 → 1363,13
; wait a bit
mov eax,5
mov ebx,10 ; Delay for up 100ms
mcall
int 0x40
 
; check connection status
mov eax,53
mov ebx,6 ; Get socket status
mov ecx,[DataSocket]
mcall
int 0x40
 
cmp eax, 4
jne cr001
1402,13 → 1402,13
; wait a bit
mov eax,5
mov ebx,10 ; Delay for up 100ms
mcall
int 0x40
 
; check connection status
mov eax,53
mov ebx,6 ; Get socket status
mov ecx,[DataSocket]
mcall
int 0x40
 
cmp eax, 4
je @f
/programs/network/ftps/trunk/macros.inc
0,0 → 1,269
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
/programs/network/smtps/trunk/smtps.asm
23,7 → 23,7
dd 0xffff0
dd 0,0
 
include '..\..\..\macros.inc'
include 'macros.inc'
 
save_file:
 
38,7 → 38,7
mov [ebx+12],eax
 
mov eax,70
mcall
int 0x40
 
ret
 
49,7 → 49,7
 
mov eax,70
mov ebx,filel
mcall
int 0x40
 
test eax,eax
jz @f
72,8 → 72,6
 
mov ebp,0
mov edx,I_END
 
redraw:
call draw_window ; at first, draw the window
 
still:
82,10 → 80,10
 
mov eax,5
mov ebx,1
mcall
int 0x40
 
mov eax,11 ; wait here for event
mcall
int 0x40
 
cmp eax,1 ; redraw
je redraw
132,21 → 130,28
mov ecx,[socket]
mov edx,6
mov esi,r220
mcall
int 0x40
mov [header_sent],1
 
jmp still
 
 
 
redraw: ; redraw
 
call draw_window
jmp still
 
 
button: ; button
 
mov eax,17 ; get id
mcall
int 0x40
 
cmp ah,1 ; close program
jne noclose
or eax,-1
mcall
mov eax,-1
int 0x40
noclose:
 
call socket_commands
163,7 → 168,7
mov eax,53
mov ebx,6
mov ecx,[socket]
mcall
int 0x40
 
mov [status],eax
 
178,7 → 183,7
mov ebx,360*65536+30
mov ecx,151*65536+10
mov edx,0xffffff
mcall
int 0x40
 
pop ecx
mov eax,47
189,7 → 194,7
cmp [server_active],0
je no_print
 
mcall
int 0x40
 
no_print:
 
203,7 → 208,7
cmp ah,22 ; open socket
jnz tst3
mov eax,3
mcall
int 0x40
 
mov [server_active],1
 
213,7 → 218,7
mov edx,0 ; no remote port specified
mov esi,0 ; no remote ip specified
mov edi,0 ; PASSIVE open
mcall
int 0x40
mov [socket], eax
 
ret
225,7 → 230,7
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
mov [header_sent],0
mov [mail_rp],0
mov [server_active],0
241,7 → 246,7
key:
 
mov eax,2
mcall
int 0x40
 
jmp still
 
344,7 → 349,7
mov ecx,[socket]
mov edx,6
mov esi,r354
mcall
int 0x40
mov [cmd],0
popa
ret
358,7 → 363,7
mov ecx,[socket]
mov edx,6
mov esi,r250
mcall
int 0x40
mov [cmd],0
popa
ret
385,26 → 390,26
mov ecx,[socket]
mov edx,6
mov esi,r221
mcall
int 0x40
mov [cmd],0
 
mov eax,5
mov ebx,5
mcall
int 0x40
 
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
 
mov eax,5
mov ebx,5
mcall
int 0x40
 
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
 
mov [header_sent],0
mov [mail_rp],0
413,7 → 418,7
 
mov eax,5
mov ebx,20
mcall
int 0x40
 
mov eax,53
mov ebx,5
421,7 → 426,7
mov edx,0 ; no remote port specified
mov esi,0 ; no remote ip specified
mov edi,0 ; PASSIVE open
mcall
int 0x40
mov [socket], eax
 
popa
437,7 → 442,7
mov ecx,[socket]
mov edx,6
mov esi,r250
mcall
int 0x40
mov [cmd],0
popa
ret
591,7 → 596,7
mov eax, 53
mov ebx, 2
mov ecx, [socket]
mcall
int 0x40
 
mov ecx,-1
 
601,7 → 606,7
mov eax, 53
mov ebx, 3
mov ecx, [socket]
mcall
int 0x40
 
mov ecx,0
 
617,7 → 622,7
 
mov eax,12
mov ebx,1
mcall
int 0x40
 
mov [old_status],300
 
625,8 → 630,8
mov ebx,5*65536+400
mov ecx,5*65536+200
mov edx,0x13ffffff
mov edi,title
mcall
mov edi,labelt
int 0x40
 
mov eax,8 ; button: open socket
mov ebx,23*65536+22
633,27 → 638,28
mov ecx,169*65536+10
mov edx,22
mov esi,0x55aa55
mcall
int 0x40
 
; mov eax,8 ; button: close socket
mov eax,8 ; button: close socket
mov ebx,265*65536+22
mov ecx,169*65536+10
mov edx,24
mov esi,0xaa5555
mcall
int 0x40
 
mov eax,38 ; line
mov ebx,5*65536+395
mov ecx,108*65536+108
mov edx,0x000000
mcall
int 0x40
 
mov eax,4
mov ebx,5*65536+123 ; info text
mov ecx,0x000000
mov edx,text
mov esi,70
newline:
mcall
mov eax,4
int 0x40
add ebx,12
add edx,70
cmp [edx],byte 'x'
664,7 → 670,7
 
mov eax,12
mov ebx,2
mcall
int 0x40
 
popa
 
692,7 → 698,7
mov bx,word [rxs]
imul bx,6
mov edx,0xffffff
mcall
int 0x40
popa
push ecx
mov eax,4
711,7 → 717,7
jne no_blue
mov ecx,0x00ff00
no_blue:
mcall
int 0x40
add edx,[rxs]
add ebx,10
pop ecx
729,6 → 735,7
db ' Timeout is set to 15 seconds. '
db ' '
db ' Open SMTP server port 25 Close SMTP '
 
db 'x' ; <- END MARKER, DONT DELETE
 
 
823,6 → 830,6
 
numtext db ' '
 
title db 'Tiny SMTP email server v ',version,0
labelt db 'Tiny SMTP email server v ',version,0
 
I_END:
/programs/network/smtps/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm smtps.asm smtps
@erase lang.inc
@pause
/programs/network/smtps/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm smtps.asm smtps
@erase lang.inc
@pause
/programs/network/autodhcp/trunk/ETH.INC
39,7 → 39,7
macro eth.get_IP IP {
mov ebx,1
mov eax,52
mcall
int 0x40
 
mov IP ,eax
}
47,7 → 47,7
macro eth.get_GATEWAY GATEWAY {
mov ebx,9
mov eax,52
mcall
int 0x40
mov GATEWAY ,eax
}
 
54,7 → 54,7
macro eth.get_SUBNET SUBNET {
mov ebx,10
mov eax,52
mcall
int 0x40
mov SUBNET ,eax
}
 
61,7 → 61,7
macro eth.get_DNS DNS {
mov ebx,13
mov eax,52
mcall
int 0x40
mov DNS ,eax
}
 
69,7 → 69,7
mov ecx,IP
mov ebx,3
mov eax,52
mcall
int 0x40
}
 
macro eth.set_GATEWAY GATEWAY {
76,7 → 76,7
mov ecx,GATEWAY
mov ebx,11
mov eax,52
mcall
int 0x40
}
 
macro eth.set_SUBNET SUBNET {
83,7 → 83,7
mov ecx,SUBNET
mov ebx,12
mov eax,52
mcall
int 0x40
}
 
macro eth.set_DNS DNS {
90,7 → 90,7
mov ecx,DNS
mov ebx,14
mov eax,52
mcall
int 0x40
}
 
macro eth.set_network_drv conf {
97,7 → 97,7
mov ecx,conf
mov ebx,2
mov eax,52
mcall
int 0x40
}
 
macro eth.open_udp local,remote,ip,socket {
106,7 → 106,7
mov esi, ip
mov ebx, 0
mov eax, 53
mcall
int 0x40
 
mov socket,eax
}
115,7 → 115,7
mov ecx, socket
mov ebx, 1
mov eax, 53
mcall
int 0x40
}
 
macro eth.poll socket {
122,7 → 122,7
mov ecx, socket
mov ebx, 2
mov eax, 53
mcall
int 0x40
}
 
macro eth.read_byte socket, result {
129,7 → 129,7
mov ecx, socket
mov ebx, 3
mov eax, 53
mcall
int 0x40
 
mov result,bl
}
140,7 → 140,7
mov ecx, socket
mov ebx, 11
mov eax, 53
mcall
int 0x40
}
 
macro eth.write_udp socket,length,msg,verify {
149,7 → 149,7
mov esi, msg
mov ebx, 4
mov eax, 53
mcall
int 0x40
 
if verify eq 1
call verifysend
165,9 → 165,9
pusha
mov eax,5
mov ebx,100
mcall
int 0x40
popa
mcall
int 0x40
ret
 
macro eth.open_tcp local,remote,ip,passive,socket {
178,7 → 178,7
mov edi, passive ; 0 = PASSIVE open
mov ebx, 5
mov eax, 53
mcall
int 0x40
 
mov socket,eax
}
187,7 → 187,7
mov ecx, socket
mov ebx, 6
mov eax, 53
mcall
int 0x40
 
mov result,eax
}
198,7 → 198,7
mov esi, msg
mov ebx, 7
mov eax, 53
mcall
int 0x40
 
if verify eq 1
call verifysend
210,11 → 210,11
mov ebx, 15
xor ecx, ecx
pusha
mcall
int 0x40
mov dword[mac],eax
popa
add cl, 4
mcall
int 0x40
mov word[mac+4],ax
 
}
223,7 → 223,7
mov ecx, socket
mov ebx, 8
mov eax, 53
mcall
int 0x40
}
 
macro eth.check_port port,result {
230,7 → 230,7
mov ecx, port
mov ebx, 9
mov eax, 53
mcall
int 0x40
 
mov result,eax
}
238,7 → 238,7
macro eth.check_cable result {
mov ebx, 10
mov eax, 53
mcall
int 0x40
 
mov result,eax
}
247,7 → 247,7
mov ebx, 255
mov ecx, 6
mov eax, 53
mcall
int 0x40
 
mov status,eax
}
268,7 → 268,7
mov eax,52
mov ebx,16
xor ecx,ecx
mcall
int 0x40
 
}
 
280,7 → 280,7
mov ebx,16
xor ecx,ecx
inc ecx
mcall
int 0x40
 
}
 
308,7 → 308,7
 
mov eax,5
mov ebx,1
mcall
int 0x40
 
inc edx
cmp edx,30
331,7 → 331,7
 
mov eax,5 ; wait here for event
mov ebx,10
mcall
int 0x40
 
jmp @r
@@:
/programs/network/autodhcp/trunk/autodhcp.asm
41,7 → 41,7
 
DEFEND_INTERVAL equ 10 ; seconds (min. wait between defensive ARPs)
 
include '..\..\..\macros.inc'
include 'macros.inc'
include 'eth.inc'
include 'debug-fdo.inc'
include 'dhcp.inc'
154,7 → 154,7
 
mov eax,23 ; wait here for event (data from remote)
mov ebx,TIMEOUT*10
mcall
int 0x40
 
eth.poll [socketNum]
 
/programs/network/autodhcp/trunk/common.inc
1,17 → 1,17
macro wait time {
mov ebx,time
mov eax,5
mcall
int 0x40
}
 
macro get_time_counter result {
mov eax,26
mov ebx,9
mcall
int 0x40
mov result,eax
}
 
macro exit {
or eax,-1
mcall
mov eax,-1
int 0x40
}
/programs/network/autodhcp/trunk/events.inc
2,23 → 2,23
macro set_event_mask mask {
mov ebx, mask
mov eax, 40
mcall
int 0x40
}
 
macro wait_for_event {
mov eax, 10
mcall
int 0x40
}
 
macro check_for_event {
mov eax, 11
mcall
int 0x40
}
 
macro wait_for_event_timeout timeout {
mov ebx,timeout
mov eax, 23
mcall
int 0x40
}
 
 
/programs/network/autodhcp/trunk/debug-fdo.inc
229,7 → 229,7
mov cl,al
mov ebx,1
mov eax,63
mcall
int 0x40
popad
ret
debug_endf
243,7 → 243,7
mov cl,[edx]
or cl,cl
jz .l2
mcall
int 0x40
inc edx
jmp .l1
.l2: ret
/programs/network/autodhcp/trunk/MACROS.INC
0,0 → 1,268
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
; language for programs
lang fix ru ; ru en fr ge fi
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
/programs/network/telnet/trunk/telnet.asm
17,7 → 17,7
 
 
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
 
START: ; start of execution
 
37,7 → 37,7
mov eax,53
mov ebx,6
mov ecx,[socket]
mcall
int 0x40
 
mov ebx, [socket_status]
mov [socket_status], eax
45,13 → 45,12
cmp eax, ebx
je waitev
 
red:
call draw_window
 
waitev:
mov eax,23 ; wait here for event
mov ebx,20
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
je red
65,7 → 64,7
mov eax, 53
mov ebx, 2
mov ecx, [socket]
mcall
int 0x40
cmp eax, 0
jne read_input
 
78,7 → 77,7
mov eax, 53
mov ebx, 3
mov ecx, [socket]
mcall
int 0x40
pop ecx
 
call handle_data
87,7 → 86,7
mov eax, 53
mov ebx, 2
mov ecx, [socket]
mcall
int 0x40
pop ecx
cmp eax, 0
 
134,7 → 133,7
mov ebx,7
mov ecx,[socket]
mov esi, telnetrep
mcall
int 0x40
ret
 
hd001:
201,9 → 200,14
newdata:
ret
 
 
red: ; REDRAW WINDOW
call draw_window
jmp still
 
key: ; KEY
mov eax,2 ; send to modem
mcall
int 0x40
 
mov ebx, [socket_status]
cmp ebx, 4 ; connection open?
242,7 → 246,7
 
button: ; BUTTON
mov eax,17
mcall
int 0x40
cmp ah,1 ; CLOSE PROGRAM
jne noclose
 
249,10 → 253,10
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
 
or eax,-1
mcall
mov eax,-1
int 0x40
noclose:
cmp ah, 2 ; Set IP
jne notip
372,7 → 376,7
mov ebx,7
mov ecx,[socket]
mov esi, tx_buff
mcall
int 0x40
pop bx
mov al, [echo]
cmp al, 0
401,7 → 405,7
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
ret
 
 
416,7 → 420,7
push ecx
mov eax, 53
mov ebx, 9
mcall
int 0x40
pop ecx
cmp eax, 0 ; is this local port in use?
jz getlp ; yes - so try next
433,7 → 437,7
mov esi, edx
movzx edx, word [port] ; telnet port id
mov edi,1 ; active open
mcall
int 0x40
mov [socket], eax
 
popa
453,14 → 457,14
 
mov eax,12
mov ebx,1
mcall
int 0x40
 
xor eax,eax ; DRAW WINDOW
mov ebx,100*65536+491 + 8 +15
mov ecx,100*65536+270 + 20 ; 20 for status bar
mov edx,0x13000000
mov edi,title
mcall
mov edi,labelt
int 0x40
 
; draw status bar
mov eax, 13
467,7 → 471,7
mov ebx, 4*65536+484 + 8 +15
mov ecx, 270*65536 + 3
mov edx, 0x00557799
mcall
int 0x40
 
mov eax,8 ; BUTTON 2: SET IP
mov ebx,4*65536+70
474,7 → 478,7
mov ecx,273*65536+12
mov esi, 0x00557799
mov edx,2
mcall
int 0x40
 
mov eax,4 ; Button text
mov ebx,6*65536+276
481,17 → 485,17
mov ecx,0x00ffffff
mov edx,setipt
mov esi,setiplen-setipt
mcall
int 0x40
 
 
mov eax,47
mov edi,ip_address ; display IP address
mov edx,78*65536+276
mov esi,0x00ffffff
mov ebx,3*65536
ipdisplay:
mov eax,47
movzx ecx,byte [edi]
mcall
int 0x40
add edx,6*4*65536
inc edi
cmp edi,ip_address+4
502,7 → 506,7
mov ecx,273*65536+12
mov edx,3
mov esi, 0x00557799
mcall
int 0x40
 
mov eax,4 ; Button text
mov ebx,178*65536+276
509,7 → 513,7
mov ecx,0x00ffffff
mov edx,setportt
mov esi,setportlen-setportt
mcall
int 0x40
 
 
mov edx,216*65536+276 ; display port
517,7 → 521,7
mov ebx,4*65536
mov eax,47
movzx ecx,word [port]
mcall
int 0x40
 
mov eax,8 ; BUTTON 4: Connect
mov ebx,250*65536+50
524,7 → 528,7
mov ecx,273*65536+12
mov esi, 0x00557799
mov edx,4
mcall
int 0x40
 
mov eax,4 ; Button text
mov ebx,255*65536+276
531,7 → 535,7
mov ecx,0x00ffffff
mov edx,cont
mov esi,conlen-cont
mcall
int 0x40
 
 
mov eax,8 ; BUTTON 5: disconnect
539,7 → 543,7
mov ecx,273*65536+12
mov edx,5
mov esi, 0x00557799
mcall
int 0x40
 
 
mov eax,4 ; Button text
547,7 → 551,7
mov ecx,0x00ffffff
mov edx,dist
mov esi,dislen-dist
mcall
int 0x40
 
 
mov esi,contlen-contt ; display connected status
562,7 → 566,7
mov eax,4 ; status text
mov ebx,380*65536+276
mov ecx,0x00ffffff
mcall
int 0x40
 
 
mov eax,8 ; BUTTON 6: echo
570,7 → 574,7
mov ecx,273*65536+12
mov edx,6
mov esi, 0x00557799
mcall
int 0x40
 
mov edx,echot
mov esi,echolen-echot
584,7 → 588,7
mov eax,4 ; Button text
mov ebx,463*65536+276
mov ecx,0x00ffffff
mcall
int 0x40
 
 
xor eax,eax
597,7 → 601,7
 
mov eax,12
mov ebx,2
mcall
int 0x40
 
popa
 
632,7 → 636,7
shl ebx, 16
mov bx, 6
mov eax, 13
mcall
int 0x40
popa
 
; draw character
648,7 → 652,7
mov eax,4
mov edx,esi
mov esi,1
mcall
int 0x40
popa
 
noletter:
679,11 → 683,11
mov edi,string
f11:
mov eax,10
mcall
int 0x40
cmp eax,2
jne read_done
mov eax,2
mcall
int 0x40
shr eax,8
cmp eax,13
je read_done
731,7 → 735,7
shl ecx,16
mov cx,8
mov edx,0x00000000
mcall
int 0x40
 
mov eax,4
mov ebx,[string_x]
740,7 → 744,7
mov ecx,0x00ffffff
mov edx,string
mov esi,[string_length]
mcall
int 0x40
 
popa
ret
769,7 → 773,7
scroll dd 1
dd 24
wcolor dd 0x000000
title db 'Telnet v0.1',0
labelt db 'Telnet v0.1',0
setipt db 'IP Address: . . .'
setiplen:
setportt db 'Port:'
/programs/network/telnet/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm telnet.asm telnet
@erase lang.inc
@pause
/programs/network/telnet/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm telnet.asm telnet
@erase lang.inc
@pause
/programs/network/telnet/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
; language for programs
lang fix ru ; ru en fr ge fi
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/terminal/trunk/terminal.asm
13,7 → 13,7
dd 0x0 , 0x0 ; I_Param , I_Path
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
START: ; start of execution
26,7 → 26,7
mov eax,23 ; wait here for event
mov ebx,20
mcall
int 0x40
cmp eax,1 ; redraw request ?
je red
45,7 → 45,7
push ecx
mov eax,42
mov ebx,4
mcall
int 0x40
pop ecx
cmp bl,27 ; ESCAPE COMMAND
121,7 → 121,7
mov [pos],eax
newdata:
mov eax,11
mcall
int 0x40
cmp eax,16+4
je read_input
call draw_text
134,7 → 134,7
key: ; KEY
mov eax,2 ; send to modem
mcall
int 0x40
shr eax,8
cmp eax,178 ; ARROW KEYS
jne noaup
164,25 → 164,25
mov ecx,0x3f8
mov bl,al
mov eax,43
mcall
int 0x40
jmp still
button: ; BUTTON
mov eax,17
mcall
int 0x40
cmp ah,1 ; CLOSE PROGRAM
jne noclose
mov eax,45 ; FREE IRQ
mov ebx,1
mov ecx,4
mcall
int 0x40
mov eax,46
mov ebx,1
mov ecx,0x3f0
mov edx,0x3ff
mcall
or eax,-1
mcall
int 0x40
mov eax,-1
int 0x40
noclose:
jmp still
208,10 → 208,10
mov ecx,0x3f8
mov ebx,eax
mov eax,43
mcall
int 0x40
mov eax,5
mov ebx,5
mcall
int 0x40
popa
ret
267,17 → 267,17
mov ebx,0
mov ecx,0x3f0
mov edx,0x3ff
mcall
int 0x40
mov eax,45 ; reserve irq 4
mov ebx,0
mov ecx,4
mcall
int 0x40
mov eax,44
mov ebx,irqtable
mov ecx,4
mcall
int 0x40
; jmp noportint
284,38 → 284,38
mov cx,0x3f8+3
mov bl,0x80
mov eax,43
mcall
int 0x40
mov cx,0x3f8+1
mov bl,0
mov eax,43
mcall
int 0x40
mov cx,0x3f8+0
mov bl,0x30 / 16
mov eax,43
mcall
int 0x40
mov cx,0x3f8+3
mov bl,3
mov eax,43
mcall
int 0x40
mov cx,0x3f8+4
mov bl,0xB
mov eax,43
mcall
int 0x40
mov cx,0x3f8+1
mov bl,1
mov eax,43
mcall
int 0x40
noportint:
mov eax,40
mov ebx,0000000000010000b shl 16 + 111b
mcall
int 0x40
popa
334,14 → 334,14
mov eax,12
mov ebx,1
mcall
int 0x40
mov eax,0 ; DRAW WINDOW
mov ebx,100*65536+491
mov ecx,100*65536+270
mov edx,0x13000000
mov edi,title
mcall
mov edi,labelt
int 0x40
xor eax,eax
mov edi,text+80*30
353,7 → 353,7
mov eax,12
mov ebx,2
mcall
int 0x40
popa
412,7 → 412,7
shl ebx,16
mov bx,6
mov eax,13
mcall
int 0x40
popa
pusha
429,7 → 429,7
mov eax,4
mov edx,esi
mov esi,1
mcall
int 0x40
popa
noletter:
458,12 → 458,12
newescc:
mov eax,42
mov ebx,4
mcall
int 0x40
cmp ecx,0
je escok
mov eax,5
mov ebx,1
mcall
int 0x40
jmp newescc
escok:
mov [edi],bl
613,7 → 613,7
mov ebx,250*65536+100
mov ecx,8*65536+8
mov edx,0x000000
mcall
int 0x40
mov eax,[escnumbers]
xor edx,edx
638,7 → 638,7
mov ecx,0xffffff
mov edx,numtext
mov esi,10
mcall
int 0x40
popa
652,7 → 652,7
mov ebx,150*65536+100
mov ecx,8*65536+8
mov edx,0xffffff
mcall
int 0x40
mov eax,4
mov ebx,150*65536+8
659,7 → 659,7
mov ecx,0x000000
mov edx,esccmd
mov esi,20
mcall
int 0x40
popa
ret
720,7 → 720,7
escend db 'ZrhlABCDHfDME=>NmKJgincoyq',0
escnumbers dd 0,0,0,0,0
wcolor dd 0x000000
title db 'TERMINAL FOR MODEM IN COM1 0.03',0
labelt db 'TERMINAL FOR MODEM IN COM1 0.03',0
text:
db ' '
735,4 → 735,8
db ' '
I_END:
/programs/network/terminal/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm terminal.asm terminal
@erase lang.inc
@pause
/programs/network/terminal/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm terminal.asm terminal
@erase lang.inc
@pause
/programs/network/terminal/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
; language for programs
lang fix ru ; ru en fr ge fi
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/tftpa/trunk/tftpa.asm
18,7 → 18,7
dd 0x0 , 0x0 ; I_Param , I_Path
 
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
delay dd 145
wait_for dd 0x0
28,13 → 28,12
mov dword [prompt], p9
mov dword [promptlen], p9len - p9
 
red:
call draw_window ; at first, draw the window
still:
mov eax,10 ; wait here for event
mcall
int 0x40
cmp eax,1 ; redraw request ?
jz red
44,14 → 43,19
jz button
jmp still
red: ; redraw
call draw_window
jmp still
key: ; Keys are not valid at this part of the
mov eax,2 ; loop. Just read it and ignore
mcall
int 0x40
jmp still
button: ; button
mov eax,17 ; get id
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jnz noclose
61,13 → 65,13
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
mov [socketNum], dword 0
or eax,-1 ; close this program
mcall
mov eax,0xffffffff ; close this program
int 0x40
noclose:
cmp ah,2 ; copy file to local machine?
115,13 → 119,13
f11:
mov eax,10
mcall
int 0x40
cmp eax,2
jz fbu
jmp still
fbu:
mov eax,2
mcall ; get key
int 0x40 ; get key
shr eax,8
cmp eax,8
jnz nobs
158,7 → 162,7
shl ecx,16
mov cx,8
mov edx,0x224466
mcall
int 0x40
mov eax,4
mov ebx,103*65536
166,7 → 170,7
mov ecx,0xffffff
mov edx,[addr]
mov esi,15
mcall
int 0x40
ret
305,7 → 309,7
; Get a random # for the local socket port #
mov eax, 3
mcall
int 0x40
mov ecx, eax
shr ecx, 8 ; Set up the local port # with a random #
314,7 → 318,7
mov ebx, 0
mov edx, 69 ; remote port
mov esi, [tftp_IP] ; remote IP ( in intenet format )
mcall
int 0x40
mov [socketNum], eax
324,12 → 328,12
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
int 0x40 ; read byte
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
int 0x40 ; any more data?
cmp eax, 0
jne cfr001 ; yes, so get it
340,13 → 344,13
mov ecx, [socketNum]
mov edx, [tftp_len]
mov esi, tftp_filename
mcall
int 0x40
cfr002:
mov eax,23 ; wait here for event
mov ebx,1 ; Time out after 10ms
mcall
int 0x40
cmp eax,1 ; redraw request ?
je cfr003
359,7 → 363,7
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall
int 0x40
cmp eax, 0
je cfr002
381,12 → 385,12
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
int 0x40 ; read byte
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
int 0x40 ; read byte
pop eax
; bl holds tftp opcode. Can only be 3 (data) or 5 ( error )
400,7 → 404,7
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
int 0x40 ; read byte
mov [blockNumber], bl
407,7 → 411,7
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
int 0x40 ; read byte
mov [blockNumber+1], bl
415,7 → 419,7
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
int 0x40 ; read byte
mov esi, [fileposition]
mov [esi], bl
425,7 → 429,7
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
int 0x40 ; any more data?
cmp eax, 0
jne cfr007 ; yes, so get it
438,11 → 442,11
mov eax,5 ; wait for correct timer position
; to trigger new play block
mov ebx,1
mcall
int 0x40
mov eax,26
mov ebx,9
mcall
int 0x40
cmp eax,[wait_for]
jb wait_more
459,11 → 463,11
mov eax,55
mov ebx,0
mov ecx,0x10000
mcall
int 0x40
mov eax,55
mov ebx,1
mcall
int 0x40
mov [fileposition],0x20000
482,7 → 486,7
mov ecx, [socketNum]
mov edx, ackLen - ack
mov esi, ack
mcall
int 0x40
; If # of chars in the frame is less that 516,
; this frame is the last
496,7 → 500,7
mov edx, [filesize]
mov ecx, I_END + 512
mov esi, 0
mcall
int 0x40
jmp cfrexit
505,12 → 509,12
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
int 0x40 ; read byte
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
int 0x40 ; any more data?
cmp eax, 0
jne cfrerr ; yes, so get it
523,12 → 527,12
cfr004: ; key pressed
mov eax,2 ; just read it and ignore
mcall
int 0x40
jmp cfr002
cfr005: ; button
mov eax,17 ; get id
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jne cfr002 ; If not, ignore.
538,12 → 542,12
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
mov [socketNum], dword 0
mov eax,-1 ; close this program
mcall
int 0x40
jmp $
552,7 → 556,7
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
mov [socketNum], dword 0
574,7 → 578,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
581,24 → 585,37
mov ebx,100*65536+230 ; [x start] *65536 + [x size]
mov ecx,100*65536+170 ; [y start] *65536 + [y size]
mov edx,0x13224466 ; color of work area RRGGBB
mov edi,title
mcall
mov edi,labelt
int 0x40
 
mov eax,8 ; COPY BUTTON
mov ebx,20*65536+190
mov ecx,79*65536+15
mov edx,3
mov esi,0x557799
; int 0x40
mov eax,8 ; DELETE BUTTON
mov ebx,20*65536+190
mov ecx,111*65536+15
mov edx,2
mov esi,0x557799
mcall
int 0x40
mov eax,8
mov ebx,200*65536+10
mov ecx,34*65536+10
mov edx,4
mcall
mov esi,0x557799
int 0x40
mov eax,8
mov ebx,200*65536+10
mov ecx,50*65536+10
mov edx,5
mcall
mov esi,0x557799
int 0x40
; Copy the file name to the screen buffer
625,13 → 642,13
; Re-draw the screen text
cld
mov eax,4
mov ebx,25*65536+35 ; draw info text with function 4
mov ecx,0xffffff
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
640,7 → 657,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
ret
674,7 → 691,7
db 'x' ; <- END MARKER, DONT DELETE
title db 'TFTP Wave Player',0
labelt db 'TFTP Wave Player',0
prompt: dd 0
promptlen: dd 0
/programs/network/tftpa/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm tftpa.asm tftpa
@erase lang.inc
@pause
/programs/network/tftpa/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm tftpa.asm tftpa
@erase lang.inc
@pause
/programs/network/tftpa/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
; language for programs
lang fix ru ; ru en fr ge fi
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/tftpc/trunk/tftpc.asm
12,22 → 12,21
dd 0x0 , 0x0 ; I_Param , I_Path
 
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
START: ; start of execution
mov eax,40 ; Report events
mov ebx,10000111b ; Stack 8 + defaults
mcall
int 0x40
mov dword [prompt], p1
mov dword [promptlen], p1len - p1
 
red:
call draw_window ; at first, draw the window
still:
mov eax,10 ; wait here for event
mcall
int 0x40
cmp eax,1 ; redraw request ?
jz red
38,14 → 37,18
jmp still
 
red: ; redraw
call draw_window
jmp still
key: ; Keys are not valid at this part of the
mov eax,2 ; loop. Just read it and ignore
mcall
int 0x40
jmp still
button: ; button
mov eax,17 ; get id
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jnz noclose
60,8 → 63,8
mov [socketNum], dword 0
or eax,-1 ; close this program
mcall
mov eax,0xffffffff ; close this program
int 0x40
noclose:
cmp ah,2 ; copy file to local machine?
124,13 → 127,13
f11:
mov eax,10
mcall
int 0x40
cmp eax,2
jz fbu
jmp still
fbu:
mov eax,2
mcall ; get key
int 0x40 ; get key
shr eax,8
cmp eax,8
jnz nobs
167,7 → 170,7
shl ecx,16
mov cx,8
mov edx,0x224466
mcall
int 0x40
mov eax,4
mov ebx,103*65536
175,7 → 178,7
mov ecx,0xffffff
mov edx,[addr]
mov esi,15
mcall
int 0x40
ret
354,7 → 357,7
cfr002:
mov eax,10 ; wait here for event
mcall
int 0x40
cmp eax,1 ; redraw request ?
je cfr003
424,7 → 427,7
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
int 0x40 ; any more data?
cmp eax, 0
je no_more_data ; no
432,7 → 435,7
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
int 0x40 ; read byte
mov esi, [fileposition]
mov [esi], bl
470,7 → 473,7
mov edx, [filesize]
mov ecx, I_END + 512
mov esi, 0
mcall
int 0x40
jmp cfrexit
497,12 → 500,12
cfr004: ; key pressed
mov eax,2 ; just read it and ignore
mcall
int 0x40
jmp cfr002
cfr005: ; button
mov eax,17 ; get id
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jne cfr002 ; If not, ignore.
517,7 → 520,7
mov [socketNum], dword 0
mov eax,-1 ; close this program
mcall
int 0x40
jmp $
806,7 → 809,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
813,8 → 816,8
mov ebx,100*65536+230 ; [x start] *65536 + [x size]
mov ecx,100*65536+170 ; [y start] *65536 + [y size]
mov edx,0x13224466 ; color of work area RRGGBB
mov edi,title
mcall
mov edi,labelt
int 0x40
mov eax,8 ; COPY BUTTON
mov ebx,20*65536+190
821,25 → 824,28
mov ecx,79*65536+15
mov edx,2
mov esi,0x557799
mcall
int 0x40
; mov eax,8 ; DELETE BUTTON
mov eax,8 ; DELETE BUTTON
mov ebx,20*65536+190
mov ecx,111*65536+15
mov edx,3
mcall
mov esi,0x557799
int 0x40
; mov eax,8
; mov ebx,200*65536+10
mov eax,8
mov ebx,200*65536+10
mov ecx,34*65536+10
mov edx,4
mcall
mov esi,0x557799
int 0x40
; mov eax,8
; mov ebx,200*65536+10
mov eax,8
mov ebx,200*65536+10
mov ecx,50*65536+10
mov edx,5
mcall
mov esi,0x557799
int 0x40
; Copy the file name to the screen buffer
866,13 → 872,13
; Re-draw the screen text
cld
mov eax,4
mov ebx,25*65536+35 ; draw info text with function 4
mov ecx,0xffffff
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
881,7 → 887,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
ret
915,7 → 921,7
db 'x' ; <- END MARKER, DONT DELETE
title db 'TFTP Client',0
labelt db 'TFTP Client',0
prompt: dd 0
promptlen: dd 0
/programs/network/tftpc/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm tftpc.asm tftpc
@erase lang.inc
@pause
/programs/network/tftpc/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm tftpc.asm tftpc
@erase lang.inc
@pause
/programs/network/tftpc/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
; language for programs
lang fix ru ; ru en fr ge fi
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/ym/trunk/ym.asm
14,7 → 14,6
 
;E:.
include 'lang.inc'
include '..\..\..\macros.inc'
;B+ Definitions
v_sp equ 330
h_sp equ 400
33,12 → 32,6
START:
;B+ Main execution
 
mov ebx,3
mov ecx,sys_colors
mov edx,10*4
mov eax,48
mcall
call clear_text
red:
46,7 → 39,7
still:
mov ebx,50
mov eax,23
mcall
int 0x40
cmp eax,1
je red
61,7 → 54,7
key:
mov eax,2
mcall
int 0x40
cmp [is_connect],0
je still
call send_key_string
69,12 → 62,12
button:
mov eax,17
mcall
int 0x40
cmp ah,1
jne noclose
or eax,-1
mcall
mov eax,-1
int 0x40
jmp $
noclose:
120,7 → 113,7
mov ecx,(v_sp-53) shl 16 + 10
mov edx,[sys_colors+4*5]
mov eax,13
mcall
int 0x40
popa
;show item
152,9 → 145,15
draw_window:
;B+ Draw window
mov ebx,3
mov ecx,sys_colors
mov edx,10*4
mov eax,48
int 0x40
 
mov ebx,1
mov eax,12
mcall
int 0x40
xor eax,eax ;DRAW WINDOW
mov ebx,150*65536+h_sp
161,8 → 160,8
mov ecx,100*65536+v_sp
mov edx,[sys_colors+4*5]
or edx,0x13000000
mov edi,title
mcall
mov edi,header
int 0x40
 
;B+ Friend panel
mov ebx,(h_sp-fr_sp) shl 16 + 3
169,7 → 168,7
mov ecx,20 shl 16 + v_sp-31 -56
mov edx,[sys_colors+4*9]
mov eax,13
mcall
int 0x40
call show_friends
;E:.
178,12 → 177,12
mov ecx,(v_sp-31 -33-3) shl 16 + 3
mov edx,[sys_colors+4*9]
mov eax,13
mcall
int 0x40
mov ebx,(h_sp-(fr_sp-12)*8/6) shl 16 + 4
mov ecx,(v_sp-31-33) shl 16 + 30
mcall
int 0x40
mov ebx,(h_sp-8) shl 16 + 4
mcall
int 0x40
call show_a_friend
call show_string
;E:.
193,14 → 192,14
mov ecx,(v_sp-35) shl 16 + 31
mov edx,[sys_colors+4*9]
mov eax,13
mcall
int 0x40
mov ebx,(5+2+8+(user_txt_end-user_txt)*6) shl 16 + 6*15+7
mov ecx,(v_sp-32) shl 16 + 12
mov edx,[sys_colors+4*5]
mcall
int 0x40
mov ebx,(171+2+8+(psw_txt_end-psw_txt)*6) shl 16 + 6*23+7
mov ecx,(v_sp-32) shl 16 + 12
mcall
int 0x40
;connect button
mov ebx,(h_sp-128) shl 16 + (con_txt_end-con_txt)*6 + 7
208,21 → 207,21
mov edx,101
mov esi,[sys_colors+4*6]
mov eax,8
mcall
int 0x40
;disconnect button
shl ebx,16
add ebx,(h_sp-128+3) shl 16 + (dis_txt_end-dis_txt)*6 + 7
mov edx,102
mcall
int 0x40
;user button
mov ebx,8 shl 16 + (user_txt_end-user_txt)*6 + 5
mov ecx,(v_sp-18-15) shl 16 + 12
mov edx,103
mcall
int 0x40
;password button
mov ebx,174 shl 16 + (psw_txt_end-psw_txt)*6 + 5
mov edx,104
mcall
int 0x40
;login text
mov ebx,11 shl 16 + v_sp-15
230,27 → 229,27
mov edx,login_txt
mov esi,login_txt_end-login_txt
mov eax,4
mcall
int 0x40
;user text
mov ebx,11 shl 16 + v_sp-15-15
mov edx,user_txt
mov esi,user_txt_end-user_txt
mcall
int 0x40
;password text
mov ebx,(174+5) shl 16 + v_sp-15-15
mov edx,psw_txt
mov esi,psw_txt_end-psw_txt
mcall
int 0x40
;connect text
mov ebx,(h_sp-128+5) shl 16 + v_sp-15
mov edx,con_txt
mov esi,con_txt_end-con_txt
mcall
int 0x40
;disconnect text
add ebx,((con_txt_end-con_txt)*6+8 + 3) shl 16
mov edx,dis_txt
mov esi,dis_txt_end-dis_txt
mcall
int 0x40
call show_username
call show_password
260,7 → 259,7
mov ebx,2
mov eax,12
mcall
int 0x40
ret
;E:.
283,7 → 282,7
.next_button:
call test_friend
jc .no_b
mcall
int 0x40
inc edx
.no_b:
inc edi
319,11 → 318,11
call hi_light
jne .no_online
mov ecx,[sys_colors+4*7]
;mcall
;int 0x40
;or ecx,0x10000000
.no_online:
;sub ebx,1 shl 16
mcall
int 0x40
;and ecx,not 0x10000000
.no_item:
add ebx,15
353,7 → 352,7
jne .no_group
sub ebx,12 shl 16
.no_group:
mcall
int 0x40
add ebx,15
inc edi
cmp edi,[last_friend_line]
426,7 → 425,7
.next_line:
cmp [edx-1],byte 0
jne .shift
mcall
int 0x40
.next:
add ebx,10
add edx,45
436,7 → 435,7
ret
.shift:
add ebx,3 shl 16
mcall
int 0x40
sub ebx,3 shl 16
jmp .next
458,7 → 457,7
mov ecx,(25-2) shl 16 + 24*10-2 +2
mov edx,[sys_colors+4*5]
mov eax,13
mcall
int 0x40
;show text
call show_text
popa
509,7 → 508,7
mov edx,[.m_p]
mov esi,line_wid
mov eax,4
mcall
int 0x40
add ebx,3 shl 16
.next_line:
add ebx,10
516,7 → 515,7
add edx,line_wid
cmp [edx-1],byte 0
je .good3
mcall
int 0x40
jmp .next_line
.good3:
mov [.m_p],edx
533,7 → 532,7
mov edx,[f_name_b]
mov esi,[f_name_l]
mov eax,4
mcall
int 0x40
ret
f_name_b dd fnb
571,7 → 570,7
mov edx,.this_c
mov esi,1
mov eax,4
mcall
int 0x40
;
cmp [.c_pl],41
je .new_line
616,7 → 615,7
mov edx,.this_c
mov esi,1
mov eax,4
mcall
int 0x40
mov ebx,[.c_pl]
mov [in_text+ebx],byte 0
jmp show_cursor
650,7 → 649,7
mov ecx,(v_sp-31 -33) shl 16 + 29
mov edx,[sys_colors+4*5]
mov eax,13
mcall
int 0x40
;; move cursor
mov ebx,7 shl 16 + v_sp-62
mov [send_key_string.xy],ebx
672,16 → 671,16
mov edx,curs
mov esi,1
mov eax,4
mcall
int 0x40
add ebx,4
mcall
int 0x40
mov ebx,[send_key_string.xy]
mov [.old_xy],ebx
sub ebx,3 shl 16 + 2
mov ecx,0xffffff;[sys_colors+4*8]
mcall
int 0x40
add ebx,4
mcall
int 0x40
ret
.old_xy dd 7 shl 16 + v_sp-62
693,13 → 692,13
mov edx,in_text
mov esi,41
mov eax,4
mcall
int 0x40
add ebx,2 shl 16 + 9
add edx,41
mcall
int 0x40
add ebx,9
add edx,41
mcall
int 0x40
call show_cursor
ret
838,7 → 837,7
;get enen
mov eax,10
mcall
int 0x40
cmp eax,1
je .end
847,7 → 846,7
;key
mov eax,2
mcall
int 0x40
cmp ah,13
je .end
888,7 → 887,7
mov edx,f_password
mov esi,4
mov eax,4
mcall
int 0x40
jmp still
.unp dd username
898,7 → 897,7
mov ecx,(v_sp-15-15) shl 16 + 9
mov edx,[sys_colors+4*5]
mov eax,13
mcall
int 0x40
;show
mov ebx,(4+12*6) shl 16 + v_sp-15-15
mov ecx,[sys_colors+4*8]
905,7 → 904,7
mov edx,username
mov esi,16
mov eax,4
mcall
int 0x40
ret
username: times (16+1) db 0
926,12 → 925,12
mov edx,f_password
mov esi,4
mov eax,4
mcall
int 0x40
.next:
;get enen
mov eax,10
mcall
int 0x40
cmp eax,1
je still
940,7 → 939,7
;key
mov eax,2
mcall
int 0x40
cmp [.unp],password+24
je .no_next
966,7 → 965,7
mov edx,f_password
mov esi,4
mov eax,4
mcall
int 0x40
.end:
ret
1048,7 → 1047,7
;del
last_friend_line dd 0x6 ;del
 
title db 'Messenger (Yahoo Compatible)',0
header db 'Messenger (Yahoo Compatible)',0
;User / Password
login_txt db 'STATUS: SESSION: ___.___.___.___'
/programs/network/ym/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm ym.asm ym
@erase lang.inc
@pause
/programs/network/ym/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm ym.asm ym
@erase lang.inc
@pause
/programs/network/VNCclient/build.bat
File deleted
\ No newline at end of file
/programs/network/VNCclient/VNCclient.asm
32,7 → 32,6
TIMEOUT = 60 ; timeout in seconds
BUFFER = 1500 ; Buffer size for DNS
 
include '..\..\macros.inc'
include 'fdo.inc'
include 'ETH.INC'
include 'logon.inc'
40,6 → 39,7
include 'copyrect.inc'
include 'thread.inc'
 
 
START: ; start of execution
 
call red_logon
46,7 → 46,7
 
mov eax,40 ; Report events
mov ebx,00000000b ; Only Stack
mcall
int 0x40
 
mov eax,67 ; resize the window (hide it)
xor ebx,ebx
53,13 → 53,13
mov ecx,ebx
mov edx,ebx
mov esi,ebx
mcall
int 0x40
 
mov eax,51
mov ebx,1
mov ecx,thread_start
mov edx,thread_stack
mcall
int 0x40
 
DEBUGF 1,'Thread created: %u\n',eax
 
66,7 → 66,7
@@:
mov eax,5
mov ebx,10
mcall
int 0x40
 
cmp byte[thread_ready],0
je @r
73,7 → 73,7
 
mov eax,40 ; report events
mov ebx,100111b ; mouse, button, key, redraw
mcall
int 0x40
 
mov eax,67 ; resize the window
mov ebx,10
84,7 → 84,7
shr edx,16
add edx,2*xpos
add esi,ypos+xpos
mcall
int 0x40
 
mainloop:
eth.socket_status [socket],eax
93,7 → 93,7
 
mov eax,23 ; wait for event with timeout
mov ebx,50 ; 0,5 s
mcall
int 0x40
 
cmp eax,1
je redraw
112,7 → 112,7
DEBUGF 1,'Sending key event\n'
 
mov eax,2
mcall
int 0x40
mov byte[keyevent.key+3],ah
 
eth.write_tcp [socket],8,keyevent
124,7 → 124,7
 
mov eax,37
mov ebx,1
mcall
int 0x40
 
sub eax,xpos*65536+ypos
bswap eax
134,7 → 134,7
 
mov eax,37
mov ebx,2
mcall
int 0x40
 
test al,00000010b ; test if right button was pressed (bit 1 in kolibri)
jz @f
153,7 → 153,7
 
mov eax,12
mov ebx,1
mcall
int 0x40
 
mov eax,0 ; draw window
mov ebx,dword[framebuffer]
163,7 → 163,9
add ebx,2*xpos
add ecx,ypos+xpos
mov edx,0x03ffffff
mcall
mov esi,0x80555599
mov edi,0x00ffffff
int 0x40
 
mov eax,4 ; label
mov ebx,9*65536+8
171,13 → 173,13
mov edx,name
mov esi,[name_length]
bswap esi
mcall
int 0x40
 
call drawbuffer
 
mov eax,12
mov ebx,2
mcall
int 0x40
 
jmp mainloop
 
187,7 → 189,7
mov ebx,framebuffer_data
mov ecx,dword[screen]
mov edx,xpos*65536+ypos
mcall
int 0x40
 
ret
 
194,7 → 196,7
 
button: ; button
mov eax,17 ; get id
mcall
int 0x40
 
close:
call read_data
202,7 → 204,7
DEBUGF 1,'Socket closed\n'
 
mov eax,-1
mcall
int 0x40
 
no_rfb:
DEBUGF 1,'This is no vnc server!\n'
/programs/network/VNCclient/thread.inc
3,7 → 3,7
 
mov eax,40 ; Report events
mov ebx,10000000b ; Only Stack
mcall
int 0x40
 
resolve first,[server_ip] ; the input window putted the server @ 'first', resolve it into a real ip
mov [server_port],5900 ; no port input for now, only standard port 5900
171,7 → 171,7
mov eax,55
mov ebx,eax
mov esi,beep
mcall
int 0x40
 
jmp thread_loop
 
/programs/network/VNCclient/ETH.INC
12,6 → 12,7
; v1.1: december 2006 bugfixes and improvements
;
 
 
macro mov arg1,arg2 {
if arg1 eq arg2
else
42,7 → 43,7
macro eth.get_IP IP {
mov ebx,1
mov eax,52
mcall
int 0x40
 
mov IP ,eax
}
53,7 → 54,7
macro eth.get_GATEWAY GATEWAY {
mov ebx,9
mov eax,52
mcall
int 0x40
move GATEWAY ,eax
}
 
63,7 → 64,7
macro eth.get_SUBNET SUBNET {
mov ebx,10
mov eax,52
mcall
int 0x40
mov SUBNET ,eax
}
 
73,7 → 74,7
macro eth.get_DNS DNS {
mov ebx,13
mov eax,52
mcall
int 0x40
mov DNS ,eax
}
 
84,7 → 85,7
mov ecx,IP
mov ebx,3
mov eax,52
mcall
int 0x40
}
 
; eth.set_GATEWAY eax
94,7 → 95,7
mov ecx,GATEWAY
mov ebx,11
mov eax,52
mcall
int 0x40
}
 
; eth.set_SUBNET eax
104,7 → 105,7
mov ecx,SUBNET
mov ebx,12
mov eax,52
mcall
int 0x40
}
 
; eth.set_DNS eax
114,7 → 115,7
mov ecx,DNS
mov ebx,14
mov eax,52
mcall
int 0x40
}
 
; eth.open eax,80,ebx,[socket]
127,7 → 128,7
mov esi, ip
mov ebx, 0
mov eax, 53
mcall
int 0x40
 
mov socket,eax
}
139,7 → 140,7
mov ecx, socket
mov ebx, 1
mov eax, 53
mcall
int 0x40
}
 
; eth.poll [socket],eax
150,7 → 151,7
mov ecx, socket
mov ebx, 2
mov eax, 53
mcall
int 0x40
}
 
; eth.read_byte [socket], bl
160,7 → 161,7
mov ecx, socket
mov ebx, 3
mov eax, 53
mcall
int 0x40
 
mov result,bl
}
173,7 → 174,7
mov ecx, socket
mov ebx, 10
mov eax, 53
mcall
int 0x40
}
 
; eth.write [socket],12,msg
186,7 → 187,7
mov esi, msg
mov ebx, 4
mov eax, 53
mcall
int 0x40
 
if verify eq 1
call verifysend
202,10 → 203,9
pusha
mov eax,5
mov ebx,100
mcall
 
int 0x40
popa
mcall
int 0x40
ret
 
; eth.open_tcp 80,80,eax,0,[socket]
220,7 → 220,7
mov edi, passive ; 0 = PASSIVE open
mov ebx, 5
mov eax, 53
mcall
int 0x40
 
mov socket,eax
}
232,7 → 232,7
mov ecx, socket
mov ebx, 6
mov eax, 53
mcall
int 0x40
 
mov result,eax
}
248,7 → 248,7
mov esi, msg
mov ebx, 7
mov eax, 53
mcall
int 0x40
 
if verify eq 1
call verifysend
262,7 → 262,7
mov ecx, socket
mov ebx, 8
mov eax, 53
mcall
int 0x40
}
 
; eth.check_port 165,eax
273,7 → 273,7
mov ecx, port
mov ebx, 9
mov eax, 53
mcall
int 0x40
 
mov result,eax
}
285,7 → 285,7
mov ebx, 255
mov ecx, 6
mov eax, 53
mcall
int 0x40
 
mov status,eax
}
340,7 → 340,7
.loop:
mov eax,5
mov ebx,1
mcall
int 0x40
 
eth.poll socket
 
376,7 → 376,7
 
mov eax,5 ; wait here for event
mov ebx,10
mcall
int 0x40
 
jmp @r
@@:
/programs/network/VNCclient/fdo.inc
152,7 → 152,7
mov cl,al
mov ebx,1
mov eax,63
mcall
int 0x40
popad
ret
debug_endf
164,7 → 164,7
.l1: mov cl,[edx]
or cl,cl
jz .l2
mcall
int 0x40
inc edx
jmp .l1
.l2: ret
/programs/network/VNCclient/logon.inc
3,7 → 3,7
 
still_logon: ; main cycle of application begins here
mov eax,10 ; wait here for event
mcall
int 0x40
 
checkevent_logon: ; Check what event was called _logon: this will be used to return from textbox focus
 
18,7 → 18,7
 
key_logon: ; key event handler
mov al,2 ; eax was zero so will now be 2
mcall ; just read it and ignore
int 0x40 ; just read it and ignore
 
cmp ah,13
jne still_logon ; return to main loop
27,7 → 27,7
 
button_logon: ; eax was zero so will now be 17
mov al,17 ; get id
mcall
int 0x40
 
cmp ah,1 ; close ?
jz close_logon
66,10 → 66,10
 
.waitev_logon:
mov eax,10 ; wait for event
mcall
int 0x40
cmp eax,2 ; button presed ?
jne checkevent_logon ; a key is pressed or redraw is nessesary, goto checkevent
mcall ; eax = 2, read button
int 0x40 ; eax = 2, read button
shr eax,8
cmp eax,8
jnz .nobs_logon ; BACKSPACE
126,7 → 126,7
mov ecx, 33*65536+12
mov edx, 4
mov esi, 0xEBEBEB
mcall
int 0x40
 
cmp byte[mode],0
je @f
133,7 → 133,7
 
mov ecx, 49*65536+12
inc edx
mcall
int 0x40
 
@@:
mov eax, 4 ; function 4 _logon: write text to window
141,7 → 141,7
xor ecx, ecx ; color of text RRGGBB
mov edx, first ; pointer to text beginning
mov esi, STRLEN ; text length
mcall
int 0x40
 
cmp byte[mode],0
je dont_draw_pass
156,7 → 156,7
dec edi
mov edx, passchar
mov esi, 1
mcall
int 0x40
add ebx,6*65536
jmp @r
 
166,8 → 166,8
ret
 
close_logon:
or eax,-1
mcall
mov eax,-1
int 0x40
 
connect_logon:
ret
176,15 → 176,14
 
mov eax, 12 ; function 12_logon:tell os about windowdraw
mov ebx, 1 ; 1, start of draw
mcall
int 0x40
pusha
; DRAW WINDOW
xor eax, eax ; function 0 _logon: define and draw window
mov ebx, 160*65536+330 ; [x start] *65536 + [x size]
mov ecx, 160*65536+100 ; [y start] *65536 + [y size]
mov edx, 0x13DDDDDD ; color of work area RRGGBB
mov edi, title ; WINDOW LABEL
mcall
mov edx, 0x03DDDDDD ; color of work area RRGGBB
int 0x40
 
mov eax, 8 ; LOGON BUTTON
mov ebx, 220*65536+85
191,24 → 190,30
mov ecx, 63*65536+16
mov edx, 2
mov esi, 0xCCCCCC
mcall
int 0x40
 
call print_text_logon
; WINDOW LABEL
mov eax, 4 ; function 4 _logon: write text to window
mov ebx, 8*65536+8 ; [x start] *65536 + [y start]
mov ecx, 0x10ffffff ; color of text RRGGBB
mov edx, labelt ; pointer to text beginning
mov esi, labellen-labelt ; text length
int 0x40
cmp byte[mode],0
je servermode_
 
mov eax, 4 ; function 4 _logon: write text to window
mov ebx, 25*65536+33 ; [x start] *65536 + [y start]
xor ecx, ecx
mov edx, userstr ; pointer to text beginning
mov esi, passstr-userstr ; text length
mcall
int 0x40
 
add bl,16
mov edx, passstr ; pointer to text beginning
mov esi, connect-passstr ; text length
mcall
int 0x40
 
jmp drawtherest_
 
218,7 → 223,7
xor ecx, ecx
mov edx, serverstr ; pointer to text beginning
mov esi, userstr-serverstr ; text length
mcall
int 0x40
 
drawtherest_:
 
225,17 → 230,18
mov ebx, 240*65536+67 ; [x start] *65536 + [y start]
mov edx, connect ; pointer to text beginning
mov esi, connect_e-connect ; text length
mcall
int 0x40
 
popa
inc ebx
mcall
int 0x40
 
ret
 
 
; DATA AREA
title db 'Kolibrios VNC client by HIDNPLAYR',0
labelt: db 'Kolibrios VNC client by HIDNPLAYR'
labellen:
 
first: db '192.168.1.5'
rb STRLEN
/programs/network/stackcfg/trunk/stackcfg.asm
22,8 → 22,6
dd PARAMS , 0x0 ; I_Param , I_Icon
 
include 'lang.inc'
include '..\..\..\macros.inc'
 
START: ; start of execution
 
cmp [PARAMS], byte 0
31,34 → 29,41
 
no_params:
 
red:
call draw_window ; at first, draw the window
 
still:
 
mov eax,10 ; wait here for event
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
jz red
je red
cmp eax,2 ; key in buffer ?
jnz button
je key
cmp eax,3 ; button in buffer ?
je button
 
jmp still
 
red: ; redraw
call draw_window
jmp still
 
key: ; key
mov al,2 ; just read it and ignore
mcall
mov eax,2 ; just read it and ignore
int 0x40
jmp still
 
button: ; button
mov al,17 ; get id
mcall
mov eax,17 ; get id
int 0x40
 
shr eax,8
 
cmp eax,1 ; button id=1 ?
jne noclose
or eax,-1 ; close this program
mcall
mov eax,-1 ; close this program
int 0x40
noclose:
 
cmp eax,2
277,27 → 282,27
 
mov eax,52
mov ebx,0
mcall
int 0x40
mov [config],eax
 
mov eax,52
mov ebx,1
mcall
int 0x40
mov dword [ip_address],eax
 
mov eax,52
mov ebx,9
mcall
int 0x40
mov dword [gateway_ip],eax
 
mov eax,52
mov ebx,10
mcall
int 0x40
mov dword [subnet_mask],eax
 
mov eax,52
mov ebx,13
mcall
int 0x40
mov dword [dns_ip],eax
 
mov eax,[config] ; unwrap com IRQ
340,27 → 345,27
mov eax,52
mov ebx,3
mov ecx,dword [ip_address]
mcall
int 0x40
 
mov eax,52
mov ebx,11
mov ecx,dword [gateway_ip]
mcall
int 0x40
 
mov eax,52
mov ebx,12
mov ecx,dword [subnet_mask]
mcall
int 0x40
 
mov eax,52
mov ebx,14
mov ecx,dword [dns_ip]
mcall
int 0x40
 
mov eax,52
mov ebx,2
mov ecx,[config]
mcall
int 0x40
 
ret
jmp still
385,11 → 390,11
mov edi,string
f11:
mov eax,10
mcall
int 0x40
cmp eax,2
jne read_done
mov eax,2
mcall
int 0x40
shr eax,8
cmp eax,13
je read_done
437,7 → 442,7
shl ecx,16
mov cx,8
mov edx,0xffffff
mcall
int 0x40
 
mov eax,4
mov ebx,[string_x]
446,7 → 451,7
mov ecx,0x000000
mov edx,string
mov esi,[string_length]
mcall
int 0x40
 
popa
ret
466,7 → 471,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
 
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
473,8 → 478,8
mov ebx,100*65536+330 ; [x start] *65536 + [x size]
mov ecx,100*65536+157 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB,8->color gl
mov edi,title ; WINDOW LABEL
mcall
mov edi,header ; WINDOW LABEL
int 0x40
 
mov eax,8 ; BUTTON : READ SETUP
482,13 → 487,13
mov ecx,127*65536+12
mov edx,2
mov esi,[button_color]
mcall
int 0x40
 
;mov eax,8 ; BUTTON : APPLY SETUP
mov ebx,163*65536+65
mov ecx,127*65536+12
mov edx,3
mcall
int 0x40
 
;mov eax,8 ; BUTTONS 11-14 : SELECT INTERFACE
mov ebx,29*65536+8
495,7 → 500,7
mov ecx,39*65536+8
mov edx,11
interface_select:
mcall
int 0x40
add ecx,10*65536
inc edx
cmp edx,11+4
508,7 → 513,7
mov ecx,0xffffff
mov edx,xx
mov esi,1
mcall
int 0x40
 
mov eax,8 ; BUTTONS 21-22 : SERVER / MANUAL IP
mov ebx,143*65536+8
515,12 → 520,12
mov ecx,69*65536+8
mov edx,21
mov esi,[button_color]
mcall
int 0x40
;mov eax,8
mov ebx,143*65536+8
mov ecx,79*65536+8
mov edx,22
mcall
int 0x40
mov ebx,[assigned] ; PRINT SELECTED SERVER/MANUAL 'X'
not ebx
and ebx,1
530,7 → 535,7
mov ecx,0xffffff
mov edx,xx
mov esi,1
mcall
int 0x40
 
mov eax,47 ; COM ADDRESS
mov ebx,3*65536+1*256
537,7 → 542,7
mov ecx,[com_add]
mov edx,272*65536+40
mov esi,0x000000
mcall
int 0x40
 
;mov eax,47 ; COM IRQ
mov ebx,1*65536+1*256
544,7 → 549,7
mov ecx,[com_irq]
mov edx,(266+3*6)*65536+50
mov esi,0x000000
mcall
int 0x40
 
mov edi,ip_address
mov edx,205*65536+80
553,7 → 558,7
ipdisplay:
;mov eax,47
movzx ecx,byte [edi]
mcall
int 0x40
add edx,6*4*65536
inc edi
cmp edi,ip_address+4
566,7 → 571,7
gipdisplay:
;mov eax,47
movzx ecx,byte [edi]
mcall
int 0x40
add edx,6*4*65536
inc edi
cmp edi,gateway_ip+4
579,7 → 584,7
sipdisplay:
;mov eax,47
movzx ecx,byte [edi]
mcall
int 0x40
add edx,6*4*65536
inc edi
cmp edi,subnet_mask+4
592,7 → 597,7
dipdisplay:
;mov eax,47
movzx ecx,byte [edi]
mcall
int 0x40
add edx,6*4*65536
inc edi
cmp edi,dns_ip+4
604,31 → 609,35
mov ecx,39*65536+8
mov edx,5
mov esi,[button_color]
mcall
int 0x40
;mov eax,8 ; BUTTON 6 : SET IRQ
mov ebx,299*65536+8
mov ecx,49*65536+8
mov edx,6
mcall
int 0x40
;mov eax,8 ; BUTTON 7 : SET IP
mov ebx,299*65536+8
mov ecx,79*65536+8
mov edx,7
mcall
int 0x40
 
;mov eax,8 ; BUTTON 8 : SET gateway IP
mov ebx,299*65536+8
mov ecx,89*65536+8
mov edx,8
mcall
int 0x40
 
;mov eax,8 ; BUTTON 9 : SET subnet
mov ebx,299*65536+8
mov ecx,99*65536+8
mov edx,9
mcall
int 0x40
 
;mov eax,8 ; BUTTON 10 : SET dns ip
mov ebx,299*65536+8
mov ecx,109*65536+8
mov edx,10
mcall
int 0x40
 
mov ebx,31*65536+40 ; draw info text with function 4
mov edx,text
641,7 → 650,7
mov ecx,0xeeeeee
nowhite:
inc edx
mcall
int 0x40
add ebx,10
add edx,49
cmp [edx],byte 'x'
649,7 → 658,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
 
ret
 
666,7 → 675,7
 
mov eax,52
mov ebx,0
mcall
int 0x40
mov [config],eax
 
shr eax,8 ; unwrap com IRQ
681,7 → 690,7
call apply_stack_setup
mov eax,-1 ; close this program
mcall
int 0x40
 
;******************************************************************************
 
704,7 → 713,7
 
button_color dd 0x2254b9
 
title db 'STACK CONFIGURATION',0
header db 'STACK CONFIGURATION',0
 
 
;ENTER YOUR SETTINGS HERE:
/programs/network/airc/trunk/eth.inc
File deleted
/programs/network/airc/trunk/fdo.inc
File deleted
/programs/network/airc/trunk/airc.asm
9,12 → 9,8
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
version equ '0.5'
version equ '0.4'
 
 
;__DEBUG__ equ 1
;__DEBUG_LEVEL__ equ 1
 
use32
 
org 0x0
27,10 → 23,8
dd 0x100000
dd 0,0
 
include "..\..\..\macros.inc"
;include "fdo.inc"
include "eth.inc"
;include "lang.inc"
include "lang.inc"
;include "macros.inc"
 
irc_server_ip db 83,149,74,246 ;server: kolibrios.org
 
45,7 → 39,7
 
mov eax,40
mov ebx,10000111b
mcall
int 0x40
 
mov edi,I_END
mov ecx,60*120
67,10 → 61,10
 
mov eax,5
mov ebx,1
mcall
int 0x40
 
mov eax,11 ; wait here for event
mcall
int 0x40
 
call print_status
 
111,12 → 105,12
button: ; button
 
mov eax,17 ; get id
mcall
int 0x40
 
cmp ah,1 ; close program
jne noclose
mov eax,-1
mcall
int 0x40
noclose:
 
call socket_commands
131,7 → 125,7
mov eax,53
mov ebx,6
mov ecx,[socket]
mcall
int 0x40
 
mov [status],eax
 
146,7 → 140,7
mov ebx,450*65536+30
mov ecx,231*65536+10
mov edx,0xffffff
mcall
int 0x40
 
pop ecx
mov eax,47
153,7 → 147,7
mov ebx,2*65536
mov edx,450*65536+231
mov esi,0x000000
mcall
int 0x40
 
nopr:
 
170,7 → 164,7
cmp ah,22 ; open socket
jnz tst3
mov eax,3
mcall
int 0x40
mov ecx,eax
mov eax,53
mov ebx,5
177,7 → 171,7
mov edx,6667
mov esi,dword [irc_server_ip]
mov edi,1
mcall
int 0x40
mov [socket], eax
ret
tst3:
191,7 → 185,7
mov ecx,[socket]
mov edx,string0l-string0
mov esi,string0
mcall
int 0x40
 
mov eax,53 ;
mov ebx,7
198,7 → 192,7
mov ecx,[socket]
mov edx,[user_real_name]
mov esi,user_real_name+4
mcall
int 0x40
 
mov eax,53 ;
mov ebx,7
205,12 → 199,12
mov ecx,[socket]
mov edx,2
mov esi,line_feed
mcall
int 0x40
 
 
mov eax,5
mov ebx,10
mcall
int 0x40
 
mov eax,53 ; nick
mov ebx,7
217,7 → 211,7
mov ecx,[socket]
mov edx,string1l-string1
mov esi,string1
mcall
int 0x40
 
mov eax,53 ;
mov ebx,7
224,7 → 218,7
mov ecx,[socket]
mov edx,[user_nick]
mov esi,user_nick+4
mcall
int 0x40
 
mov eax,53 ;
mov ebx,7
231,7 → 225,7
mov ecx,[socket]
mov edx,2
mov esi,line_feed
mcall
int 0x40
 
 
ret
246,7 → 240,7
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
ret
no_24:
 
257,7 → 251,7
main_window_key:
 
mov eax,2
mcall
int 0x40
 
shr eax,8
 
304,7 → 298,7
mov ebx,415*65536+6*13
mov ecx,27*65536+12*10
mov edx,0xffffff
mcall
int 0x40
 
mov eax,4
mov ebx,415*65536+27
313,7 → 307,7
newch:
movzx esi,byte [edx+31]
and esi,0x1f
mcall
int 0x40
add edx,32
add ebx,12
cmp edx,channel_list+32*10
380,7 → 374,7
mov ebx,415*65536+6*13
mov ecx,27*65536+12*10
mov edx,0xffffff
mcall
int 0x40
popa
 
mov eax,4
404,7 → 398,7
mov ecx,[index_list_2]
no_op:
 
mcall
int 0x40
 
inc ebp
cmp ebp,10
515,7 → 509,7
mov eax, 53 ; write channel
mov ebx, 7
mov ecx, [socket]
mcall
int 0x40
 
mov esi,send_string
mov edx,[xpos]
526,7 → 520,7
mov eax, 53 ; write message
mov ebx, 7
mov ecx, [socket]
mcall
int 0x40
 
jmp send_done
 
608,41 → 602,33
cmp [send_string+1],dword 'aser'
jne no_set_server
 
; pusha
; mov edi,irc_server_ip
; mov esi,send_string+7
; mov eax,0
; mov edx,[xpos]
; add edx,send_string-1
; newsip:
; cmp [esi],byte '.'
; je sipn
; cmp esi,edx
; jg sipn
; movzx ebx,byte [esi]
; inc esi
; imul eax,10
; sub ebx,48
; add eax,ebx
; jmp newsip
; sipn:
; mov [edi],al
; xor eax,eax
; inc esi
; cmp esi,send_string+30
; jg sipnn
; inc edi
; cmp edi,irc_server_ip+3
; jbe newsip
; sipnn:
; popa
 
pusha
mov eax,send_string
add eax,[xpos]
mov dword[eax],0
resolve send_string+7,dword[irc_server_ip]
;DEBUGF 1,'%u.%u.%u.%u\n',1[irc_server_ip],1[irc_server_ip+1],1[irc_server_ip+2],1[irc_server_ip+3]
mov edi,irc_server_ip
mov esi,send_string+7
mov eax,0
mov edx,[xpos]
add edx,send_string-1
newsip:
cmp [esi],byte '.'
je sipn
cmp esi,edx
jg sipn
movzx ebx,byte [esi]
inc esi
imul eax,10
sub ebx,48
add eax,ebx
jmp newsip
sipn:
mov [edi],al
xor eax,eax
inc esi
cmp esi,send_string+30
jg sipnn
inc edi
cmp edi,irc_server_ip+3
jbe newsip
sipnn:
popa
 
mov ecx,[xpos]
729,7 → 715,7
mov eax, 53 ; write server command
mov ebx, 7
mov ecx, [socket]
mcall
int 0x40
 
send_done:
 
740,12 → 726,12
jne no_quit_server
mov eax,5
mov ebx,200
mcall
int 0x40
 
mov eax, 53 ; close socket
mov ebx, 8
mov ecx, [socket]
mcall
int 0x40
 
mov ecx,[max_windows]
mov edi,I_END
856,11 → 842,11
mov ebx,1
mov ecx,channel_thread
mov edx,[thread_stack]
mcall
int 0x40
 
mov eax,5
mov ebx,10
mcall
int 0x40
 
add [thread_stack],0x4000
add [thread_screen],120*80
878,7 → 864,7
mov ebx,8*65536+6*80
mov ecx,151*65536+13
mov edx,0xffffff
mcall
int 0x40
 
mov eax,4
mov ebx,8*65536+154
885,7 → 871,7
mov ecx,0x000000
mov edx,send_string
mov esi,[xpos]
mcall
int 0x40
 
popa
 
900,7 → 886,7
mov eax,9
mov ebx,0xe0000
mov ecx,-1
mcall
int 0x40
 
mov edx,[blink]
and edx,1
921,7 → 907,7
mov bx,cx
mov ecx,151*65536+163
mov eax,38
mcall
int 0x40
 
popa
 
933,7 → 919,7
mov ebx,8*65536+6*60
mov ecx,151*65536+13
mov edx,0xffffff
mcall
int 0x40
 
popa
 
1086,7 → 1072,7
mov edx,command
mov esi,[cmd]
mov [command+esi-1],word '**'
; mcall
; int 0x40
 
mov eax,53
mov ebx,7
1095,7 → 1081,7
sub edx,2
and edx,255
mov esi,command
mcall
int 0x40
 
mov eax,53
mov ebx,7
1102,7 → 1088,7
mov ecx,[socket]
mov edx,2
mov esi,linef
mcall
int 0x40
 
popa
ret
1669,7 → 1655,6
db $90,$91,$92,$93,$94,$95,$96,$97 , $98,$99,$9A,$9B,$9C,$9D,$9E,$9F ; D
db $A0,$A1,$A2,$A3,$A4,$A5,$A6,$A7 , $A8,$A9,$AA,$AB,$AC,$AD,$AE,$AF ; E
db $E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF ; F
; 0 1 2 3 4 5 6 7 8 9 A B C D E F
 
cp866_table:
db $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7 , $C8,$C9,$CA,$CB,$CC,$CD,$CE,$CF ; 8
1680,8 → 1665,8
db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; D
db $F0,$F1,$F2,$F3,$F4,$F5,$F6,$F7 , $F8,$F9,$FA,$FB,$FC,$FD,$FE,$FF ; E
db $A8,$B8,'?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; F
; 0 1 2 3 4 5 6 7 8 9 A B C D E F
 
 
print_character:
 
pusha
1805,7 → 1790,7
mov eax, 53
mov ebx, 2
mov ecx, [socket]
mcall
int 0x40
 
mov ecx,-1
 
1815,7 → 1800,7
mov eax, 53
mov ebx, 3
mov ecx, [socket]
mcall
int 0x40
 
cmp bl,0x80
jb @f
1837,55 → 1822,69
 
mov eax,12
mov ebx,1
mcall
int 0x40
 
mov [old_status],300
 
xor eax,eax ; draw window
mov eax,0 ; draw window
mov ebx,5*65536+499
mov ecx,5*65536+345
mov edx,[wcolor]
add edx,0x13ffffff
mov edi,title
mcall
add edx,0x03ffffff
mov esi,0x80555599
mov edi,0x00ffffff
int 0x40
 
mov eax,4 ; label
mov ebx,9*65536+8
mov ecx,0x10ffffff
mov edx,labelt
mov esi,labellen-labelt
int 0x40
 
mov eax,8 ; button: open socket
mov ebx,43*65536+22
mov ecx,229*65536+10
mov edx,22
mov esi,[main_button]
mcall
int 0x40
 
;mov eax,8 ; button: send userinfo
mov eax,8 ; button: send userinfo
mov ebx,180*65536+22
mov ecx,229*65536+10
mov edx,23
mcall
int 0x40
 
;mov eax,8 ; button: close socket
mov eax,8 ; button: close socket
mov ebx,317*65536+22
mov ecx,229*65536+10
mov edx,24
mcall
int 0x40
 
mov eax,38 ; line
mov ebx,5*65536+494
mov ecx,148*65536+148
mov edx,[main_line]
mcall
int 0x40
add ecx,1*65536+1
; mov edx,0x5555cc
; int 0x40
 
mov eax,38 ; line
mov ebx,5*65536+494
mov ecx,166*65536+166
mcall
int 0x40
add ecx,1*65536+1
; mov edx,0x5555cc
; int 0x40
 
mov eax,38 ; line
mov ebx,410*65536+410
mov ecx,22*65536+148
mcall
int 0x40
add ebx,1*65536+1
; mov edx,0x5555cc
; int 0x40
 
mov ebx,25*65536+183 ; info text
mov ecx,0x000000
1893,7 → 1892,7
mov esi,70
newline:
mov eax,4
mcall
int 0x40
add ebx,12
add edx,70
cmp [edx],byte 'x'
1904,7 → 1903,7
 
mov eax,12
mov ebx,2
mcall
int 0x40
 
popa
 
1917,8 → 1916,8
text:
 
db ' Real name : KolibriOS User - change with eg /areal Jill User '
db ' Nick : KolibriOS User - change with eg /anick Jill '
db ' Server : kolibrios.org - change with eg /aserv irc.by '
db ' Nick : kolibri_user - change with eg /anick Jill '
db ' Server : 83.149.74.246 - change with eg /aserv 192.168.1.24 '
db ' '
db ' 1) Open socket 2) Send userinfo Close socket '
db ' '
1975,7 → 1974,7
mov dword [channel_list+edi],dword ' '
mov byte [channel_list+edi+31],byte 1
mov eax,-1
mcall
int 0x40
no_channel_leave:
 
call check_mouse
1982,7 → 1981,7
 
mov eax,23
mov ebx,1
mcall
int 0x40
 
cmp eax,1
jne no_draw_window
1997,7 → 1996,7
cmp eax,3
jne no_end
mov eax,17
mcall
int 0x40
mov eax,ebp
imul eax,120*80
add eax,I_END
2009,7 → 2008,7
mov [eax],dword ' '
mov [eax+31],byte 1
mov eax,-1
mcall
int 0x40
not_close:
mov [text_start],eax
mov eax,nocl
2048,7 → 2047,7
 
mov eax,37
mov ebx,1
mcall
int 0x40
 
mov ebx,eax
shr eax,16
2074,7 → 2073,7
call print_user_list
mov eax,5
mov ebx,8
mcall
int 0x40
jmp no_mouse
no_plus:
 
2089,7 → 2088,7
call print_user_list
mov eax,5
mov ebx,8
mcall
int 0x40
 
no_minus:
 
2105,7 → 2104,7
thread_key:
 
mov eax,2
mcall
int 0x40
 
shr eax,8
 
2140,7 → 2139,7
wait_for_sending:
mov eax,5
mov ebx,1
mcall
int 0x40
cmp [send_to_server],1
je wait_for_sending
call draw_channel_text
2173,7 → 2172,7
mov bx,word [rxs]
imul bx,6
mov edx,0xffffff
mcall
int 0x40
popa
push ecx
mov eax,4
2192,7 → 2191,7
jne no_blue
mov ecx,0x0000ff
no_blue:
mcall
int 0x40
add edx,[rxs]
add ebx,10
pop ecx
2211,7 → 2210,7
 
mov eax,12
mov ebx,1
mcall
int 0x40
 
mov ebx,ebp ; draw window
shl ebx,16+4
2232,7 → 2231,7
mov esi,0x80555599
mov edi,0x00ffffff
 
mcall
int 0x40
 
mov eax,ebp ; label
add eax,48
2253,30 → 2252,30
mov ebx,9*65536+8
mov ecx,0x00ffffff
mov edx,labelc
mcall
int 0x40
 
mov eax,38 ; line
mov ebx,5*65536+494
mov ecx,148*65536+148
mov edx,[channel_line_sun]
mcall
int 0x40
add ecx,1*65536+1
mov edx,[channel_line_shadow]
mcall
int 0x40
 
 
;mov eax,38 ; line
mov eax,38 ; line
mov ebx,410*65536+410
mov ecx,22*65536+148
mov edx,[channel_line_sun]
mcall
int 0x40
add ebx,1*65536+1
mov edx,[channel_line_shadow]
mcall
int 0x40
 
mov eax,12
mov ebx,2
mcall
int 0x40
 
popa
 
2283,6 → 2282,7
ret
 
 
 
; DATA AREA
 
socket dd 0x0
2376,13 → 2376,9
wcolor dd 0x000000
 
labelc db 'AIRC - WINDOW X: #xxx '
title db 'IRC client ',version,0
labelt db 'IRC client ',version
labellen:
 
;include_debug_strings ; ALWAYS present in data section
 
dnsMsg: rb 512 ; buffer used by DNS client
 
 
;;
;; Channel data at I_END
;;
/programs/network/airc/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/https/trunk/https.asm
26,10 → 26,10
dd START ; program start
dd I_END ; program image size
dd 0x400000 ; required amount of memory
dd 0x400000
dd 0x20000
dd 0,0 ; reserved=no extended header
 
include "..\..\..\MACROS.INC"
include "MACROS.INC"
 
; 0x0+ - program image
; 0x1ffff - stack
57,7 → 57,7
 
mov eax,70
mov ebx,filel
mcall
int 0x40
mov [board_size],ebx
cmp eax,0
je board_found
75,7 → 75,7
mov ebx,files
mov ecx,[board_size]
mov [files+12],ecx
mcall
int 0x40
 
mov [status],-1
mov [last_status],-2
98,10 → 98,10
 
mov eax,5
mov ebx,1
mcall
int 0x40
 
mov eax,11
mcall
int 0x40
call check_events
 
jmp still
121,13 → 121,13
 
key: ; Keys are not valid at this part of the
mov al,2 ; loop. Just read it and ignore
mcall
int 0x40
ret
 
button: ; button
 
mov al,17 ; get id
mcall
int 0x40
 
cmp ah,1 ; close
jnz tst2
134,9 → 134,9
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
mov eax,-1
mcall
int 0x40
tst2:
 
cmp ah,2 ; button id=2 ?
149,7 → 149,7
mov edx,0 ; no remote port specified
mov esi,0 ; no remote ip specified
mov edi,0 ; PASSIVE open
mcall
int 0x40
mov [socket], eax
mov [posy],1
mov [posx],0
167,14 → 167,14
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
mov eax,5
mov ebx,2
mcall
int 0x40
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
 
cmp [server_active],1
jne no_re_open
184,7 → 184,7
mov edx,0 ; no remote port specified
mov esi,0 ; no remote ip specified
mov edi,0 ; PASSIVE open
mcall
int 0x40
mov [socket], eax
no_re_open:
 
245,7 → 245,7
je data_received
mov eax,5
mov ebx,1
mcall
int 0x40
dec [retries]
jnz wait_for_data
jmp no_http_request
280,7 → 280,7
mov ebx,7
mov ecx,[socket]
mov esi,[filepos]
mcall
int 0x40
 
mov eax,esi
add eax,edx
312,16 → 312,16
 
mov eax,5
mov ebx,1
mcall
int 0x40
 
mov eax,11
mcall
int 0x40
call check_events
 
mov eax,53
mov ebx,255
mov ecx,103
mcall
int 0x40
 
cmp eax,0
je no_wait_more
346,7 → 346,7
mov ebx,115*65536+8*6
mov ecx,178*65536+10
mov edx,0xffffff
mcall
int 0x40
 
mov eax,47
mov ebx,8*65536
353,7 → 353,7
mov ecx,edi
mov edx,115*65536+178
mov esi,0x000000
mcall
int 0x40
 
popa
ret
368,7 → 368,7
mov ecx,[socket]
mov edx,h_len-html_header
mov esi,html_header
mcall
int 0x40
 
mov eax,53 ; send file type
mov ebx,7
375,7 → 375,7
mov ecx,[socket]
mov edx,[type_len]
mov esi,[file_type]
mcall
int 0x40
 
popa
ret
437,7 → 437,7
 
mov eax,70
mov ebx,filel
mcall
int 0x40
mov [board_size],ebx
 
cmp [input_text+256+1],dword 'POST'
599,7 → 599,7
 
mov eax,70
mov ebx,files
mcall
int 0x40
 
no_new_message:
mov esi,0x20000
769,7 → 769,7
mov [fileinfo+12],dword 1 ; file exists ?
mov eax,70
mov ebx,fileinfo
mcall
int 0x40
 
cmp eax,0 ; file not found - message
je file_found
795,7 → 795,7
mov [fileinfo+12],dword 0x2f0000 ; read all of file
mov eax,70
mov ebx,fileinfo
mcall
int 0x40
 
file_not_found:
file_loaded:
855,7 → 855,7
pusha
 
mov eax,3
mcall
int 0x40
 
mov ecx,3
new_time_digit:
880,7 → 880,7
pusha
 
mov eax,29
mcall
int 0x40
 
mov ecx,3
add edi,6
910,7 → 910,7
mov eax, 53
mov ebx, 2
mov ecx, [socket]
mcall
int 0x40
 
cmp eax,0
je _ret_now
920,7 → 920,7
mov eax,53
mov ebx,2
mov ecx,[socket]
mcall
int 0x40
 
cmp eax,0
je _ret
928,7 → 928,7
mov eax,53
mov ebx,3
mov ecx,[socket]
mcall
int 0x40
 
cmp bl,10
jne no_lf
964,7 → 964,7
jne no_ld
mov ebx,50
no_ld:
mcall
int 0x40
 
jmp check
 
985,7 → 985,7
mov eax,53
mov ebx,6
mov ecx,[socket]
mcall
int 0x40
 
cmp eax,[status]
je c_ret
1021,11 → 1021,11
 
f11:
mov eax,10
mcall
int 0x40
cmp eax,2
jne read_done
mov eax,2
mcall
int 0x40
shr eax,8
cmp eax,13
je read_done
1083,7 → 1083,7
mov ecx,0x40000000
mov esi,23
mov edi,0xffffff
mcall
int 0x40
 
popa
ret
1098,7 → 1098,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
 
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
1105,8 → 1105,8
mov ebx,100*65536+480 ; [x start] *65536 + [x size]
mov ecx,100*65536+215 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov edi,header ; WINDOW LABEL
int 0x40
 
mov eax,8 ; function 8 : define and draw button
mov ebx,(40)*65536+20 ; [x start] *65536 + [x size]
1113,7 → 1113,7
mov ecx,59*65536+9 ; [y start] *65536 + [y size]
mov edx,2 ; button id
mov esi,0x66aa66 ; button color RRGGBB
mcall
int 0x40
 
; function 8 : define and draw button
mov ebx,(40)*65536+20 ; [x start] *65536 + [x size]
1120,7 → 1120,7
mov ecx,72*65536+9 ; [y start] *65536 + [y size]
mov edx,4 ; button id
mov esi,0xaa6666 ; button color RRGGBB
mcall
int 0x40
 
; Enter directory
mov ebx,(25)*65536+66
1127,25 → 1127,25
mov ecx,135*65536+15
mov edx,6
mov esi,0x3388dd
mcall
int 0x40
 
mov eax,38
mov ebx,240*65536+240
mov ecx,22*65536+210
mov edx,0x6699cc ; 002288
mcall
int 0x40
 
 
mov ebx,241*65536+241
mov ecx,22*65536+210
mov edx,0x336699 ; 002288
mcall
int 0x40
 
call draw_data
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
 
ret
 
1158,7 → 1158,6
mov ecx,0x000000
mov edx,text
mov esi,35
mov eax,13
newline:
pusha
cmp ebx,25*65536+61
1171,12 → 1170,13
mov bx,35*6
shl ecx,16
mov cx,9
mov eax,13
mov edx,0xffffff
mcall
int 0x40
now:
popa
mov eax,4
mcall
int 0x40
add ebx,13
add edx,40
cmp [edx],byte 'x'
1199,10 → 1199,10
mov cx,9
mov eax,13
mov edx,0xffffff
mcall
int 0x40
popa
mov eax,4
mcall
int 0x40
add ebx,10
add edx,256
dec edi
1294,7 → 1294,7
unkl:
 
 
title db appname,version,0
header db appname,version,0
 
socket dd 0x0
server_active db 0x0
/programs/network/https/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm https.asm https
@erase lang.inc
@pause
/programs/network/https/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm https.asm https
@erase lang.inc
@pause
/programs/network/https/trunk/macros.inc
0,0 → 1,265
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/rccc/trunk/rccc.asm
25,7 → 25,7
dd 0x0 , 0x0 ; I_Param , I_Icon
 
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
 
START: ; start of execution
 
34,7 → 34,7
mov ecx,0x6000 ; local port
mov edx,0x6100 ; remote port
mov esi,dword [remote_ip] ; remote IP
mcall
int 0x40
 
mov [socket], eax
 
43,9 → 43,8
mov ecx,[socket]
mov edx,1
mov esi,connect
mcall
int 0x40
 
red:
call draw_window ; at first, draw the window
 
still:
52,7 → 51,7
 
mov eax,23 ; wait here for event
mov ebx,1
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
jz red
62,14 → 61,19
jz button
 
jmp still
 
red:
call draw_window
jmp still
 
key:
mov eax,2
mcall
int 0x40
jmp still
 
button:
mov eax,17
mcall
int 0x40
 
cmp ah,1 ; button id=1 ?
jnz noclose
76,9 → 80,9
mov eax, 53
mov ebx, 1
mov ecx, [socket]
mcall
or eax,-1
mcall
int 0x40
mov eax,-1
int 0x40
noclose:
 
cmp ah,2 ; SEND SHUTDOWN COMMAND?
114,7 → 118,7
mov ecx,[socket]
mov edx,1
mov esi,sen_shutdown
mcall
int 0x40
 
jmp still
 
125,7 → 129,7
mov ecx,[socket]
mov edx,1
mov esi,sen_reboot
mcall
int 0x40
 
jmp still
 
136,7 → 140,7
mov ecx,[socket]
mov edx,1
mov esi,sen_savefi
mcall
int 0x40
 
jmp still
 
147,7 → 151,7
mov ecx,[socket]
mov edx,1
mov esi,sen_savehi
mcall
int 0x40
 
jmp still
 
158,7 → 162,7
mov ecx,[socket]
mov edx,1
mov esi,sen_hotreboot
mcall
int 0x40
 
jmp still
 
169,7 → 173,7
mov ecx,[socket]
mov edx,1
mov esi,sen_exit
mcall
int 0x40
 
jmp still
 
178,7 → 182,7
mov eax,53
mov ebx,3
mov ecx,[socket]
mcall
int 0x40
 
mov [edi],bl
inc edi
186,7 → 190,7
mov eax,53
mov ebx,2
mov ecx,[socket]
mcall
int 0x40
 
cmp eax,0
jne get_data
196,7 → 200,7
mov ecx,0x000000
mov edx,I_END
mov esi,15
mcall
int 0x40
 
jmp still
; *********************************************
208,16 → 212,24
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
 
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+250 ; [x start] *65536 + [x size]
mov ecx,60*65536+280 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03ffffff ; color of work area RRGGBB
mov esi,0x80aabbcc ; color of grab bar RRGGBB,8->color gl
mov edi,0x00aabbcc ; color of frames RRGGBB
int 0x40
 
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labeltext ; pointer to text beginning
mov esi,lte-labeltext ; text length
int 0x40
mov eax,8 ; CONTROL BUTTONS
mov ebx,25*65536+9
224,8 → 236,9
mov ecx,113*65536+9
mov edx,2
mov esi,0x667788
int 0x40
newbut:
mcall
int 0x40
add ecx,16*65536
inc edx
cmp edx,8
232,13 → 245,13
jb newbut
 
cld
mov eax,4
mov ebx,25*65536+50 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
246,7 → 259,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
 
ret
 
290,9 → 303,9
db 'x' ; <- END MARKER, DONT DELETE
end if
 
title db 'Remote Control Center(Client)',0
labeltext: db 'Remote Control Center(Client)' ;
lte:
 
 
socket dd 0x0
 
remote_ip db 192,168,0,2
/programs/network/rccc/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm rccc.asm rccc
@erase lang.inc
@pause
/programs/network/rccc/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm rccc.asm rccc
@erase lang.inc
@pause
/programs/network/rccc/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/rccs/trunk/rccs.asm
25,7 → 25,7
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
remote_ip db 192,168,0,1
36,11 → 36,10
mov ecx, 0x6100 ; local port
mov edx, 0x6000 ; remote port
mov esi, dword [remote_ip] ; remote IP
mcall
int 0x40
mov [socket],eax
mov [0],eax ; save for remote code
 
red:
call draw_window ; at first, draw the window
still:
47,7 → 46,7
mov eax,23 ; wait here for event
mov ebx,1
mcall
int 0x40
cmp eax,1 ; redraw request ?
jz red
59,7 → 58,7
mov eax,53 ; data from cluster terminal ?
mov ebx,2
mov ecx,[socket]
mcall
int 0x40
cmp eax,0
jne data_arrived
66,9 → 65,13
jmp still
red:
call draw_window
jmp still
key:
mov eax,2
mcall
int 0x40
jmp still
button:
76,9 → 79,9
mov eax,53
mov ebx,1
mov ecx,[socket]
mcall
or eax,-1
mcall
int 0x40
mov eax,-1
int 0x40
data_arrived:
85,7 → 88,7
mov eax,5 ; wait a second for everything to arrive
mov ebx,10
mcall
int 0x40
mov edi,I_END
94,7 → 97,7
mov eax,53
mov ebx,3
mov ecx,[socket]
mcall
int 0x40
mov [edi],bl
inc edi
102,7 → 105,7
mov eax,53
mov ebx,2
mov ecx,[socket]
mcall
int 0x40
cmp eax,0
jne get_data
115,7 → 118,7
mov ecx,0x000000
mov edx,inp_con
mov esi,inp_con.len
mcall
int 0x40
add [y],10
 
jmp still
129,13 → 132,13
mov ecx,0x000000
mov edx,inp_shut
mov esi,inp_shut.len
mcall
int 0x40
add [y],10
 
mov eax,18
mov ebx,9
mov ecx,2
mcall
int 0x40
 
jmp still
 
148,13 → 151,13
mov ecx,0x000000
mov edx,inp_reb
mov esi,inp_reb.len
mcall
int 0x40
add [y],10
 
mov eax,18
mov ebx,9
mov ecx,3
mcall
int 0x40
jmp still
 
no_reb:
166,13 → 169,13
mov ecx,0x000000
mov edx,inp_savefi
mov esi,inp_savefi.len
mcall
int 0x40
add [y],10
 
mov eax,18
mov ebx,9
mov ecx,1
mcall
int 0x40
jmp still
 
no_savefi:
184,13 → 187,13
mov ecx,0x000000
mov edx,inp_savehi
mov esi,inp_savehi.len
mcall
int 0x40
add [y],10
 
mov eax,18
mov ebx,6
mov ecx,2
mcall
int 0x40
 
jmp still
 
203,13 → 206,13
mov ecx,0x000000
mov edx,inp_hotreb
mov esi,inp_hotreb.len
mcall
int 0x40
add [y],10
 
mov eax,18
mov ebx,9
mov ecx,4
mcall
int 0x40
jmp still
 
no_hotreb:
221,7 → 224,7
mov ecx,0x000000
mov edx,inp_exit
mov esi,inp_exit.len
mcall
int 0x40
add [y],10
call button
234,7 → 237,7
mov ecx,0x000000
mov edx,inp_com
mov esi,inp_com.len
mcall
int 0x40
add [y],10
 
jmp still
248,26 → 251,41
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+330 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03ffffff ; color of work area RRGGBB
mov esi,0x80aabbcc ; color of grab bar RRGGBB,8->color gl
mov edi,0x00aabbcc ; color of frames RRGGBB
int 0x40
mov eax,8
mov ebx,(286-19)*65536+12
mov ecx,4*65536+12
mov edx,1
mov esi,0xaabbcc
; int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labeltext ; pointer to text beginning
mov esi,lte-labeltext ; text length
int 0x40
; Re-draw the screen text
cld
mov eax,4
mov ebx,10*65536+30 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
276,7 → 294,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
ret
297,7 → 315,8
db 'x' ; <- END MARKER, DONT DELETE
end if
title db 'Remote Control Center(Server)',0
labeltext: db 'Remote Control Center(Server)'
lte:
socket dd 0x0
y dd 0x10
/programs/network/rccs/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm rccs.asm rccs
@erase lang.inc
@pause
/programs/network/rccs/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm rccs.asm rccs
@erase lang.inc
@pause
/programs/network/rccs/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/netsendc/trunk/netsendc.asm
25,7 → 25,7
dd 0, 0 ; param, icon
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
START: ; start of execution
34,7 → 34,7
mov ecx,0x4000 ; local port
mov edx,0x5000 ; remote port
mov esi,dword [remote_ip] ; node IP
mcall
int 0x40
mov [socketNum], eax
 
44,7 → 44,7
still:
mov eax,10 ; wait here for event
mcall
int 0x40
 
dec eax
jz red
53,12 → 53,12
 
key:
mov al,2
mcall
int 0x40
jmp still
button:
mov al,17
mcall
int 0x40
dec ah ; button id=1 ?
jnz noclose
65,9 → 65,9
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
or eax,-1
mcall
int 0x40
mov eax,-1
int 0x40
noclose:
; it was not close button, so it must be send code button
 
84,7 → 84,7
mov ecx,[socketNum]
mov edx,end_message-send_data
mov esi,send_data
mcall
int 0x40
 
jmp still
98,16 → 98,22
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+250 ; [x start] *65536 + [x size]
mov ecx,60*65536+150 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03ffffff ; color of work area RRGGBB
int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labeltext ; pointer to text beginning
mov esi,lte-labeltext ; text length
int 0x40
mov eax,8 ; SEND MESSAGE
mov ebx,50*65536+145
114,15 → 120,15
mov ecx,47*65536+13
mov edx,2
mov esi,0x667788
mcall
int 0x40
mov eax,4
mov ebx,25*65536+50 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,esi
cmp [edx],byte 'x'
130,7 → 136,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
ret
155,7 → 161,8
db 'x' ; <- END MARKER, DONT DELETE
end if
title db 'NetSend(Client)',0
labeltext: db 'NetSend(Client)' ;
lte:
remote_ip db 192,168,1,2
/programs/network/netsendc/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm netsendc.asm netsendc
@erase lang.inc
@pause
/programs/network/netsendc/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm netsendc.asm netsendc
@erase lang.inc
@pause
/programs/network/netsendc/trunk/macros.inc
0,0 → 1,267
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/netsends/trunk/netsends.asm
12,17 → 12,18
;
use32
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd START ; entry point
dd I_END ; image size
dd I_END+0x10000 ; required memory
dd I_END+0x10000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
db 'MENUET00' ; 8 byte id
dd 38 ; required os
dd START ; program start
dd I_END ; program image size
dd 0x100000 ; required amount of memory
dd 0x00000000 ; reserved=no extended header
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
remote_ip db 192,168,0,1
33,11 → 34,10
mov ecx, 0x5000 ; local port
mov edx, 0xffff ; remote port
mov esi, dword [remote_ip] ; remote IP
mcall
int 0x40
mov [socketNum],eax
mov [0],eax ; save for remote code
 
red:
call draw_window ; at first, draw the window
still:
44,7 → 44,7
mov eax,23 ; wait here for event
mov ebx,1
mcall
int 0x40
cmp eax,1 ; redraw request ?
jz red
56,7 → 56,7
mov eax,53 ; data from cluster terminal ?
mov ebx,2
mov ecx,[socketNum]
mcall
int 0x40
cmp eax,0
jne data_arrived
63,9 → 63,13
jmp still
red:
call draw_window
jmp still
key:
mov eax,2
mcall
int 0x40
jmp still
button:
73,9 → 77,9
mov eax,53
mov ebx,1
mov ecx,[socketNum]
mcall
or eax,-1
mcall
int 0x40
mov eax,-1
int 0x40
data_arrived:
82,7 → 86,7
mov eax,5 ; wait a second for everything to arrive
mov ebx,10
mcall
int 0x40
mov edi,I_END
91,7 → 95,7
mov eax,53
mov ebx,3
mov ecx,[socketNum]
mcall
int 0x40
mov [edi],bl
inc edi
99,7 → 103,7
mov eax,53
mov ebx,2
mov ecx,[socketNum]
mcall
int 0x40
cmp eax,0
jne get_data
110,7 → 114,7
mov ecx,0x000000
mov edx,I_END
mov esi,100
mcall
int 0x40
add [y],10
129,26 → 133,41
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+330 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03ffffff ; color of work area RRGGBB
mov esi,0x80aabbcc ; color of grab bar RRGGBB,8->color gl
mov edi,0x00aabbcc ; color of frames RRGGBB
int 0x40
mov eax,8
mov ebx,(286-19)*65536+12
mov ecx,4*65536+12
mov edx,1
mov esi,0xaabbcc
; int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labeltext ; pointer to text beginning
mov esi,lte-labeltext ; text length
int 0x40
; Re-draw the screen text
cld
mov eax,4
mov ebx,10*65536+30 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
157,7 → 176,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
ret
178,7 → 197,8
db 'x' ; <- END MARKER, DONT DELETE
end if
title db 'NetSend(Server)',0
labeltext: db 'NetSend(Server)'
lte:
socketNum dd 0x0
/programs/network/netsends/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm netsends.asm netsends
@erase lang.inc
@pause
/programs/network/netsends/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm netsends.asm netsends
@erase lang.inc
@pause
/programs/network/netsends/trunk/macros.inc
0,0 → 1,267
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/arpstat/trunk/arpstat.asm
16,7 → 16,7
dd 0x100000 ; required amount of memory
dd 0x00000000 ; reserved=no extended header
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
START: ; start of execution
call draw_window ; at first, draw the window
24,7 → 24,7
still:
mov eax,23 ; wait here for event
mov ebx,200 ; Time out after 2s
mcall
int 0x40
cmp eax,1 ; redraw request ?
jz red
38,7 → 38,7
mov eax, 53
mov ebx, 255
mov ecx, 200
mcall
int 0x40
 
push eax
mov ebx, text + 24
47,7 → 47,7
mov eax, 53
mov ebx, 255
mov ecx, 201
mcall
int 0x40
mov ebx, text + 64
call printhex
94,13 → 94,13
mov eax, 53
mov ebx, 255
mov ecx, 202
mcall
int 0x40
; Read the IP address
mov eax, 53
mov ebx, 255
mov ecx, 203
mcall
int 0x40
; IP in eax. Get the address to put it back
pop ebx
124,7 → 124,7
mov eax, 53
mov ebx, 255
mov ecx, 204
mcall
int 0x40
pop ebx
mov ecx, eax
179,7 → 179,7
mov eax, 53
mov ebx, 255
mov ecx, 205
mcall
int 0x40
pop ebx
mov ecx, eax
213,7 → 213,7
mov eax, 53
mov ebx, 255
mov ecx, 206
mcall
int 0x40
pop ebx
mov ecx, eax
247,7 → 247,7
mov eax, 53
mov ebx, 255
mov ecx, 207
mcall
int 0x40
pop ebx
mov ecx, eax
289,18 → 289,18
key: ; Keys are not valid at this part of the
mov eax,2 ; loop. Just read it and ignore
mcall
int 0x40
jmp still
button: ; button
mov eax,17 ; get id
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jnz still
 
mov eax,0xffffffff ; close this program
mcall
int 0x40
 
jmp still
 
339,26 → 339,34
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+280 ; [x start] *65536 + [x size]
mov ecx,100*65536+270 ; [y start] *65536 + [y size]
mov edx,0x13224466 ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03224466 ; color of work area RRGGBB
mov esi,0x00334455 ; color of grab bar RRGGBB,8->color gl
mov edi,0x00ddeeff ; color of frames RRGGBB
int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
; Re-draw the screen text
cld
mov eax,4
mov ebx,25*65536+35 ; draw info text with function 4
mov ecx,0xffffff
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
367,7 → 375,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
ret
418,7 → 426,9
db ' xxx.xxx.xxx.xxx xxxxxxxxxxxx xxxx xxxx '
 
title db 'ARP Table ( First 10 Entries )',0
labelt:
db 'ARP Table ( First 10 Entries )'
labellen:
hextable db '0123456789ABCDEF'
 
/programs/network/arpstat/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm arpstat.asm arpstat
@erase lang.inc
@pause
/programs/network/arpstat/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm arpstat.asm arpstat
@erase lang.inc
@pause
/programs/network/arpstat/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/dhcp/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm dhcp.asm dhcp
@erase lang.inc
@pause
/programs/network/dhcp/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm dhcp.asm dhcp
@erase lang.inc
@pause
/programs/network/dhcp/trunk/dhcp.asm
5,19 → 5,18
;
 
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
 
use32
 
org 0x0
 
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; start of code
dd I_END ; size of image
dd I_END+0x8000 ; memory for app
dd I_END+0x8000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
db 'MENUET00' ; 8 byte id
dd 38 ; required os
dd START ; program start
dd I_END ; program image size
dd 0x100000 ; required amount of memory
dd 0x00000000 ; reserved=no extended header
 
 
START: ; start of execution
25,12 → 24,11
mov ebx,10000111b ; Stack 8 + defaults
int 0x40
 
red: ; redraw
call draw_window ; at first, draw the window
 
still:
mov eax,10 ; wait here for event
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
jz red
40,14 → 38,19
jz button
 
jmp still
 
red: ; redraw
call draw_window
jmp still
 
key: ; Keys are not valid at this part of the
mov eax,2 ; loop. Just read it and ignore
mcall
int 0x40
jmp still
 
button: ; button
mov eax,17 ; get id
mcall
int 0x40
 
cmp ah,1 ; button id=1 ?
jnz noclose
56,10 → 59,10
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
 
mov eax,0xffffffff ; close this program
mcall
int 0x40
 
noclose:
cmp ah,3 ; Resolve address?
243,7 → 246,7
mov ecx, 68 ; local port dhcp client
mov edx, 67 ; remote port - dhcp server
mov esi, 0xffffffff ; broadcast
mcall
int 0x40
 
mov [socketNum], eax
 
262,7 → 265,7
mov ecx, [socketNum]
mov edx, [dhcpMsgLen]
mov esi, dhcpMsg
mcall
int 0x40
 
; Setup the DHCP buffer to receive response
 
276,7 → 279,7
 
ctr001:
mov eax,10 ; wait here for event
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
je ctr003
290,7 → 293,7
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall
int 0x40
 
cmp eax, 0
je ctr001
300,7 → 303,7
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte - block (high byte)
int 0x40 ; read byte - block (high byte)
 
; Store the data in the response buffer
mov eax, [dhcpMsgLen]
310,7 → 313,7
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
int 0x40 ; any more data?
 
cmp eax, 0
jne ctr002 ; yes, so get it
362,7 → 365,7
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
 
mov [socketNum], dword 0xFFFF
 
376,18 → 379,18
 
ctr004: ; key
mov eax,2 ; just read it and ignore
mcall
int 0x40
jmp ctr001
 
ctr005: ; button
mov eax,17 ; get id
mcall
int 0x40
 
; close socket
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
 
mov [socketNum], dword 0xFFFF
 
418,7 → 421,7
mov eax,47
push ecx
movzx ecx,byte [edi]
mcall
int 0x40
pop ecx
add edx,6*4*65536
inc edi
474,7 → 477,7
add edx,1*65536+99
mov ecx,[esp+20]
mov esi,0xffffff
mcall
int 0x40
popa
sub ecx,4
ret
484,14 → 487,22
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+156 ; [y start] *65536 + [y size]
mov edx,0x13224466 ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03224466 ; color of work area RRGGBB
mov esi,0x00334455 ; color of grab bar RRGGBB,8->color gl
mov edi,0x00ddeeff ; color of frames RRGGBB
int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
mov eax,8 ; Resolve
mov ebx,20*65536+90
498,7 → 509,7
mov ecx,127*65536+15
mov edx,3
mov esi,0x557799
mcall
int 0x40
 
; Pass in the IP address in edi
; row to display in [ya]
523,13 → 534,14
 
; Re-draw the screen text
cld
mov eax,4
mov ebx,25*65536+35 ; draw info text with function 4
mov ecx,0xffffff
mov edx,text
mov esi,40
 
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
538,7 → 550,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
 
ret
 
562,7 → 574,8
dhms db ' d h m s'
forever db 'Forever '
 
title db 'DHCP Client Test',0
labelt: db 'DHCP Client Test'
labellen:
 
dhcpMsgType: db 0
dhcpLease: dd 0
/programs/network/dhcp/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/dnsr/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm dnsr.asm dnsr
@erase lang.inc
@pause
/programs/network/dnsr/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm dnsr.asm dnsr
@erase lang.inc
@pause
/programs/network/dnsr/trunk/dnsr.asm
17,17 → 17,18
 
 
use32
 
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd START ; entry point
dd I_END ; image size
dd I_END+0x10000 ; required memory
dd I_END+0x10000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
 
db 'MENUET00' ; 8 byte id
dd 38 ; required os
dd START ; program start
dd I_END ; program image size
dd 0x100000 ; required amount of memory
dd 0x00000000 ; reserved=no extended header
 
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
 
START: ; start of execution
mov eax,40 ; Report events
37,12 → 38,11
mov dword [prompt], p1
mov dword [promptlen], p1len - p1 ; 'waiting for command'
 
red:
call draw_window ; at first, draw the window
 
still:
mov eax,10 ; wait here for event
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
jz red
52,14 → 52,19
jz button
 
jmp still
 
red: ; redraw
call draw_window
jmp still
 
key: ; Keys are not valid at this part of the
mov eax,2 ; loop. Just read it and ignore
mcall
int 0x40
jmp still
 
button: ; button
mov eax,17 ; get id
mcall
int 0x40
 
cmp ah,1 ; button id=1 ?
jnz noclose
68,10 → 73,10
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
 
mov eax,0xffffffff ; close this program
mcall
int 0x40
 
noclose:
cmp ah,3 ; Resolve address?
117,7 → 122,7
 
f11:
mov eax,10
mcall
int 0x40
cmp eax,2
jz fbu
jmp still
124,7 → 129,7
 
fbu:
mov eax,2
mcall ; get key
int 0x40 ; get key
shr eax,8
cmp eax,8
jnz nobs
164,7 → 169,7
shl ecx,16
mov cx,8
mov edx,0x224466
mcall
int 0x40
 
mov eax,4
mov ebx,103*65536
172,7 → 177,7
mov ecx,0xffffff
mov edx,[addr]
mov esi,26
mcall
int 0x40
 
ret
 
315,7 → 320,7
push ecx
mov eax, 53
mov ebx, 9
mcall
int 0x40
pop ecx
cmp eax, 0 ; is this local port in use?
jz getlp ; yes - so try next
325,7 → 330,7
mov ebx, 0
mov edx, 53 ; remote port - dns
mov esi, [dnsIP]
mcall
int 0x40
 
mov [socketNum], eax
 
335,7 → 340,7
mov ecx, [socketNum]
mov edx, [dnsMsgLen]
mov esi, dnsMsg
mcall
int 0x40
 
; Setup the DNS response buffer
 
349,7 → 354,7
 
ctr001:
mov eax,10 ; wait here for event
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
je ctr003
363,7 → 368,7
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall
int 0x40
 
cmp eax, 0
je ctr001
373,7 → 378,7
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte - block (high byte)
int 0x40 ; read byte - block (high byte)
 
; Store the data in the response buffer
mov eax, [dnsMsgLen]
388,7 → 393,7
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
int 0x40 ; any more data?
 
cmp eax, 0
jne ctr002 ; yes, so get it
397,7 → 402,7
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
 
mov [socketNum], dword 0xFFFF
 
484,18 → 489,18
 
ctr004: ; key
mov eax,2 ; just read it and ignore
mcall
int 0x40
jmp ctr001
 
ctr005: ; button
mov eax,17 ; get id
mcall
int 0x40
 
; close socket
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
 
mov [socketNum], dword 0xFFFF
mov [hostIP], dword 0
549,14 → 554,22
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+140 ; [y start] *65536 + [y size]
mov edx,0x13224466 ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL;
mcall
mov edx,0x03224466 ; color of work area RRGGBB
mov esi,0x00334455 ; color of grab bar RRGGBB,8->color gl
mov edi,0x00ddeeff ; color of frames RRGGBB
int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
mov eax,8 ; Resolve
mov ebx,20*65536+190
563,19 → 576,21
mov ecx,79*65536+15
mov edx,3
mov esi,0x557799
mcall
int 0x40
 
;mov eax,8
mov eax,8
mov ebx,270*65536+10
mov ecx,34*65536+10
inc edx
mcall
mov edx,4
mov esi,0x557799
int 0x40
 
;mov eax,8
mov eax,8
mov ebx,270*65536+10
mov ecx,50*65536+10
inc edx
mcall
mov edx,5
mov esi,0x557799
int 0x40
 
; Copy the file name to the screen buffer
; file name is same length as IP address, to
601,13 → 616,14
 
; Re-draw the screen text
cld
mov eax,4
mov ebx,25*65536+35 ; draw info text with function 4
mov ecx,0xffffff
mov edx,text
mov esi,40
 
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
628,7 → 644,7
ipdisplay:
mov eax,47
movzx ecx,byte [edi]
mcall
int 0x40
add edx,6*4*65536
inc edi
cmp edi,hostIP+4
637,7 → 653,7
dw001:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
 
ret
 
665,7 → 681,7
mov eax,63
mov ebx, 1
push esi
mcall
int 0x40
 
inc word [ind]
mov ax, [ind]
676,11 → 692,11
mov cl, 13
mov eax,63
mov ebx, 1
mcall
int 0x40
mov cl, 10
mov eax,63
mov ebx, 1
mcall
int 0x40
 
 
ds1:
734,7 → 750,9
db 'x <- END MARKER, DONT DELETE '
 
 
title db 'DNS Client',0
labelt:
db 'DNS Client'
labellen:
 
 
prompt: dd 0
752,7 → 770,7
 
 
dnsServer db '194.145.128.1 ' ; iolfree.ie DNS
query db 'WWW.MENUETOS.NET '
query db 'WWW.MENUETOS.ORG '
 
hostIP: dd 0
dnsIP: dd 0
/programs/network/dnsr/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/ethstat/trunk/ethstat.asm
5,26 → 5,26
;
use32
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd START ; entry point
dd I_END ; image size
dd I_END+0x10000 ; required memory
dd I_END+0x10000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
db 'MENUET00' ; 8 byte id
dd 38 ; required os
dd START ; program start
dd I_END ; program image size
dd 0x100000 ; required amount of memory
dd 0x00000000 ; reserved=no extended header
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
START: ; start of execution
 
call draw_window ; at first, draw the window
still:
mov eax,23 ; wait here for event
mov ebx,200 ; Time out after 2s
mcall
int 0x40
cmp eax,1 ; redraw request ?
jz red
38,7 → 38,7
mov eax, 53
mov ebx, 255
mov ecx, 6
mcall
int 0x40
mov ebx, text + 24
call printhex
46,7 → 46,7
mov eax, 53
mov ebx, 255
mov ecx, 2
mcall
int 0x40
mov ebx, text + 107
call printhex
54,7 → 54,7
mov eax, 53
mov ebx, 255
mov ecx, 5
mcall
int 0x40
mov ebx, text + 107 + 40
call printhex
62,7 → 62,7
mov eax, 53
mov ebx, 255
mov ecx, 4
mcall
int 0x40
mov ebx, text + 107 + 80
call printhex
70,7 → 70,7
mov eax, 53
mov ebx, 255
mov ecx, 100
mcall
int 0x40
mov ebx, text + 258
call printhex
78,7 → 78,7
mov eax, 53
mov ebx, 255
mov ecx, 101
mcall
int 0x40
mov ebx, text + 258 + 40
call printhex
86,7 → 86,7
mov eax, 53
mov ebx, 255
mov ecx, 102
mcall
int 0x40
mov ebx, text + 258 + 80
call printhex
94,7 → 94,7
mov eax, 53
mov ebx, 255
mov ecx, 103
mcall
int 0x40
mov ebx, text + 258 + 120
call printhex
105,18 → 105,18
key: ; Keys are not valid at this part of the
mov eax,2 ; loop. Just read it and ignore
mcall
int 0x40
jmp still
button: ; button
mov eax,17 ; get id
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jnz still
or eax,-1 ; close this program
mcall
mov eax,0xffffffff ; close this program
int 0x40
jmp still
132,26 → 132,34
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+260 ; [x start] *65536 + [x size]
mov ecx,100*65536+205 ; [y start] *65536 + [y size]
mov edx,0x13224466 ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03224466 ; color of work area RRGGBB
mov esi,0x00334455 ; color of grab bar RRGGBB,8->color gl
mov edi,0x00ddeeff ; color of frames RRGGBB
int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
; Re-draw the screen text
cld
mov eax,4
mov ebx,25*65536+35 ; draw info text with function 4
mov ecx,0xffffff
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
160,7 → 168,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
ret
203,7 → 211,9
db 'x <- END MARKER, DONT DELETE '
title db 'Stack Status',0
labelt:
db 'Stack Status'
labellen:
hextable db '0123456789ABCDEF'
/programs/network/ethstat/trunk/macros.inc
0,0 → 1,267
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/httpc/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm httpc.asm httpc
@erase lang.inc
@pause
/programs/network/httpc/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm httpc.asm httpc
@erase lang.inc
@pause
/programs/network/httpc/trunk/httpc.asm
23,17 → 23,18
DEBUGGING_STATE equ DEBUGGING_DISABLED
 
use32
 
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd START ; entry point
dd I_END ; image size
dd 0x100000 ; required memory
dd 0x100000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
 
db 'MENUET00' ; 8 byte id
dd 38 ; required os
dd START ; program start
dd I_END ; program image size
dd 0x100000 ; required amount of memory
dd 0x00000000 ; reserved=no extended header
 
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
;include "DEBUG.INC"
 
URLMAXLEN equ 50 ; maximum length of url string
49,15 → 50,14
 
mov eax,40 ; Report events
mov ebx,10000111b ; Stack 8 + defaults
mcall
int 0x40
 
red: ; redraw
call draw_window
 
still:
mov eax,23 ; wait here for event
mov ebx,1
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
je red
75,7 → 75,7
mov eax,53
mov ebx,6
mov ecx,[socket]
mcall
int 0x40
 
mov [status],eax
 
102,7 → 102,7
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
 
call draw_page
 
111,9 → 111,13
no_close:
jmp still
 
red: ; redraw
call draw_window
jmp still
 
key: ; key
mov eax,2 ; just read it and ignore
mcall
int 0x40
shr eax,8
cmp eax,184
jne no_down
134,7 → 138,7
button: ; button
;dps <"Button pressed",13,10>
mov eax,17 ; get id
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jne noclose
 
143,7 → 147,7
mov eax, 53
mov ebx, 8
mov ecx, [socket]
mcall
int 0x40
 
;dpd eax
;dps <13,10>
150,7 → 154,7
 
exit:
or eax,-1 ; close this program
mcall
int 0x40
 
noclose:
cmp ah,31
185,7 → 189,7
 
f11:
mov eax,10
mcall
int 0x40
cmp eax,2 ; key?
jz fbu
jmp still
192,7 → 196,7
 
fbu:
mov eax,2
mcall ; get key
int 0x40 ; get key
shr eax,8
cmp eax,8
jnz nobs
254,7 → 258,7
mov ecx,[socket]
mov edx,4
mov esi,string0
mcall
int 0x40
 
mov edx,0
 
268,7 → 272,7
mov ebx,7
mov ecx,[socket]
mov esi,document
mcall
int 0x40
 
mov eax,53 ; ' HTTP/1.0 .. '
mov ebx,7
275,7 → 279,7
mov ecx,[socket]
mov edx,stringh_end-stringh
mov esi,stringh
mcall
int 0x40
 
popa
ret
294,7 → 298,7
 
mov eax,26
mov ebx,9
mcall
int 0x40
 
cmp eax,[nextupdate]
jb status_return
309,7 → 313,7
shl ecx,16
add ecx,-18*65536+10
mov edx,0xffffff
mcall
int 0x40
 
mov eax,47
mov ebx,3*65536
317,7 → 321,7
mov edx,12*65536-18
add edx,[winys]
mov esi,0x000000
mcall
int 0x40
 
mov eax,47
mov ebx,6*65536
325,7 → 329,7
mov edx,40*65536-18
add edx,[winys]
mov esi,0x000000
mcall
int 0x40
 
status_return:
popa
352,7 → 356,7
mov eax, 53
mov ebx, 2
mov ecx, [socket]
mcall
int 0x40
 
cmp eax,0
je no_more_data
361,7 → 365,7
mov eax, 53
mov ebx, 3
mov ecx, [socket]
mcall
int 0x40
 
yesm:
inc [pos]
375,7 → 379,7
 
mov eax,5
mov ebx,50
mcall
int 0x40
 
jmp newbyteread
 
671,7 → 675,7
shl ecx,16
add ecx,10
mov edx,0xffffff
mcall
int 0x40
 
mov eax,4
mov ebx,[esp+4]
711,7 → 715,7
noecx128:
mov esi,1
 
mcall
int 0x40
 
pop ebx
pop eax
759,7 → 763,7
push ecx
mov eax, 53
mov ebx, 9
mcall
int 0x40
pop ecx
cmp eax, 0 ; is this local port in use?
jz getlp1 ; yes - so try next
769,7 → 773,7
mov edx,80
mov esi,dword [server_ip]
mov edi,1
mcall
int 0x40
mov [socket], eax
 
mov [pos],0
787,7 → 791,7
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
 
call draw_page
 
1064,7 → 1068,7
push ecx
mov eax, 53
mov ebx, 9
mcall
int 0x40
pop ecx
cmp eax, 0 ; is this local port in use?
jz getlp ; yes - so try next
1074,7 → 1078,7
mov ebx, 0
mov edx, 53 ; remote port - dns
mov esi, dword [dns_ip]
mcall
int 0x40
 
mov [socketNum], eax
 
1084,7 → 1088,7
mov ecx, [socketNum]
mov edx, [dnsMsgLen]
mov esi, dnsMsg
mcall
int 0x40
 
; Setup the DNS response buffer
 
1098,7 → 1102,7
 
ctr001:
mov eax,10 ; wait here for event
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
je ctr003
1112,7 → 1116,7
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall
int 0x40
 
cmp eax, 0
je ctr001
1122,7 → 1126,7
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte - block (high byte)
int 0x40 ; read byte - block (high byte)
 
; Store the data in the response buffer
mov eax, [dnsMsgLen]
1132,7 → 1136,7
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
int 0x40 ; any more data?
 
cmp eax, 0
jne ctr002 ; yes, so get it
1141,7 → 1145,7
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
 
mov [socketNum], dword 0xFFFF
 
1235,12 → 1239,12
 
ctr004: ; key
mov eax,2 ; just read it and ignore
mcall
int 0x40
jmp ctr001
 
ctr005: ; button
mov eax,17 ; get id
mcall
int 0x40
 
mov dl, ah
 
1248,7 → 1252,7
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
 
cmp dl, 1
je exit
1312,7 → 1316,7
mov cl, '"'
mov eax,63
mov ebx, 1
mcall
int 0x40
pop esi
 
dps_000:
1327,15 → 1331,15
mov cl, '"'
mov eax,63
mov ebx, 1
mcall
int 0x40
mov cl, 13
mov eax,63
mov ebx, 1
mcall
int 0x40
mov cl, 10
mov eax,63
mov ebx, 1
mcall
int 0x40
ret
 
dps_001:
1342,7 → 1346,7
mov eax,63
mov ebx, 1
push esi
mcall
int 0x40
 
pop esi
inc esi
1366,7 → 1370,7
shl ecx,16
mov cx,9
mov edx,0xFFFFFF
mcall
int 0x40
 
; write text
mov eax,4
1375,7 → 1379,7
mov ecx,0x000000
mov edx,[addr]
mov esi,URLMAXLEN
mcall
int 0x40
 
ret
 
1386,38 → 1390,47
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
 
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,50*65536+550 ; [x start] *65536 + [x size]
mov ecx,50*65536+400 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB,8->color gl
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl
mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl
mov edi,0x005080d0 ; color of frames RRGGBB
int 0x40
 
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ddeeff ; color of text RRGGBB
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
 
mov esi, URLMAXLEN ; URL
mov eax,4 ; function 4 : write text to window
mov ebx,30*65536+38 ; [x start] *65536 + [y start]
mov ecx,0x000000 ; color of text RRGGBB
mov edx,document_user ; pointer to text beginning
mcall
int 0x40
 
mov eax,38
mov ebx,5*65536+545
mov ecx,60*65536+60
mov edx,0x000000
mcall
int 0x40
 
;mov eax,38
;mov ebx,5*65536+545
mov eax,38
mov ebx,5*65536+545
mov ecx,[winys]
shl ecx,16
add ecx,[winys]
sub ecx,26*65536+26
;mov edx,0x000000
mcall
mov edx,0x000000
int 0x40
; RELOAD
mov eax,8 ; function 8 : define and draw button
mov ebx,388*65536+50 ; [x start] *65536 + [x size]
1424,23 → 1437,23
mov ecx,34*65536+14 ; [y start] *65536 + [y size]
mov edx,22 ; button id
mov esi,0x5588dd ; button color RRGGBB
mcall
int 0x40
 
; URL
;mov eax,8 ; function 8 : define and draw button
mov eax,8 ; function 8 : define and draw button
mov ebx,10*65536+12 ; [x start] *65536 + [x size]
mov ecx,34*65536+12 ; [y start] *65536 + [y size]
mov edx,10 ; button id
;mov esi,0x5588dd ; button color RRGGBB
mcall
mov esi,0x5588dd ; button color RRGGBB
int 0x40
 
; STOP
;mov eax,8 ; function 8 : define and draw button
mov eax,8 ; function 8 : define and draw button
mov ebx,443*65536+50 ; [x start] *65536 + [x size]
mov ecx,34*65536+14 ; [y start] *65536 + [y size]
mov edx,24 ; button id
;mov esi,0x5588dd ; button color RRGGBB
mcall
mov esi,0x5588dd ; button color RRGGBB
int 0x40
 
; BUTTON TEXT
mov eax,4 ; function 4 : write text to window
1448,13 → 1461,13
mov ecx,0xffffff ; color of text RRGGBB
mov edx,button_text ; pointer to text beginning
mov esi,20 ; text length
mcall
int 0x40
 
call display_page
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
 
ret
 
1486,7 → 1499,8
ya dd 0x0
len dd 0x00
 
title db 'HTTPC - PgUp/PgDown',0
labelt: db 'HTTPC - PgUp/PgDown'
labellen:
 
server_ip: db 207,44,212,20
dns_ip: db 194,145,128,1
/programs/network/httpc/trunk/macros.inc
0,0 → 1,265
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/ipc/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm ipc.asm ipc
@erase lang.inc
@pause
/programs/network/ipc/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm ipc.asm ipc
@erase lang.inc
@pause
/programs/network/ipc/trunk/ipc.asm
4,7 → 4,7
; Compile with FASM for Menuet
;
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
 
use32
org 0x0
24,16 → 24,15
mov ebx,1 ; define receive area
mov ecx,received_messages ; pointer to start
mov edx,1000 ; size of area
mcall
int 0x40
 
mov eax,40 ; WANTED EVENTS
mov ebx,01000111b ; IPC 7 + defaults
mcall
int 0x40
 
mov [received_messages+8],dword 0*256+0
mov [received_messages+12],dword 0
 
red:
call draw_window ; at first, draw the window
 
still:
40,7 → 39,7
 
mov eax,23 ; wait here for event
mov ebx,50
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
je red
57,19 → 56,23
 
jmp still
 
red: ; redraw
call draw_window
jmp still
 
key: ; key
mov eax,2 ; just read it and ignore
mcall
int 0x40
jmp still
 
button: ; button
mov eax,17 ; get id
mcall
int 0x40
 
cmp ah,1 ; button id=1 ?
jne noclose
mov eax,-1 ; close this program
mcall
int 0x40
noclose:
 
cmp ah,2
98,7 → 101,7
mov ecx,[PID]
mov edx,message+4
mov esi,20;[message_size]
mcall
int 0x40
 
jmp still
no_read:
158,7 → 161,7
mov ebx,25*65536+245
mov ecx,105*65536+90
mov edx,0xdddddd
mcall
int 0x40
 
cmp [received_messages+4],dword 8 ; empty list
je ipma1
176,7 → 179,7
mov eax,47
mov ebx,4*65536
mov esi,0xff0000
mcall
int 0x40
popa
pusha
mov esi,20
183,7 → 186,7
add edx,8
add ebx,30*65536
mov eax,4
mcall
int 0x40
popa
 
add ebx,10
219,21 → 222,27
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
 
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+290 ; [x start] *65536 + [x size]
mov ecx,100*65536+220 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB,8->color gl
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl
int 0x40
 
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x10ffffff ; color of text RRGGBB
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
mov eax,9
mov ebx,process_info
mov ecx,-1
mcall
int 0x40
 
mov eax,47
mov ebx,4*65536
240,7 → 249,7
mov ecx,[process_info+30]
mov edx,180*65536+35
mov esi,0x000000
mcall
int 0x40
 
mov eax,8 ; MESSAGE
mov ebx,25*65536+87
247,21 → 256,22
mov ecx,50*65536+16
mov edx,2
mov esi,0x5588dd
mcall
int 0x40
 
;mov eax,8 ; POP
mov eax,8 ; POP
mov ebx,216*65536+53
mov ecx,80*65536+16
mov edx,3
mcall
mov esi,0x5588dd
int 0x40
 
mov eax,4
mov ebx,25*65536+35 ; draw info text with function 4
mov ecx,0x224466
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,10
add edx,40
cmp [edx],byte 'x'
271,7 → 281,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
 
ret
 
298,7 → 308,7
 
f11:
mov eax,10
mcall
int 0x40
cmp eax,2
jz fbu
 
309,7 → 319,7
 
fbu:
mov eax,2
mcall ; get key
int 0x40 ; get key
shr eax,8
 
cmp eax,13
356,7 → 366,7
shl ecx,16
mov cx,8
mov edx,0xffffff
mcall
int 0x40
 
mov eax,4
mov ebx,[xa]
365,7 → 375,7
mov ecx,0x000000
mov edx,[addr]
mov esi,25
mcall
int 0x40
 
ret
 
390,7 → 400,9
db 'x' ; <- END MARKER, DONT DELETE
 
 
title db 'IPC - START AT LEAST 2',0
labelt:
db 'IPC - START AT LEAST 2'
labellen:
 
I_END:
 
/programs/network/ipc/trunk/macros.inc
0,0 → 1,267
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/local/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm local.asm local
@erase lang.inc
@pause
/programs/network/local/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm local.asm local
@erase lang.inc
@pause
/programs/network/local/trunk/local.asm
6,18 → 6,18
use32
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd START ; entry point
dd I_END ; image size
dd I_END+0x10000 ; required memory
dd I_END+0x10000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
 
db 'MENUET00' ; 8 byte id
dd 38 ; required os
dd START ; program start
dd I_END ; program image size
dd 0x100000 ; required amount of memory
dd 0x00000000 ; reserved=no extended header
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
START: ; start of execution
26,11 → 26,10
mov ecx,0x2000 ; local port
mov edx,0x3000 ; remote port
mov esi,dword [host_ip] ; node IP
mcall
int 0x40
mov [socketNum], eax
 
red:
call draw_window ; at first, draw the window
still:
37,7 → 36,7
mov eax,23 ; wait here for event
mov ebx,1
mcall
int 0x40
cmp eax,1 ; redraw request ?
jz red
49,20 → 48,24
mov eax, 53 ; get data
mov ebx, 2
mov ecx, [socketNum]
mcall
int 0x40
cmp eax, 0
jne read
jmp still
red:
call draw_window
jmp still
key:
mov eax,2
mcall
int 0x40
jmp still
button:
mov eax,17
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jnz noclose
69,9 → 72,9
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
int 0x40
mov eax,-1
mcall
int 0x40
noclose:
cmp ah,2 ; SEND CODE ?
93,7 → 96,7
mov ecx,[socketNum]
mov edx,23 + 4
mov esi,I_END
mcall
int 0x40
jmp still
no_left:
113,7 → 116,7
mov ecx,[socketNum]
mov edx,23 + 4
mov esi,I_END
mcall
int 0x40
jmp still
no_right:
156,7 → 159,7
mov ecx,[socketNum]
mov edx,23 + remote_code_end - remote_code_start
mov esi,I_END
mcall
int 0x40
jmp still
170,7 → 173,7
mov ecx,[socketNum]
mov edx,19
mov esi,execute
mcall
int 0x40
mov edi,3
193,7 → 196,7
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
int 0x40 ; read byte
shl edx,8
mov dl,bl
210,7 → 213,7
add ebx,15
add ecx,35
add ebx,[picture_position]
mcall
int 0x40
inc [xx]
cmp [xx],dword 128
227,7 → 230,7
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
int 0x40 ; any more data?
cmp eax, 0
jne cfr007 ; yes, so get it
246,7 → 249,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
253,9 → 256,17
mov ebx,100*65536+286 ; [x start] *65536 + [x size]
mov ecx,60*65536+330 ; [y start] *65536 + [y size]
mov edx,0x03ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov esi,0x80aabbcc ; color of grab bar RRGGBB,8->color gl
mov edi,0x00aabbcc ; color of frames RRGGBB
int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labeltext ; pointer to text beginning
mov esi,lte-labeltext ; text length
int 0x40
mov eax,8 ; SEND CODE
mov ebx,60*65536+160
262,35 → 273,38
mov ecx,181*65536+13
mov edx,2
mov esi,0x667788
mcall
int 0x40
;mov eax,8 ; LEFT
mov eax,8 ; LEFT
mov ebx,60*65536+75
mov ecx,197*65536+13
mov edx,3
mcall
mov esi,0x667788
int 0x40
;mov eax,8 ; RIGHT
mov eax,8 ; RIGHT
mov ebx,148*65536+72
mov ecx,197*65536+13
mov edx,4
mcall
mov esi,0x667788
int 0x40
;mov eax,8 ; SEND EXECUTE
mov eax,8 ; SEND EXECUTE
mov ebx,60*65536+160
mov ecx,213*65536+13
mov edx,5
mcall
mov esi,0x667788
int 0x40
cld
mov eax,4
mov ebx,25*65536+185 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
298,7 → 312,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
ret
314,10 → 328,11
db ' LOCAL : 192.168.1.26 '
db ' REMOTE : 192.168.1.22 '
db ' REMOTE CODE AT THE END OF THIS FILE '
db 'x' ;<- END MARKER, DONT DELETE
db 'x <- END MARKER, DONT DELETE '
title db 'CLUSTER LOCAL',0
labeltext: db 'CLUSTER LOCAL' ;
lte:
socketNum dd 0x0
477,11 → 492,11
mov ebx,4
mov ecx,[0]
mov edx,3*16
mcall
int 0x40
mov eax,5
mov ebx,1
mcall
int 0x40
popa
/programs/network/local/trunk/macros.inc
0,0 → 1,267
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/nntpc/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm nntpc.asm nntpc
@erase lang.inc
@pause
/programs/network/nntpc/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm nntpc.asm nntpc
@erase lang.inc
@pause
/programs/network/nntpc/trunk/macros.inc
0,0 → 1,267
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/nntpc/trunk/nntpc.asm
8,7 → 8,7
version equ '0.1'
 
include "lang.inc"
include "..\..\..\macros.inc"
include "macros.inc"
 
use32
org 0x0
87,7 → 87,7
mov eax,53
mov ebx,6
mov ecx,[socket]
mcall
int 0x40
 
cmp eax,[prev_state]
je no_cos
98,7 → 98,7
mov ebx,435*65536+12*6
mov ecx,42*65536+10
mov edx,0xffffff
mcall
int 0x40
 
mov ecx,-14
mov eax,[prev_state]
123,7 → 123,7
mov ebx,435*65536+42
mov ecx,0x000000
mov esi,12
mcall
int 0x40
 
no_cos:
 
150,13 → 150,13
call draw_entries
 
mov eax,10
mcall
int 0x40
 
cmp eax,2
jne no_more_text
 
mov eax,2
mcall
int 0x40
 
cmp ah,8
jne no_bg
225,7 → 225,7
mov ecx,[socket]
mov edx,[grouplen]
mov esi,group
mcall
int 0x40
mov [status],3
call clear_text
call save_coordinates
320,7 → 320,7
mov ecx,[socket]
mov edx,[statlen] ; -stat
mov esi,stat
mcall
int 0x40
mov [status],5
call save_coordinates
ret
333,7 → 333,7
mov ecx,[socket]
mov edx,articlelen-article
mov esi,article
mcall
int 0x40
mov [status],7
call save_coordinates
ret
485,7 → 485,7
 
mov eax,5
mov ebx,10
mcall
int 0x40
 
call check_for_incoming_data
 
499,7 → 499,7
 
mov eax,40
mov ebx,10000111b
mcall
int 0x40
 
call clear_text
 
512,7 → 512,7
 
mov eax,23 ; wait here for event
mov ebx,5
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
je red
533,7 → 533,7
 
key: ; key
mov eax,2 ; just read it and ignore
mcall
int 0x40
 
cmp ah,' '
jne no_space
581,7 → 581,7
 
button: ; button
mov eax,17 ; get id
mcall
int 0x40
 
shr eax,8
 
628,7 → 628,7
jne no_start
call clear_text
mov eax,3
mcall
int 0x40
mov ecx,eax
mov eax,53
mov ebx,5
635,7 → 635,7
mov edx,119
mov esi,dword [server_ip]
mov edi,1
mcall
int 0x40
mov [socket],eax
mov [status],1
jmp still
648,22 → 648,22
mov ecx,[socket]
mov edx,quitlen-quit
mov esi,quit
mcall
int 0x40
mov eax,5
mov ebx,10
mcall
int 0x40
call check_for_incoming_data
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
mov eax,5
mov ebx,5
mcall
int 0x40
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
int 0x40
mov [status],0
jmp still
no_end:
671,7 → 671,7
cmp eax,1 ; button id=1 ?
jne noclose
mov eax,-1 ; close this program
mcall
int 0x40
noclose:
 
jmp still
687,7 → 687,7
mov eax,53
mov ebx,2
mov ecx,[socket]
mcall
int 0x40
 
cmp eax,0
je ch_ret
695,7 → 695,7
mov eax,53
mov ebx,3
mov ecx,[socket]
mcall
int 0x40
 
and ebx,0xff
 
728,7 → 728,7
mov eax,53
mov ebx,2
mov ecx,[socket]
mcall
int 0x40
 
cmp eax,0
jne check_for_incoming_data
754,25 → 754,35
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
 
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+520 ; [x start] *65536 + [x size]
mov ecx,5*65536+470 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB,8->color gl
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl
mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl
mov edi,0x005080d0 ; color of frames RRGGBB
int 0x40
 
mov eax,38
mov ebx,5*65536+515
mov ecx,101*65536+101
mov edx,0x99bbff
mcall
int 0x40
mov eax,38
mov ebx,5*65536+515
mov ecx,102*65536+102
mov edx,0x3366aa
mcall
int 0x40
 
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x10ddeeff ; font 1 & color ( 0xF0RRGGBB )
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
 
mov eax,8
mov ebx,238*65536+8
779,21 → 789,28
mov ecx,30*65536+8
mov edx,11
mov esi,0x88aadd
mcall
int 0x40
mov eax,8
mov ebx,238*65536+8
mov ecx,41*65536+8
mov edx,12
mcall
int 0x40
mov eax,8
mov ebx,238*65536+8
mov ecx,52*65536+8
mov edx,13
mcall
int 0x40
 
mov eax,8
mov ebx,265*65536+75
mov ecx,39*65536+13
mov edx,14
mcall
int 0x40
mov eax,8
mov ebx,351*65536+75
mov ecx,39*65536+13
mov edx,15
mcall
int 0x40
 
call draw_entries
 
801,7 → 818,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
 
popa
 
816,16 → 833,18
mov ebx,30*65536+200
mov ecx,30*65536+44
mov edx,0xffffff
mcall
int 0x40
 
mov eax,4
mov ebx,30*65536+31 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,66
mov edi,6
 
newline2:
mcall
 
mov eax,4
int 0x40
add ebx,11
add edx,66
dec edi
843,7 → 862,7
mov eax,9
mov ebx,0x70000
mov ecx,-1
mcall
int 0x40
 
mov eax,[0x70000+46]
cmp eax,150
857,7 → 876,7
dec edi
 
mov [space],edi
mov eax,4
 
mov ebx,20*65536+111 ; draw info text with function 4
mov ecx,0x000000
mov edx,[text_start]
864,8 → 883,8
imul edx,80
add edx,nntp_text
mov esi,80
newline:
newline:
pusha
mov ecx,ebx
shl ecx,16
873,10 → 892,11
mov ebx,20*65536+80*6
mov cx,10
mov edx,0xffffff
mcall
int 0x40
popa
 
mcall
mov eax,4
int 0x40
add ebx,10
add edx,80
dec edi
902,7 → 922,9
textl:
 
 
title db 'NNTP client v',version,0
labelt:
db 'NNTP client v',version
labellen:
 
nntp_text:
 
/programs/network/ppp/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm ppp.asm ppp
@erase lang.inc
@pause
/programs/network/ppp/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm ppp.asm ppp
@erase lang.inc
@pause
/programs/network/ppp/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/ppp/trunk/ppp.asm
60,18 → 60,20
 
 
use32
 
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd STARTAPP ; entry point
dd I_END ; image size
dd I_END+0x10000 ; required memory
dd I_END+0x10000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
 
db 'MENUET00' ; 8 byte id
dd 38 ; required os
dd STARTAPP ; program start
dd I_END ; program image size
dd 0x100000 ; required amount of memory
; esp = 0x7FFF0
dd 0x00000000 ; reserved=no extended header
 
 
include "lang.inc"
include "..\..\..\macros.inc"
include "macros.inc"
include "chat.inc" ; Hosts modem chatting routine
 
 
85,7 → 87,7
 
mov eax, 52 ; Stack Interface
mov ebx, 0 ; read configuration word
mcall
int 0x40
mov ecx, eax
shr ecx, 16 ; get the port address
mov [comport], ecx
107,13 → 109,13
mov al, [welcomep_len]
mov [prompt_len], al
 
red:
call draw_window ; at first, draw the window
 
 
apploop:
mov eax, 23 ; wait here for event
mov ebx, 20
mcall
int 0x40
 
cmp eax, 1 ; redraw request ?
je red
127,14 → 129,18
je flush_input ; Dont want serial data yet
jmp apploop
 
red: ; redraw
call draw_window
jmp apploop
 
key: ; key - ignore
mov eax, 2 ; just read it
mcall
int 0x40
jmp apploop
 
button: ; button
mov eax, 17 ; get id
mcall
int 0x40
 
cmp ah, 1 ; close program ?
jne noclose
146,8 → 152,8
 
call disable_port
 
or eax, -1 ; close this program
mcall
mov eax, -1 ; close this program
int 0x40
jmp apploop
 
noclose:
167,10 → 173,10
flush_input:
mov eax,42
mov ebx, [comirq]
mcall
int 0x40
 
mov eax,11 ; This will return 0 most of the time
mcall
int 0x40
mov ebx, [comirq]
add ebx, 16
cmp eax, ebx
194,7 → 200,7
 
mov eax, 23
mov ebx, 100
mcall ; wait for 1s to display message
int 0x40 ; wait for 1s to display message
 
call PPPStateMachine ; This is the main code
 
219,12 → 225,12
PPPLoop:
 
mov eax, 11 ; check event
mcall
int 0x40
cmp eax, 3
jne PPPLred
; button pressed
mov eax, 17 ; get id
mcall
int 0x40
 
 
mov eax, hangp
240,7 → 246,7
 
call disable_port
mov eax, -1 ; close this program
mcall
int 0x40
jmp PPPLoop
 
PPPLred:
261,7 → 267,7
 
mov eax, 42
mov ebx, [comirq] ; ecx will return 0 =data read, 1 =no data
mcall ; or 2 =not irq owner
int 0x40 ; or 2 =not irq owner
 
inc dword [rxbytes]
 
420,7 → 426,7
mov eax,43
mov ecx, [comport]
add ecx, 0x80000000 + 5
mcall
int 0x40
and bl, 0x40
cmp bl, 0
jz wait_txd2 ; loop until free
434,7 → 440,7
 
mov ecx, [comport]
mov eax, 43
mcall
int 0x40
 
ppp_003:
mov eax, [packet]
692,7 → 698,7
mov cl, [addr2]
shl ecx, 8
mov cl, [addr1]
mcall ; Set the stacks IP address
int 0x40 ; Set the stacks IP address
 
popa
 
729,7 → 735,7
mov ebx, 6
mov edx, 1500 ; this should be exact amount
mov esi, rx_str + 4
mcall
int 0x40
 
; Debugging output to debug board
pusha
877,7 → 883,7
; 10ms Delay suggested by Ville
mov eax,23 ; over here
mov ebx,1
mcall
int 0x40
 
 
 
896,7 → 902,7
mov eax, 52
mov ebx, 8
mov esi, ip_buff
mcall
int 0x40
 
cmp eax, 0
je ppp_013
1219,13 → 1225,13
and ecx, 0xFF0
mov edx, ecx
or edx, 0x00F
mcall
int 0x40
end if
 
mov eax, 45 ; free irq 4
mov ebx, 1
mov ecx, [comirq]
mcall
int 0x40
 
mov eax, 46 ; free port area
mov ebx, 1
1234,7 → 1240,7
and ecx, 0xFF0
mov edx, ecx
or edx, 0x00F
mcall
int 0x40
ret
 
 
1257,12 → 1263,12
and ecx, 0xFF0
mov edx, ecx
or edx, 0x00F
mcall ; reseve port memory to this process
int 0x40 ; reseve port memory to this process
 
mov eax, 45 ; reserve irq 3
mov ebx, 0
mov ecx, 3
mcall
int 0x40
 
 
mov ecx, 0x2f8 ; data format register
1269,24 → 1275,24
add ecx, 3
mov bl, 0x80 ; enable access to divisor latch
mov eax, 43 ; send data to device - com port setup
mcall
int 0x40
 
mov ecx, 0x2f8 ; interrupt enable register
inc ecx
mov bl, 0 ; No interruts enabled
mov eax, 43 ; send data to device (modem)
mcall
int 0x40
 
mov ecx, 0x2f8 ; Divisor latch LSB
mov bl, BAUDRATE ; set baud rate
mov eax, 43 ; send data to device (modem)
mcall
int 0x40
 
mov ecx, 0x2f8 ; Data format register
add ecx, 3
mov bl, 3 ; 8 data bits
mov eax, 43 ; send data to device (modem)
mcall
int 0x40
 
mov ecx, 0x2f8 ; Modem control register
add ecx, 4 ; ** bl must be 0x0b for modem to dial!
1293,13 → 1299,13
mov bl, 0x0b ; 0x08 -> out2 enabled. No handshaking.
; 0xb -> out2 enabled, RTS/DTR enabled
mov eax, 43 ; send data to device (modem)
mcall
int 0x40
 
; mov ecx, 0x2f8 ; interrupt enable register
; inc ecx
; mov bl, 1 ; rx data interrupt enabled, othrs not
; mov eax, 43 ; send data to device (modem)
; mcall
; int 0x40
 
end if
 
1309,40 → 1315,40
and ecx, 0xFF0
mov edx, ecx
or edx, 0x00F
mcall ; reseve port memory to this process
int 0x40 ; reseve port memory to this process
 
mov eax, 45 ; reserve irq 4
mov ebx, 0
mov ecx, [comirq]
mcall
int 0x40
 
mov eax, 44 ; setup irq table
mov ebx, irqtable
mov ecx, [comirq]
mcall
int 0x40
 
mov ecx, [comport] ; data format register
add ecx, 3
mov bl, 0x80 ; enable access to divisor latch
mov eax, 43 ; send data to device - com port setup
mcall
int 0x40
 
mov ecx, [comport] ; interrupt enable register
inc ecx
mov bl, 0 ; No interruts enabled
mov eax, 43 ; send data to device (modem)
mcall
int 0x40
 
mov ecx, [comport] ; Divisor latch LSB
mov bl, BAUDRATE ; set baud rate
mov eax, 43 ; send data to device (modem)
mcall
int 0x40
 
mov ecx, [comport] ; Data format register
add ecx, 3
mov bl, 3 ; 8 data bits
mov eax, 43 ; send data to device (modem)
mcall
int 0x40
 
mov ecx, [comport] ; Modem control register
add ecx, 4 ; ** bl must be 0x0b for modem to dial!
1349,13 → 1355,13
mov bl, 0x0b ; 0x08 -> out2 enabled. No handshaking.
; 0xb -> out2 enabled, RTS/DTR enabled
mov eax, 43 ; send data to device (modem)
mcall
int 0x40
 
mov ecx, [comport] ; interrupt enable register
inc ecx
mov bl, 1 ; rx data interrupt enabled, othrs not
mov eax, 43 ; send data to device (modem)
mcall
int 0x40
 
mov ecx, [comirq]
add ecx, 16
1363,7 → 1369,7
shl ebx, cl
add ebx, 111b
mov eax,40 ; enable irq 4 data
mcall
int 0x40
 
popa
ret
1380,15 → 1386,22
draw_window:
mov eax, 12 ; function 12:tell os about windowdraw
mov ebx, 1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax, 0 ; function 0 : define and draw window
mov ebx, 100*65536+250 ; [x start] *65536 + [x size]
mov ecx, 100*65536+150 ; [y start] *65536 + [y size]
mov edx,0x13224466 ; color of work area RRGGBB
mov edi,title ; color of frames RRGGBB
mcall
 
mov edx,0x03224466 ; color of work area RRGGBB
mov esi,0x00334455 ; color of grab bar RRGGBB
mov edi,0x00ddeeff ; color of frames RRGGBB
int 0x40
; WINDOW LABEL
mov eax, 4 ; function 4 : write text to window
mov ebx, 8*65536+8 ; [x start] *65536 + [y start]
mov ecx, 0x00ffffff ; color of text RRGGBB
mov edx, labelt ; pointer to text beginning
mov esi, labellen-labelt ; text length
int 0x40
; DIAL BUTTON
mov eax, 8 ; function 8 : define and draw button
mov ebx, (50)*65536+40 ; [x start] *65536 + [x size]
1395,7 → 1408,7
mov ecx, 130*65536+12 ; [y start] *65536 + [y size]
mov edx, 2 ; button id
mov esi, 0x5599cc ; button color RRGGBB
mcall
int 0x40
 
mov ebx, 55*65536+133 ; Draw button text
mov ecx, 0x00FFFFFF
1404,7 → 1417,7
mov al, [button1_text_len]
mov esi, eax
mov eax, 4
mcall
int 0x40
; DISCONNECT BUTTON
mov eax, 8 ; function 8 : define and draw button
mov ebx, (150)*65536+65 ; [x start] *65536 + [x size]
1411,7 → 1424,7
mov ecx, 130*65536+12 ; [y start] *65536 + [y size]
mov edx, 3 ; button id
mov esi, 0x5599cc ; button color RRGGBB
mcall
int 0x40
 
mov ebx, 155*65536+133 ; Draw button text
mov ecx, 0x00FFFFFF
1420,7 → 1433,7
mov al, [button3_text_len]
mov esi, eax
mov eax, 4
mcall
int 0x40
 
mov ebx, 5*65536+40 ; draw info text with function 4
mov ecx, 0x00FFFFFF
1429,7 → 1442,7
mov al, [prompt_len]
mov esi, eax
mov eax, 4
mcall
int 0x40
 
; Draw IP address
mov edx, 10*65536+60
1437,25 → 1450,25
mov ebx, 0x00030000
movzx ecx, byte [addr1]
mov eax, 47
mcall
int 0x40
mov edx, 31*65536+60
mov esi, 0x00FFFFFF
mov ebx, 0x00030000
movzx ecx, byte [addr2]
mov eax, 47
mcall
int 0x40
mov edx, 52*65536+60
mov esi, 0x00FFFFFF
mov ebx, 0x00030000
movzx ecx, byte [addr3]
mov eax, 47
mcall
int 0x40
mov edx, 73*65536+60
mov esi, 0x00FFFFFF
mov ebx, 0x00030000
movzx ecx, byte [addr4]
mov eax, 47
mcall
int 0x40
 
; Status byte
mov edx, 100*65536+60
1463,7 → 1476,7
mov ebx, 0x00010000
movzx ecx, byte [state]
mov eax, 47
mcall
int 0x40
 
; bytes sent / received
mov eax, 4 ; function 4 : write text to window
1471,7 → 1484,7
mov ecx, 0x00ffffff ; color of text RRGGBB
mov edx, txmsg ; pointer to text beginning
mov esi, txmsglen-txmsg ; text length
mcall
int 0x40
 
mov eax, 4 ; function 4 : write text to window
mov ebx, 10*65536+100 ; [x start] *65536 + [y start]
1478,13 → 1491,13
mov ecx, 0x00ffffff ; color of text RRGGBB
mov edx, rxmsg ; pointer to text beginning
mov esi, rxmsglen-rxmsg ; text length
mcall
int 0x40
 
call draw_window_limited
 
mov eax, 12 ; end of redraw
mov ebx, 2
mcall
int 0x40
 
ret
 
1495,9 → 1508,12
mov ebx,80*65536+10*6
mov ecx,80*65536+10
mov edx,0x03224466
mcall
int 0x40
mov eax,13
mov ebx,80*65536+10*6
mov ecx,100*65536+10
mcall
mov edx,0x03224466
int 0x40
 
mov ebx, 0x000A0000
mov ecx, [txbytes]
1504,7 → 1520,7
mov esi, 0x00ffffff ; color of text RRGGBB
mov eax, 47 ; function 47 : write number to window
mov edx, 80*65536+80 ; [x start] *65536 + [y start]
mcall
int 0x40
 
mov ebx, 0x000A0000
mov ecx, [rxbytes]
1511,7 → 1527,7
mov esi, 0x00ffffff ; color of text RRGGBB
mov eax, 47 ; function 47 : write number to window
mov edx, 80*65536+100 ; [x start] *65536 + [y start]
mcall
int 0x40
ret
 
 
1529,7 → 1545,7
push eax
mov eax, 26
mov ebx, 9
mcall ; get 100th second counter
int 0x40 ; get 100th second counter
pop ebx
sub eax, ebx ; This could have some funny side effecs if PPP
; called within ebx seconds of startup
1550,7 → 1566,7
gettimer:
mov eax, 26
mov ebx, 9
mcall ; get 100th second counter
int 0x40 ; get 100th second counter
 
sub eax, [timerValue]
ret
1608,7 → 1624,7
; any data from modem?
 
mov eax,11 ; This will return 0 most of the time
mcall
int 0x40
mov ecx, eax
pop edx
pop eax
1644,7 → 1660,7
push eax
mov eax,42
mov ebx, [comirq]
mcall
int 0x40
pop eax
pop edx
 
1769,7 → 1785,7
push edi
mov eax, 5
mov ebx, 1
mcall ; 10ms delay
int 0x40 ; 10ms delay
pop edi
 
; send the character
1780,7 → 1796,7
inc eax
push eax
mov eax, 43
mcall
int 0x40
 
pop eax
pop edx
1865,7 → 1881,7
wait_txd2t:
mov eax,43
mov ecx,0x80000000 + 0x2f8 + 5
mcall
int 0x40
and bl, 0x40
cmp bl, 0
jz wait_txd2t ; loop until free
1877,7 → 1893,7
 
mov ecx, 0x2f8
mov eax, 43
mcall
int 0x40
ret
 
 
1908,7 → 1924,7
mov eax,63
mov ebx, 1
push esi
mcall
int 0x40
pop esi
inc esi
jmp debug_print_string
2143,7 → 2159,8
prompt_len db 0
 
; Application Title
title db 'PPP Dialer',0
labelt db 'PPP Dialer'
labellen:
 
txmsg: db 'Tx bytes :'
txmsglen:
/programs/network/remote/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm remote.asm remote
@erase lang.inc
@pause
/programs/network/remote/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm remote.asm remote
@erase lang.inc
@pause
/programs/network/remote/trunk/macros.inc
0,0 → 1,266
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/network/remote/trunk/remote.asm
6,17 → 6,18
use32
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd START ; entry point
dd I_END ; image size
dd I_END+0x10000 ; required memory
dd I_END+0x10000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
db 'MENUET00' ; 8 byte id
dd 38 ; required os
dd START ; program start
dd I_END ; program image size
dd 0x100000 ; required amount of memory
dd 0x00000000 ; reserved=no extended header
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
remote_ip db 192,168,1,26
27,11 → 28,10
mov ecx, 0x3000 ; local port
mov edx, 0xffff ; remote port
mov esi, dword [remote_ip] ; remote IP
mcall
int 0x40
mov [socketNum],eax
mov [0],eax ; save for remote code
 
red:
call draw_window ; at first, draw the window
still:
38,7 → 38,7
mov eax,23 ; wait here for event
mov ebx,1
mcall
int 0x40
cmp eax,1 ; redraw request ?
jz red
50,7 → 50,7
mov eax,53 ; data from cluster terminal ?
mov ebx,2
mov ecx,[socketNum]
mcall
int 0x40
cmp eax,0
jne data_arrived
57,9 → 57,13
jmp still
red:
call draw_window
jmp still
key:
mov eax,2
mcall
int 0x40
jmp still
button:
67,9 → 71,9
mov eax,53
mov ebx,1
mov ecx,[socketNum]
mcall
or eax,-1
mcall
int 0x40
mov eax,-1
int 0x40
data_arrived:
76,7 → 80,7
mov eax,5 ; wait a second for everything to arrive
mov ebx,10
mcall
int 0x40
mov edi,I_END
85,7 → 89,7
mov eax,53
mov ebx,3
mov ecx,[socketNum]
mcall
int 0x40
mov [edi],bl
inc edi
93,7 → 97,7
mov eax,53
mov ebx,2
mov ecx,[socketNum]
mcall
int 0x40
cmp eax,0
jne get_data
106,7 → 110,7
mov ecx,0x000000
mov edx,I_END
mov esi,23
mcall
int 0x40
add [y],10
142,26 → 146,41
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+286 ; [x start] *65536 + [x size]
mov ecx,100*65536+330 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov edx,0x03ffffff ; color of work area RRGGBB
mov esi,0x80aabbcc ; color of grab bar RRGGBB,8->color gl
mov edi,0x00aabbcc ; color of frames RRGGBB
int 0x40
mov eax,8
mov ebx,(286-19)*65536+12
mov ecx,4*65536+12
mov edx,1
mov esi,0xaabbcc
; int 0x40
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x00ffffff ; color of text RRGGBB
mov edx,labeltext ; pointer to text beginning
mov esi,lte-labeltext ; text length
int 0x40
; Re-draw the screen text
cld
mov eax,4
mov ebx,10*65536+30 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
mov eax,4
int 0x40
add ebx,16
add edx,40
cmp [edx],byte 'x'
170,7 → 189,7
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
ret
181,10 → 200,11
text:
db 'THIS NODE : 192.168.1.22 '
db 'LISTENING TO PORT : 0x3000 '
db 'x' ;<- END MARKER, DONT DELETE
db 'x <- END MARKER, DONT DELETE '
title db 'CLUSTER REMOTE',0
labeltext: db 'CLUSTER REMOTE'
lte:
socketNum dd 0x0
198,6 → 218,7
db 2 ; 14 execute
dd 0x0 ; 15 position
; 19
I_END: