Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 485 → Rev 484

/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