/programs/network/VNCclient/ETH.INC |
---|
12,7 → 12,6 |
; v1.1: december 2006 bugfixes and improvements |
; |
macro mov arg1,arg2 { |
if arg1 eq arg2 |
else |
43,7 → 42,7 |
macro eth.get_IP IP { |
mov ebx,1 |
mov eax,52 |
int 0x40 |
mcall |
mov IP ,eax |
} |
54,7 → 53,7 |
macro eth.get_GATEWAY GATEWAY { |
mov ebx,9 |
mov eax,52 |
int 0x40 |
mcall |
move GATEWAY ,eax |
} |
64,7 → 63,7 |
macro eth.get_SUBNET SUBNET { |
mov ebx,10 |
mov eax,52 |
int 0x40 |
mcall |
mov SUBNET ,eax |
} |
74,7 → 73,7 |
macro eth.get_DNS DNS { |
mov ebx,13 |
mov eax,52 |
int 0x40 |
mcall |
mov DNS ,eax |
} |
85,7 → 84,7 |
mov ecx,IP |
mov ebx,3 |
mov eax,52 |
int 0x40 |
mcall |
} |
; eth.set_GATEWAY eax |
95,7 → 94,7 |
mov ecx,GATEWAY |
mov ebx,11 |
mov eax,52 |
int 0x40 |
mcall |
} |
; eth.set_SUBNET eax |
105,7 → 104,7 |
mov ecx,SUBNET |
mov ebx,12 |
mov eax,52 |
int 0x40 |
mcall |
} |
; eth.set_DNS eax |
115,7 → 114,7 |
mov ecx,DNS |
mov ebx,14 |
mov eax,52 |
int 0x40 |
mcall |
} |
; eth.open eax,80,ebx,[socket] |
128,7 → 127,7 |
mov esi, ip |
mov ebx, 0 |
mov eax, 53 |
int 0x40 |
mcall |
mov socket,eax |
} |
140,7 → 139,7 |
mov ecx, socket |
mov ebx, 1 |
mov eax, 53 |
int 0x40 |
mcall |
} |
; eth.poll [socket],eax |
151,7 → 150,7 |
mov ecx, socket |
mov ebx, 2 |
mov eax, 53 |
int 0x40 |
mcall |
} |
; eth.read_byte [socket], bl |
161,7 → 160,7 |
mov ecx, socket |
mov ebx, 3 |
mov eax, 53 |
int 0x40 |
mcall |
mov result,bl |
} |
174,7 → 173,7 |
mov ecx, socket |
mov ebx, 10 |
mov eax, 53 |
int 0x40 |
mcall |
} |
; eth.write [socket],12,msg |
187,7 → 186,7 |
mov esi, msg |
mov ebx, 4 |
mov eax, 53 |
int 0x40 |
mcall |
if verify eq 1 |
call verifysend |
203,9 → 202,10 |
pusha |
mov eax,5 |
mov ebx,100 |
int 0x40 |
mcall |
popa |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov socket,eax |
} |
232,7 → 232,7 |
mov ecx, socket |
mov ebx, 6 |
mov eax, 53 |
int 0x40 |
mcall |
mov result,eax |
} |
248,7 → 248,7 |
mov esi, msg |
mov ebx, 7 |
mov eax, 53 |
int 0x40 |
mcall |
if verify eq 1 |
call verifysend |
262,7 → 262,7 |
mov ecx, socket |
mov ebx, 8 |
mov eax, 53 |
int 0x40 |
mcall |
} |
; eth.check_port 165,eax |
273,7 → 273,7 |
mov ecx, port |
mov ebx, 9 |
mov eax, 53 |
int 0x40 |
mcall |
mov result,eax |
} |
285,7 → 285,7 |
mov ebx, 255 |
mov ecx, 6 |
mov eax, 53 |
int 0x40 |
mcall |
mov status,eax |
} |
340,7 → 340,7 |
.loop: |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
eth.poll socket |
376,7 → 376,7 |
mov eax,5 ; wait here for event |
mov ebx,10 |
int 0x40 |
mcall |
jmp @r |
@@: |
/programs/network/VNCclient/VNCclient.asm |
---|
32,6 → 32,7 |
TIMEOUT = 60 ; timeout in seconds |
BUFFER = 1500 ; Buffer size for DNS |
include '..\..\macros.inc' |
include 'fdo.inc' |
include 'ETH.INC' |
include 'logon.inc' |
39,7 → 40,6 |
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 |
int 0x40 |
mcall |
mov eax,67 ; resize the window (hide it) |
xor ebx,ebx |
53,13 → 53,13 |
mov ecx,ebx |
mov edx,ebx |
mov esi,ebx |
int 0x40 |
mcall |
mov eax,51 |
mov ebx,1 |
mov ecx,thread_start |
mov edx,thread_stack |
int 0x40 |
mcall |
DEBUGF 1,'Thread created: %u\n',eax |
66,7 → 66,7 |
@@: |
mov eax,5 |
mov ebx,10 |
int 0x40 |
mcall |
cmp byte[thread_ready],0 |
je @r |
73,7 → 73,7 |
mov eax,40 ; report events |
mov ebx,100111b ; mouse, button, key, redraw |
int 0x40 |
mcall |
mov eax,67 ; resize the window |
mov ebx,10 |
84,7 → 84,7 |
shr edx,16 |
add edx,2*xpos |
add esi,ypos+xpos |
int 0x40 |
mcall |
mainloop: |
eth.socket_status [socket],eax |
93,7 → 93,7 |
mov eax,23 ; wait for event with timeout |
mov ebx,50 ; 0,5 s |
int 0x40 |
mcall |
cmp eax,1 |
je redraw |
112,7 → 112,7 |
DEBUGF 1,'Sending key event\n' |
mov eax,2 |
int 0x40 |
mcall |
mov byte[keyevent.key+3],ah |
eth.write_tcp [socket],8,keyevent |
124,7 → 124,7 |
mov eax,37 |
mov ebx,1 |
int 0x40 |
mcall |
sub eax,xpos*65536+ypos |
bswap eax |
134,7 → 134,7 |
mov eax,37 |
mov ebx,2 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov eax,0 ; draw window |
mov ebx,dword[framebuffer] |
163,9 → 163,7 |
add ebx,2*xpos |
add ecx,ypos+xpos |
mov edx,0x03ffffff |
mov esi,0x80555599 |
mov edi,0x00ffffff |
int 0x40 |
mcall |
mov eax,4 ; label |
mov ebx,9*65536+8 |
173,13 → 171,13 |
mov edx,name |
mov esi,[name_length] |
bswap esi |
int 0x40 |
mcall |
call drawbuffer |
mov eax,12 |
mov ebx,2 |
int 0x40 |
mcall |
jmp mainloop |
189,7 → 187,7 |
mov ebx,framebuffer_data |
mov ecx,dword[screen] |
mov edx,xpos*65536+ypos |
int 0x40 |
mcall |
ret |
196,7 → 194,7 |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
close: |
call read_data |
204,7 → 202,7 |
DEBUGF 1,'Socket closed\n' |
mov eax,-1 |
int 0x40 |
mcall |
no_rfb: |
DEBUGF 1,'This is no vnc server!\n' |
/programs/network/VNCclient/build.bat |
---|
0,0 → 1,2 |
@fasm VNCclient.asm VNCclient |
@pause |
/programs/network/VNCclient/fdo.inc |
---|
152,7 → 152,7 |
mov cl,al |
mov ebx,1 |
mov eax,63 |
int 0x40 |
mcall |
popad |
ret |
debug_endf |
164,7 → 164,7 |
.l1: mov cl,[edx] |
or cl,cl |
jz .l2 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
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 |
int 0x40 ; just read it and ignore |
mcall ; 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 |
int 0x40 |
mcall |
cmp ah,1 ; close ? |
jz close_logon |
66,10 → 66,10 |
.waitev_logon: |
mov eax,10 ; wait for event |
int 0x40 |
mcall |
cmp eax,2 ; button presed ? |
jne checkevent_logon ; a key is pressed or redraw is nessesary, goto checkevent |
int 0x40 ; eax = 2, read button |
mcall ; 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 |
int 0x40 |
mcall |
cmp byte[mode],0 |
je @f |
133,7 → 133,7 |
mov ecx, 49*65536+12 |
inc edx |
int 0x40 |
mcall |
@@: |
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 |
int 0x40 |
mcall |
cmp byte[mode],0 |
je dont_draw_pass |
156,7 → 156,7 |
dec edi |
mov edx, passchar |
mov esi, 1 |
int 0x40 |
mcall |
add ebx,6*65536 |
jmp @r |
166,8 → 166,8 |
ret |
close_logon: |
mov eax,-1 |
int 0x40 |
or eax,-1 |
mcall |
connect_logon: |
ret |
176,14 → 176,15 |
mov eax, 12 ; function 12_logon:tell os about windowdraw |
mov ebx, 1 ; 1, start of draw |
int 0x40 |
mcall |
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, 0x03DDDDDD ; color of work area RRGGBB |
int 0x40 |
mov edx, 0x13DDDDDD ; color of work area RRGGBB |
mov edi, title ; WINDOW LABEL |
mcall |
mov eax, 8 ; LOGON BUTTON |
mov ebx, 220*65536+85 |
190,30 → 191,24 |
mov ecx, 63*65536+16 |
mov edx, 2 |
mov esi, 0xCCCCCC |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
add bl,16 |
mov edx, passstr ; pointer to text beginning |
mov esi, connect-passstr ; text length |
int 0x40 |
mcall |
jmp drawtherest_ |
223,7 → 218,7 |
xor ecx, ecx |
mov edx, serverstr ; pointer to text beginning |
mov esi, userstr-serverstr ; text length |
int 0x40 |
mcall |
drawtherest_: |
230,18 → 225,17 |
mov ebx, 240*65536+67 ; [x start] *65536 + [y start] |
mov edx, connect ; pointer to text beginning |
mov esi, connect_e-connect ; text length |
int 0x40 |
mcall |
popa |
inc ebx |
int 0x40 |
mcall |
ret |
; DATA AREA |
labelt: db 'Kolibrios VNC client by HIDNPLAYR' |
labellen: |
title db 'Kolibrios VNC client by HIDNPLAYR',0 |
first: db '192.168.1.5' |
rb STRLEN |
/programs/network/VNCclient/thread.inc |
---|
3,7 → 3,7 |
mov eax,40 ; Report events |
mov ebx,10000000b ; Only Stack |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
jmp thread_loop |
/programs/network/airc/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/airc/trunk/airc.asm |
---|
9,8 → 9,12 |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
version equ '0.4' |
version equ '0.5' |
;__DEBUG__ equ 1 |
;__DEBUG_LEVEL__ equ 1 |
use32 |
org 0x0 |
23,8 → 27,10 |
dd 0x100000 |
dd 0,0 |
include "lang.inc" |
;include "macros.inc" |
include "..\..\..\macros.inc" |
;include "fdo.inc" |
include "eth.inc" |
;include "lang.inc" |
irc_server_ip db 83,149,74,246 ;server: kolibrios.org |
39,7 → 45,7 |
mov eax,40 |
mov ebx,10000111b |
int 0x40 |
mcall |
mov edi,I_END |
mov ecx,60*120 |
61,10 → 67,10 |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
mov eax,11 ; wait here for event |
int 0x40 |
mcall |
call print_status |
105,12 → 111,12 |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; close program |
jne noclose |
mov eax,-1 |
int 0x40 |
mcall |
noclose: |
call socket_commands |
125,7 → 131,7 |
mov eax,53 |
mov ebx,6 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [status],eax |
140,7 → 146,7 |
mov ebx,450*65536+30 |
mov ecx,231*65536+10 |
mov edx,0xffffff |
int 0x40 |
mcall |
pop ecx |
mov eax,47 |
147,7 → 153,7 |
mov ebx,2*65536 |
mov edx,450*65536+231 |
mov esi,0x000000 |
int 0x40 |
mcall |
nopr: |
164,7 → 170,7 |
cmp ah,22 ; open socket |
jnz tst3 |
mov eax,3 |
int 0x40 |
mcall |
mov ecx,eax |
mov eax,53 |
mov ebx,5 |
171,7 → 177,7 |
mov edx,6667 |
mov esi,dword [irc_server_ip] |
mov edi,1 |
int 0x40 |
mcall |
mov [socket], eax |
ret |
tst3: |
185,7 → 191,7 |
mov ecx,[socket] |
mov edx,string0l-string0 |
mov esi,string0 |
int 0x40 |
mcall |
mov eax,53 ; |
mov ebx,7 |
192,7 → 198,7 |
mov ecx,[socket] |
mov edx,[user_real_name] |
mov esi,user_real_name+4 |
int 0x40 |
mcall |
mov eax,53 ; |
mov ebx,7 |
199,12 → 205,12 |
mov ecx,[socket] |
mov edx,2 |
mov esi,line_feed |
int 0x40 |
mcall |
mov eax,5 |
mov ebx,10 |
int 0x40 |
mcall |
mov eax,53 ; nick |
mov ebx,7 |
211,7 → 217,7 |
mov ecx,[socket] |
mov edx,string1l-string1 |
mov esi,string1 |
int 0x40 |
mcall |
mov eax,53 ; |
mov ebx,7 |
218,7 → 224,7 |
mov ecx,[socket] |
mov edx,[user_nick] |
mov esi,user_nick+4 |
int 0x40 |
mcall |
mov eax,53 ; |
mov ebx,7 |
225,7 → 231,7 |
mov ecx,[socket] |
mov edx,2 |
mov esi,line_feed |
int 0x40 |
mcall |
ret |
240,7 → 246,7 |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
ret |
no_24: |
251,7 → 257,7 |
main_window_key: |
mov eax,2 |
int 0x40 |
mcall |
shr eax,8 |
298,7 → 304,7 |
mov ebx,415*65536+6*13 |
mov ecx,27*65536+12*10 |
mov edx,0xffffff |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,415*65536+27 |
307,7 → 313,7 |
newch: |
movzx esi,byte [edx+31] |
and esi,0x1f |
int 0x40 |
mcall |
add edx,32 |
add ebx,12 |
cmp edx,channel_list+32*10 |
374,7 → 380,7 |
mov ebx,415*65536+6*13 |
mov ecx,27*65536+12*10 |
mov edx,0xffffff |
int 0x40 |
mcall |
popa |
mov eax,4 |
398,7 → 404,7 |
mov ecx,[index_list_2] |
no_op: |
int 0x40 |
mcall |
inc ebp |
cmp ebp,10 |
509,7 → 515,7 |
mov eax, 53 ; write channel |
mov ebx, 7 |
mov ecx, [socket] |
int 0x40 |
mcall |
mov esi,send_string |
mov edx,[xpos] |
520,7 → 526,7 |
mov eax, 53 ; write message |
mov ebx, 7 |
mov ecx, [socket] |
int 0x40 |
mcall |
jmp send_done |
602,33 → 608,41 |
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 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: |
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] |
popa |
mov ecx,[xpos] |
715,7 → 729,7 |
mov eax, 53 ; write server command |
mov ebx, 7 |
mov ecx, [socket] |
int 0x40 |
mcall |
send_done: |
726,12 → 740,12 |
jne no_quit_server |
mov eax,5 |
mov ebx,200 |
int 0x40 |
mcall |
mov eax, 53 ; close socket |
mov ebx, 8 |
mov ecx, [socket] |
int 0x40 |
mcall |
mov ecx,[max_windows] |
mov edi,I_END |
842,11 → 856,11 |
mov ebx,1 |
mov ecx,channel_thread |
mov edx,[thread_stack] |
int 0x40 |
mcall |
mov eax,5 |
mov ebx,10 |
int 0x40 |
mcall |
add [thread_stack],0x4000 |
add [thread_screen],120*80 |
864,7 → 878,7 |
mov ebx,8*65536+6*80 |
mov ecx,151*65536+13 |
mov edx,0xffffff |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,8*65536+154 |
871,7 → 885,7 |
mov ecx,0x000000 |
mov edx,send_string |
mov esi,[xpos] |
int 0x40 |
mcall |
popa |
886,7 → 900,7 |
mov eax,9 |
mov ebx,0xe0000 |
mov ecx,-1 |
int 0x40 |
mcall |
mov edx,[blink] |
and edx,1 |
907,7 → 921,7 |
mov bx,cx |
mov ecx,151*65536+163 |
mov eax,38 |
int 0x40 |
mcall |
popa |
919,7 → 933,7 |
mov ebx,8*65536+6*60 |
mov ecx,151*65536+13 |
mov edx,0xffffff |
int 0x40 |
mcall |
popa |
1072,7 → 1086,7 |
mov edx,command |
mov esi,[cmd] |
mov [command+esi-1],word '**' |
; int 0x40 |
; mcall |
mov eax,53 |
mov ebx,7 |
1081,7 → 1095,7 |
sub edx,2 |
and edx,255 |
mov esi,command |
int 0x40 |
mcall |
mov eax,53 |
mov ebx,7 |
1088,7 → 1102,7 |
mov ecx,[socket] |
mov edx,2 |
mov esi,linef |
int 0x40 |
mcall |
popa |
ret |
1655,6 → 1669,7 |
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 |
1665,8 → 1680,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 |
1790,7 → 1805,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socket] |
int 0x40 |
mcall |
mov ecx,-1 |
1800,7 → 1815,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socket] |
int 0x40 |
mcall |
cmp bl,0x80 |
jb @f |
1822,69 → 1837,55 |
mov eax,12 |
mov ebx,1 |
int 0x40 |
mcall |
mov [old_status],300 |
mov eax,0 ; draw window |
xor eax,eax ; draw window |
mov ebx,5*65536+499 |
mov ecx,5*65536+345 |
mov edx,[wcolor] |
add edx,0x03ffffff |
mov esi,0x80555599 |
mov edi,0x00ffffff |
int 0x40 |
add edx,0x13ffffff |
mov edi,title |
mcall |
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] |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov eax,38 ; line |
mov ebx,5*65536+494 |
mov ecx,148*65536+148 |
mov edx,[main_line] |
int 0x40 |
mcall |
add ecx,1*65536+1 |
; mov edx,0x5555cc |
; int 0x40 |
mov eax,38 ; line |
mov ebx,5*65536+494 |
mov ecx,166*65536+166 |
int 0x40 |
mcall |
add ecx,1*65536+1 |
; mov edx,0x5555cc |
; int 0x40 |
mov eax,38 ; line |
mov ebx,410*65536+410 |
mov ecx,22*65536+148 |
int 0x40 |
mcall |
add ebx,1*65536+1 |
; mov edx,0x5555cc |
; int 0x40 |
mov ebx,25*65536+183 ; info text |
mov ecx,0x000000 |
1892,7 → 1893,7 |
mov esi,70 |
newline: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,12 |
add edx,70 |
cmp [edx],byte 'x' |
1903,7 → 1904,7 |
mov eax,12 |
mov ebx,2 |
int 0x40 |
mcall |
popa |
1916,8 → 1917,8 |
text: |
db ' Real name : KolibriOS User - change with eg /areal Jill User ' |
db ' Nick : kolibri_user - change with eg /anick Jill ' |
db ' Server : 83.149.74.246 - change with eg /aserv 192.168.1.24 ' |
db ' Nick : KolibriOS User - change with eg /anick Jill ' |
db ' Server : kolibrios.org - change with eg /aserv irc.by ' |
db ' ' |
db ' 1) Open socket 2) Send userinfo Close socket ' |
db ' ' |
1974,7 → 1975,7 |
mov dword [channel_list+edi],dword ' ' |
mov byte [channel_list+edi+31],byte 1 |
mov eax,-1 |
int 0x40 |
mcall |
no_channel_leave: |
call check_mouse |
1981,7 → 1982,7 |
mov eax,23 |
mov ebx,1 |
int 0x40 |
mcall |
cmp eax,1 |
jne no_draw_window |
1996,7 → 1997,7 |
cmp eax,3 |
jne no_end |
mov eax,17 |
int 0x40 |
mcall |
mov eax,ebp |
imul eax,120*80 |
add eax,I_END |
2008,7 → 2009,7 |
mov [eax],dword ' ' |
mov [eax+31],byte 1 |
mov eax,-1 |
int 0x40 |
mcall |
not_close: |
mov [text_start],eax |
mov eax,nocl |
2047,7 → 2048,7 |
mov eax,37 |
mov ebx,1 |
int 0x40 |
mcall |
mov ebx,eax |
shr eax,16 |
2073,7 → 2074,7 |
call print_user_list |
mov eax,5 |
mov ebx,8 |
int 0x40 |
mcall |
jmp no_mouse |
no_plus: |
2088,7 → 2089,7 |
call print_user_list |
mov eax,5 |
mov ebx,8 |
int 0x40 |
mcall |
no_minus: |
2104,7 → 2105,7 |
thread_key: |
mov eax,2 |
int 0x40 |
mcall |
shr eax,8 |
2139,7 → 2140,7 |
wait_for_sending: |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
cmp [send_to_server],1 |
je wait_for_sending |
call draw_channel_text |
2172,7 → 2173,7 |
mov bx,word [rxs] |
imul bx,6 |
mov edx,0xffffff |
int 0x40 |
mcall |
popa |
push ecx |
mov eax,4 |
2191,7 → 2192,7 |
jne no_blue |
mov ecx,0x0000ff |
no_blue: |
int 0x40 |
mcall |
add edx,[rxs] |
add ebx,10 |
pop ecx |
2210,7 → 2211,7 |
mov eax,12 |
mov ebx,1 |
int 0x40 |
mcall |
mov ebx,ebp ; draw window |
shl ebx,16+4 |
2231,7 → 2232,7 |
mov esi,0x80555599 |
mov edi,0x00ffffff |
int 0x40 |
mcall |
mov eax,ebp ; label |
add eax,48 |
2252,30 → 2253,30 |
mov ebx,9*65536+8 |
mov ecx,0x00ffffff |
mov edx,labelc |
int 0x40 |
mcall |
mov eax,38 ; line |
mov ebx,5*65536+494 |
mov ecx,148*65536+148 |
mov edx,[channel_line_sun] |
int 0x40 |
mcall |
add ecx,1*65536+1 |
mov edx,[channel_line_shadow] |
int 0x40 |
mcall |
mov eax,38 ; line |
;mov eax,38 ; line |
mov ebx,410*65536+410 |
mov ecx,22*65536+148 |
mov edx,[channel_line_sun] |
int 0x40 |
mcall |
add ebx,1*65536+1 |
mov edx,[channel_line_shadow] |
int 0x40 |
mcall |
mov eax,12 |
mov ebx,2 |
int 0x40 |
mcall |
popa |
2282,7 → 2283,6 |
ret |
; DATA AREA |
socket dd 0x0 |
2376,9 → 2376,13 |
wcolor dd 0x000000 |
labelc db 'AIRC - WINDOW X: #xxx ' |
labelt db 'IRC client ',version |
labellen: |
title db 'IRC client ',version,0 |
;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/eth.inc |
---|
0,0 → 1,670 |
; |
; ETH.INC |
; |
; made by hidnplayr (hidnplayr@gmail.com) for KolibriOS and DEX4U |
; |
; The given code before every macro is only a simple example |
; |
; Change the OS value to DEX4U or MEOS |
; |
; HISTORY |
; |
; v1.0: 18 august 2006 |
; |
MEOS equ 1 ; Dont change these ! |
DEX4U equ 2 ; |
OS equ MEOS ; Change these instead ;) |
TIMEOUT equ 60 ; timeout for DNS request |
BUFFER equ 512 ; Buffer size for DNS |
macro int1 { |
if OS eq MEOS |
mcall |
else if OS eq DEX4U |
int 0x52 |
end if |
} |
macro int2 { |
if OS eq MEOS |
mcall |
else if OS eq DEX4U |
int 0x53 |
end if |
} |
macro mov arg1,arg2 { |
if arg1 eq arg2 |
else |
mov arg1,arg2 |
end if |
} |
; eth.get_IP eax |
; |
; gets the current IP that is defined in Stack (return in eax in this example) |
macro eth.get_IP IP { |
if OS eq MEOS |
mov eax,52 |
end if |
mov ebx,1 |
int1 |
mov IP ,eax |
} |
; eth.get_GATEWAY eax |
; |
; gets the current GATEWAY that is defined in Stack (return in eax in this example) |
macro eth.get_GATEWAY GATEWAY { |
if OS eq MEOS |
mov eax,52 |
end if |
mov ebx,9 |
int1 |
move GATEWAY ,eax |
} |
; eth.get_SUBNET eax |
; |
; gets the current SUBNET that is defined in Stack (return in eax in this example) |
macro eth.get_SUBNET SUBNET { |
if OS eq MEOS |
mov eax,52 |
end if |
mov ebx,10 |
int1 |
mov SUBNET ,eax |
} |
; eth.get_DNS eax |
; |
; gets the current DNS that is defined in Stack (return in eax in this example) |
macro eth.get_DNS DNS { |
if OS eq MEOS |
mov eax,52 |
end if |
mov ebx,13 |
int1 |
mov DNS ,eax |
} |
; eth.set_IP eax |
; |
; set a new IP in stack (input in eax in this example) |
macro eth.set_IP IP { |
mov ecx,IP |
if OS eq MEOS |
mov eax,52 |
end if |
mov ebx,3 |
int1 |
} |
; eth.set_GATEWAY eax |
; |
; set a new GATEWAY in stack (input in eax in this example) |
macro eth.set_GATEWAY GATEWAY { |
mov ecx,GATEWAY |
if OS eq MEOS |
mov eax,52 |
end if |
mov ebx,11 |
int1 |
} |
; eth.set_SUBNET eax |
; |
; set a new SUBNET in stack (input in eax in this example) |
macro eth.set_SUBNET SUBNET { |
mov ecx,SUBNET |
if OS eq MEOS |
mov eax,52 |
end if |
mov ebx,12 |
int1 |
} |
; eth.set_DNS eax |
; |
; set a new DNS in stack (input in eax in this example) |
macro eth.set_DNS DNS { |
mov ecx,DNS |
if OS eq MEOS |
mov eax,52 |
end if |
mov ebx,14 |
int1 |
} |
; eth.open eax,80,ebx,[socket] |
; |
; open a socket on local port in eax to port 80 on server on ebx |
; the socketnumber will be returned in [socket] (dword) |
macro eth.open local,remote,ip,socket { |
mov ecx, local |
mov edx, remote |
mov esi, ip |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 0 |
int2 |
mov socket,eax |
} |
; eth.close [socket] |
; |
; closes socket on socketnumber [socket] |
macro eth.close socket { |
mov ecx, socket |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 1 |
int2 |
} |
; eth.poll [socket],eax |
; |
; polls [socket] for data |
; eax = 0 when there is data |
macro eth.poll socket,result { |
mov ecx, socket |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 2 |
int2 |
mov result, eax |
} |
; eth.read_byte [socket], bl |
; |
; reads a byte from the socket and returns in bl |
macro eth.read_byte socket, result { |
mov ecx, socket |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 3 |
int2 |
mov result,bl |
} |
; eth.write [socket],12,msg |
; msg db 'hello world!' |
; |
; send message msg to socket |
macro eth.write socket,length,msg { |
mov ecx, socket |
mov edx, length |
mov esi, msg |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 4 |
int2 |
} |
; eth.open_tcp 80,80,eax,0,[socket] |
; |
; opens a tcp socket on port 80 to port 80 on IP eax with passive open |
; returns socket number in eax |
macro eth.open_tcp local,remote,ip,passive,socket { |
pusha |
mov ecx, local |
mov edx, remote |
mov esi, ip |
mov edi, passive ; 0 = PASSIVE open |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 5 |
int2 |
popa |
mov socket,eax |
} |
; eth.socket_status [socket],eax |
; |
; returns socket status in eax |
macro eth.socket_status socket,result { |
mov ecx, socket |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 6 |
int2 |
mov result,eax |
} |
; eth.write_tcp [socket],12,msg |
; |
; msg db 'hello world!' |
; |
; send message to TCP socket |
macro eth.write_tcp socket,length,msg { |
mov ecx, socket |
mov edx, length |
mov esi, msg |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 7 |
int2 |
} |
; eth.close_tcp [socket] |
; |
; closes tcp socket [socket] |
macro eth.close_tcp socket { |
mov ecx, socket |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 8 |
int2 |
} |
; eth.check_port 165,eax |
; |
; checks if port 165 is used |
; return is 0 when port is free |
macro eth.check_port port,result { |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 9 |
mov ecx, port |
int2 |
mov result,eax |
} |
; eth.status eax |
; |
; returns socket status in eax |
macro eth.status status { |
if OS eq MEOS |
mov eax,53 |
end if |
mov ebx, 255 |
mov ecx, 6 |
int2 |
mov status,eax |
} |
; eth.search 165,edx |
; |
; searches a free local port starting from 166 (165 + 1 !) |
; returns in edx |
macro eth.search_port port,result { |
mov edx,port |
@@: |
inc edx |
eth.check_port edx,eax |
cmp eax,0 |
je @r |
mov result,edx |
} |
; eth.read_data [socket],buffer,512 |
; buffer rb 512 |
; socket dd ? |
; |
; reads data from socket into a buffer, stops when there is no more data or buffer is full. |
macro eth.read_data socket,dest,endptr,bufferl { |
mov eax, dest |
mov endptr, eax |
; we have data - this will be the response |
@@: |
mov eax,endptr |
cmp eax,bufferl |
jg @f |
mov eax, 53 |
mov ebx, 3 |
mov ecx, socket |
mcall ; read byte - block (high byte) |
; Store the data in the response buffer |
mov eax, endptr |
mov [eax], bl |
inc dword endptr |
mov eax, 53 |
mov ebx, 2 |
mov ecx, socket |
mcall ; any more data? |
cmp eax, 0 |
jne @r ; yes, so get it |
@@: |
} |
; eth.wait_for_data [socket],60,abort |
; eth.read_data .... |
; abort: |
; |
; Waits for data with timeout |
macro eth.wait_for_data socket,TIMEOUT,abort { |
mov edx,TIMEOUT |
@@: |
eth.poll socket,eax |
cmp eax,0 |
jne @f |
dec edx |
jz abort |
if OS eq MEOS |
mov eax,5 ; wait here for event |
mov ebx,100 |
mcall |
else if OS eq DEX4U |
mov ax,18 |
call [SetDelay] |
call dword[stack_handler] |
end if |
jmp @r |
@@: |
} |
; The function 'resolve' resolves the address in edx and puts the resulting IP in eax. |
; When the input is an IP-adress, the function will output this IP in eax. |
; If something goes wrong, the result in eax should be 0 |
; |
; example: |
; |
; resolve query1,IP |
; resolve '192.168.0.1',IP |
; resolve query2,IP |
; |
; query1 db 'www.google.com',0 |
; query2 db '49.78.84.45',0 |
; IP dd ? |
macro resolve query,result { |
if query eqtype 0 |
mov edx,query |
else |
local ..string, ..label |
jmp ..label |
..string db query,0 |
..label: |
mov edx,..string |
end if |
call __resolve |
mov result,eax |
} |
if used __resolve |
__resolve: |
;DEBUGF 1,'Resolving started\n' |
; This code validates if the query is an IP containing 4 numbers and 3 dots |
push edx ; push edx (query address) onto stack |
xor al, al ; make al (dot count) zero |
@@: |
cmp byte[edx],'0' ; check if this byte is a number, if not jump to no_IP |
jl no_IP ; |
cmp byte[edx],'9' ; |
jg no_IP ; |
inc edx ; the byte was a number, so lets check the next byte |
cmp byte[edx],0 ; is this byte zero? (have we reached end of query?) |
jz @f ; jump to next @@ then |
cmp byte[edx],'.' ; is this byte a dot? |
jne @r ; if not, jump to previous @@ |
inc al ; the byte was a dot so increment al(dot count) |
inc edx ; next byte |
jmp @r ; lets check for numbers again (jump to previous @@) |
@@: ; we reach this when end of query reached |
cmp al,3 ; check if there where 3 dots |
jnz no_IP ; if not, jump to no_IP (this is where the DNS will take over) |
; The following code should convert this IP into a dword and output it in eax |
pop esi ; edx (query address) was pushed onto stack and is now popped in esi |
xor edx, edx ; result |
xor eax, eax ; current character |
xor ebx, ebx ; current byte |
.outer_loop: |
shl edx, 8 |
add edx, ebx |
xor ebx, ebx |
.inner_loop: |
lodsb |
test eax, eax |
jz .finish |
cmp al, '.' |
jz .outer_loop |
sub eax, '0' |
imul ebx, 10 |
add ebx, eax |
jmp .inner_loop |
.finish: |
shl edx, 8 |
add edx, ebx |
bswap edx |
mov eax, edx |
;DEBUGF 1,'The query was an IP: %x.%x.%x.%x\n',dh,dl,al,ah |
ret |
no_IP: |
pop edx |
; The query is not an IP address, we will send the query to a DNS server and hope for answer ;) |
;DEBUGF 1,'The query is no ip, Building request string from:%u\n',edx |
; Build the request string |
mov eax, 0x00010100 |
mov [dnsMsg], eax |
mov eax, 0x00000100 |
mov [dnsMsg+4], eax |
mov eax, 0x00000000 |
mov [dnsMsg+8], eax |
; domain name goes in at dnsMsg+12 |
mov esi, dnsMsg + 12 ; location of label length |
mov edi, dnsMsg + 13 ; label start |
mov ecx, 12 ; total string length so far |
td002: |
mov [esi], byte 0 |
inc ecx |
td0021: |
mov al, [edx] |
cmp al, 0 |
je td001 ; we have finished the string translation |
cmp al, '.' |
je td004 ; we have finished the label |
inc byte [esi] |
inc ecx |
mov [edi], al |
inc edi |
inc edx |
jmp td0021 |
td004: |
mov esi, edi |
inc edi |
inc edx |
jmp td002 |
; write label len + label text |
td001: |
mov [edi], byte 0 |
inc ecx |
inc edi |
mov [edi], dword 0x01000100 |
add ecx, 4 |
mov [dnsMsgLen], ecx ; We'll need the length of the message when we send it |
; Now, lets send this and wait for an answer |
eth.search_port 1024,edx ; Find a free port starting from 1025 and store in edx |
eth.get_DNS esi ; Read DNS IP from stack into esi |
eth.open edx,53,esi,[socketNum] ; First, open socket |
; DEBUGF 1,'Socket opened: %u (port %u)\n',[socketNum],ecx |
eth.write [socketNum],[dnsMsgLen],dnsMsg ; Write to socket ( request DNS lookup ) |
; DEBUGF 1,'Data written, length:%u offset:%u\n',[dnsMsgLen],dnsMsg |
; DEBUGF 1,'Waiting for data: (timeout is %us)\n',TIMEOUT |
eth.wait_for_data [socketNum],TIMEOUT,no_data; Now, we wait for data from remote |
eth.read_data [socketNum],dnsMsg,[dnsMsgLen],dnsMsg+BUFFER ; Read the data into the buffer |
; DEBUGF 1,'Data received, offset:%u buffer size:%u length:%u\n',dnsMsg,BUFFER,esi-dnsMsg |
eth.close [socketNum] ; We're done, close the socket |
; DEBUGF 1,'Closed Socket\n' |
; Now parse the message to get the host IP. Man, this is complicated. It's described in RFC 1035 |
; 1) Validate that we have an answer with > 0 responses |
; 2) Find the answer record with TYPE 0001 ( host IP ) |
; 3) Finally, copy the IP address to the display |
; Note: The response is in dnsMsg, the end of the buffer is pointed to by [dnsMsgLen] |
mov esi, dnsMsg |
mov al, [esi+2] ; Is this a response to my question? |
and al, 0x80 |
cmp al, 0x80 |
jne abort |
;DEBUGF 1,'It was a response to my question\n' |
mov al, [esi+3] ; Were there any errors? |
and al, 0x0F |
cmp al, 0x00 |
jne abort |
;DEBUGF 1,'There were no errorst\n' |
mov ax, [esi+6] ; Is there ( at least 1 ) answer? |
cmp ax, 0x00 |
je abort |
; Header validated. Scan through and get my answer |
add esi, 12 ; Skip to the question field |
call skipName ; Skip through the question field |
add esi, 4 ; skip past the questions qtype, qclass |
ctr002z: |
; Now at the answer. There may be several answers, find the right one ( TYPE = 0x0001 ) |
call skipName |
mov ax, [esi] |
cmp ax, 0x0100 ; Is this the IP address answer? |
jne ctr002c |
add esi, 10 ; Yes! Point eax to the first byte of the IP address |
mov eax,[esi] |
;DEBUGF 1,'Found First Byte of IP\n' |
ret |
ctr002c: ; Skip through the answer, move to the next |
add esi, 8 |
movzx eax, byte [esi+1] |
mov ah, [esi] |
add esi, eax |
add esi, 2 |
cmp esi, [dnsMsgLen] ; Have we reached the end of the msg? This is an error condition, should not happen |
jl ctr002z ; Check next answer |
abort: |
;DEBUGF 1,'Something went wrong, aborting\n' |
xor eax,eax |
ret |
skipName: |
; Increment esi to the first byte past the name field |
; Names may use compressed labels. Normally do. |
; RFC 1035 page 30 gives details |
mov al, [esi] |
cmp al, 0 |
je sn_exit |
and al, 0xc0 |
cmp al, 0xc0 |
je sn001 |
movzx eax, byte [esi] |
inc eax |
add esi, eax |
jmp skipName |
sn001: |
add esi, 2 ; A pointer is always at the end |
ret |
sn_exit: |
inc esi |
ret |
no_data: |
eth.close [socketNum] |
xor eax,eax |
ret |
dnsMsgLen: dd 0 |
socketNum: dd 0xFFFF |
if ~defined dnsMsg |
dnsMsg: rb BUFFER |
end if |
end if |
/programs/network/airc/trunk/fdo.inc |
---|
0,0 → 1,343 |
; |
; Formatted Debug Output (FDO) |
; Copyright (c) 2005-2006, mike.dld |
; Created: 2005-01-29, Changed: 2006-07-20 |
; |
; For questions and bug reports, mail to mike.dld@gmail.com |
; |
; Available format specifiers are: %s, %d, %u, %x (with partial width support) |
; |
; to be defined: |
; __DEBUG__ equ 1 |
; __DEBUG_LEVEL__ equ 5 |
macro debug_func name { |
if used name |
name@of@func equ name |
} |
macro debug_beginf { |
align 4 |
name@of@func: |
} |
debug_endf fix end if |
macro DEBUGS _sign,[_str] { |
common |
pushf |
pushad |
local ..str,..label,is_str |
is_str = 0 |
forward |
if _str eqtype '' |
is_str = 1 |
end if |
common |
if is_str = 1 |
jmp ..label |
..str db _str,0 |
..label: |
add esp,4*8+4 |
mov edx,..str |
sub esp,4*8+4 |
call fdo_debug_outstr |
else |
mov edx,_str |
call fdo_debug_outstr |
end if |
popad |
popf |
} |
macro DEBUGD _sign,_dec { |
pushf |
pushad |
if _dec eqtype eax |
if _dec in <ebx,ecx,edx,esi,edi,ebp,esp> |
mov eax,_dec |
else if ~_dec eq eax |
if _sign = 1 |
movsx eax,_dec |
else |
movzx eax,_dec |
end if |
end if |
else if _dec eqtype 0 |
mov eax,_dec |
else |
add esp,4*8+4 |
local tp |
tp equ 0 |
match _num[_arg],_dec \{ |
if _num = 1 |
if _sign = 1 |
movsx eax,byte[_arg] |
else |
movzx eax,byte[_arg] |
end if |
else if _num = 2 |
if _sign = 1 |
movsx eax,word[_arg] |
else |
movzx eax,word[_arg] |
end if |
else |
mov eax,dword[_arg] |
end if |
tp equ 1 |
\} |
match =0 [_arg],tp _dec \{ |
mov eax,dword[_arg] |
\} |
sub esp,4*8+4 |
end if |
mov cl,_sign |
call fdo_debug_outdec |
popad |
popf |
} |
macro DEBUGH _sign,_hex { |
pushf |
pushad |
if _hex eqtype eax |
if _hex in <eax,ebx,ecx,edx,esi,edi,ebp,esp> |
if ~_hex eq eax |
mov eax,_hex |
end if |
mov edx,8 |
else if _hex in <ax,bx,cx,dx,si,di,bp,sp> |
if ~_hex eq ax |
movzx eax,_hex |
end if |
shl eax,16 |
mov edx,4 |
else if _hex in <al,ah,bl,bh,cl,ch,dl,dh> |
if ~_hex eq al |
movzx eax,_hex |
end if |
shl eax,24 |
mov edx,2 |
end if |
else if _hex eqtype 0 |
mov eax,_hex |
mov edx,8 |
else |
add esp,4*8+4 |
local tp |
tp equ 0 |
match _num[_arg],_hex \{ |
mov eax,dword[_arg] |
mov edx,_num |
tp equ 1 |
\} |
match =0 [_arg],tp _hex \{ |
mov eax,dword[_arg] |
mov edx,8 |
\} |
sub esp,4*8+4 |
end if |
call fdo_debug_outhex |
popad |
popf |
} |
;----------------------------------------------------------------------------- |
debug_func fdo_debug_outchar |
debug_beginf |
pushad |
mov cl,al |
mov ebx,1 |
mov eax,63 |
mcall |
popad |
ret |
debug_endf |
debug_func fdo_debug_outstr |
debug_beginf |
mov eax,63 |
mov ebx,1 |
.l1: mov cl,[edx] |
or cl,cl |
jz .l2 |
mcall |
inc edx |
jmp .l1 |
.l2: ret |
debug_endf |
debug_func fdo_debug_outdec |
debug_beginf |
or cl,cl |
jz @f |
or eax,eax |
jns @f |
neg eax |
push eax |
mov al,'-' |
call fdo_debug_outchar |
pop eax |
@@: push 10 |
pop ecx |
push -'0' |
.l1: xor edx,edx |
div ecx |
push edx |
test eax,eax |
jnz .l1 |
.l2: pop eax |
add al,'0' |
jz .l3 |
call fdo_debug_outchar |
jmp .l2 |
.l3: ret |
debug_endf |
debug_func fdo_debug_outhex |
__fdo_hexdigits db '0123456789ABCDEF' |
debug_beginf |
mov cl,dl |
neg cl |
add cl,8 |
shl cl,2 |
rol eax,cl |
.l1: rol eax,4 |
push eax |
and eax,0x0000000F |
mov al,[__fdo_hexdigits+eax] |
call fdo_debug_outchar |
pop eax |
dec edx |
jnz .l1 |
ret |
debug_endf |
;----------------------------------------------------------------------------- |
macro DEBUGF _level,_format,[_arg] { |
common |
if __DEBUG__ = 1 & _level >= __DEBUG_LEVEL__ |
local ..f1,f2,a1,a2,c1,c2,c3,..lbl |
_debug_str_ equ __debug_str_ # a1 |
a1 = 0 |
c2 = 0 |
c3 = 0 |
f2 = 0 |
repeat ..lbl-..f1 |
virtual at 0 |
db _format,0,0 |
load c1 word from %-1 |
end virtual |
if c1 = '%s' |
virtual at 0 |
db _format,0,0 |
store word 0 at %-1 |
load c1 from f2-c2 |
end virtual |
if c1 <> 0 |
DEBUGS 0,_debug_str_+f2-c2 |
end if |
c2 = c2 + 1 |
f2 = %+1 |
DEBUGF_HELPER S,a1,0,_arg |
else if c1 = '%x' |
virtual at 0 |
db _format,0,0 |
store word 0 at %-1 |
load c1 from f2-c2 |
end virtual |
if c1 <> 0 |
DEBUGS 0,_debug_str_+f2-c2 |
end if |
c2 = c2 + 1 |
f2 = %+1 |
DEBUGF_HELPER H,a1,0,_arg |
else if c1 = '%d' | c1 = '%u' |
local c4 |
if c1 = '%d' |
c4 = 1 |
else |
c4 = 0 |
end if |
virtual at 0 |
db _format,0,0 |
store word 0 at %-1 |
load c1 from f2-c2 |
end virtual |
if c1 <> 0 |
DEBUGS 0,_debug_str_+f2-c2 |
end if |
c2 = c2 + 1 |
f2 = %+1 |
DEBUGF_HELPER D,a1,c4,_arg |
else if c1 = '\n' |
c3 = c3 + 1 |
end if |
end repeat |
virtual at 0 |
db _format,0,0 |
load c1 from f2-c2 |
end virtual |
if (c1<>0)&(f2<>..lbl-..f1-1) |
DEBUGS 0,_debug_str_+f2-c2 |
end if |
virtual at 0 |
..f1 db _format,0 |
..lbl: |
__debug_strings equ __debug_strings,_debug_str_,<_format>,..lbl-..f1-1-c2-c3 |
end virtual |
end if |
} |
macro __include_debug_strings dummy,[_id,_fmt,_len] { |
common |
local c1,a1,a2 |
forward |
if defined _len & ~_len eq |
_id: |
a1 = 0 |
a2 = 0 |
repeat _len |
virtual at 0 |
db _fmt,0,0 |
load c1 word from %+a2-1 |
end virtual |
if (c1='%s')|(c1='%x')|(c1='%d')|(c1='%u') |
db 0 |
a2 = a2 + 1 |
else if (c1='\n') |
dw $0A0D |
a1 = a1 + 1 |
a2 = a2 + 1 |
else |
db c1 and 0x0FF |
end if |
end repeat |
db 0 |
end if |
} |
macro DEBUGF_HELPER _letter,_num,_sign,[_arg] { |
common |
local num |
num = 0 |
forward |
if num = _num |
DEBUG#_letter _sign,_arg |
end if |
num = num+1 |
common |
_num = _num+1 |
} |
macro include_debug_strings { |
if __DEBUG__ = 1 |
match dbg_str,__debug_strings \{ |
__include_debug_strings dbg_str |
\} |
end if |
} |
/programs/network/arpstat/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: 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 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
38,7 → 38,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 200 |
int 0x40 |
mcall |
push eax |
mov ebx, text + 24 |
47,7 → 47,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 201 |
int 0x40 |
mcall |
mov ebx, text + 64 |
call printhex |
94,13 → 94,13 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 202 |
int 0x40 |
mcall |
; Read the IP address |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 203 |
int 0x40 |
mcall |
; 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 |
int 0x40 |
mcall |
pop ebx |
mov ecx, eax |
179,7 → 179,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 205 |
int 0x40 |
mcall |
pop ebx |
mov ecx, eax |
213,7 → 213,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 206 |
int 0x40 |
mcall |
pop ebx |
mov ecx, eax |
247,7 → 247,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 207 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
jmp still |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jnz still |
mov eax,0xffffffff ; close this program |
int 0x40 |
mcall |
jmp still |
339,34 → 339,26 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,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 |
mov edx,0x13224466 ; color of work area RRGGBB |
mov edi,title ; WINDOW LABEL |
mcall |
; 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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
375,7 → 367,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
426,9 → 418,7 |
db ' xxx.xxx.xxx.xxx xxxxxxxxxxxx xxxx xxxx ' |
labelt: |
db 'ARP Table ( First 10 Entries )' |
labellen: |
title db 'ARP Table ( First 10 Entries )',0 |
hextable db '0123456789ABCDEF' |
/programs/network/arpstat/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm arpstat.asm arpstat |
@erase lang.inc |
@pause |
/programs/network/autodhcp/trunk/MACROS.INC |
---|
File deleted |
\ No newline at end of file |
/programs/network/autodhcp/trunk/ETH.INC |
---|
39,7 → 39,7 |
macro eth.get_IP IP { |
mov ebx,1 |
mov eax,52 |
int 0x40 |
mcall |
mov IP ,eax |
} |
47,7 → 47,7 |
macro eth.get_GATEWAY GATEWAY { |
mov ebx,9 |
mov eax,52 |
int 0x40 |
mcall |
mov GATEWAY ,eax |
} |
54,7 → 54,7 |
macro eth.get_SUBNET SUBNET { |
mov ebx,10 |
mov eax,52 |
int 0x40 |
mcall |
mov SUBNET ,eax |
} |
61,7 → 61,7 |
macro eth.get_DNS DNS { |
mov ebx,13 |
mov eax,52 |
int 0x40 |
mcall |
mov DNS ,eax |
} |
69,7 → 69,7 |
mov ecx,IP |
mov ebx,3 |
mov eax,52 |
int 0x40 |
mcall |
} |
macro eth.set_GATEWAY GATEWAY { |
76,7 → 76,7 |
mov ecx,GATEWAY |
mov ebx,11 |
mov eax,52 |
int 0x40 |
mcall |
} |
macro eth.set_SUBNET SUBNET { |
83,7 → 83,7 |
mov ecx,SUBNET |
mov ebx,12 |
mov eax,52 |
int 0x40 |
mcall |
} |
macro eth.set_DNS DNS { |
90,7 → 90,7 |
mov ecx,DNS |
mov ebx,14 |
mov eax,52 |
int 0x40 |
mcall |
} |
macro eth.set_network_drv conf { |
97,7 → 97,7 |
mov ecx,conf |
mov ebx,2 |
mov eax,52 |
int 0x40 |
mcall |
} |
macro eth.open_udp local,remote,ip,socket { |
106,7 → 106,7 |
mov esi, ip |
mov ebx, 0 |
mov eax, 53 |
int 0x40 |
mcall |
mov socket,eax |
} |
115,7 → 115,7 |
mov ecx, socket |
mov ebx, 1 |
mov eax, 53 |
int 0x40 |
mcall |
} |
macro eth.poll socket { |
122,7 → 122,7 |
mov ecx, socket |
mov ebx, 2 |
mov eax, 53 |
int 0x40 |
mcall |
} |
macro eth.read_byte socket, result { |
129,7 → 129,7 |
mov ecx, socket |
mov ebx, 3 |
mov eax, 53 |
int 0x40 |
mcall |
mov result,bl |
} |
140,7 → 140,7 |
mov ecx, socket |
mov ebx, 11 |
mov eax, 53 |
int 0x40 |
mcall |
} |
macro eth.write_udp socket,length,msg,verify { |
149,7 → 149,7 |
mov esi, msg |
mov ebx, 4 |
mov eax, 53 |
int 0x40 |
mcall |
if verify eq 1 |
call verifysend |
165,9 → 165,9 |
pusha |
mov eax,5 |
mov ebx,100 |
int 0x40 |
mcall |
popa |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov socket,eax |
} |
187,7 → 187,7 |
mov ecx, socket |
mov ebx, 6 |
mov eax, 53 |
int 0x40 |
mcall |
mov result,eax |
} |
198,7 → 198,7 |
mov esi, msg |
mov ebx, 7 |
mov eax, 53 |
int 0x40 |
mcall |
if verify eq 1 |
call verifysend |
210,11 → 210,11 |
mov ebx, 15 |
xor ecx, ecx |
pusha |
int 0x40 |
mcall |
mov dword[mac],eax |
popa |
add cl, 4 |
int 0x40 |
mcall |
mov word[mac+4],ax |
} |
223,7 → 223,7 |
mov ecx, socket |
mov ebx, 8 |
mov eax, 53 |
int 0x40 |
mcall |
} |
macro eth.check_port port,result { |
230,7 → 230,7 |
mov ecx, port |
mov ebx, 9 |
mov eax, 53 |
int 0x40 |
mcall |
mov result,eax |
} |
238,7 → 238,7 |
macro eth.check_cable result { |
mov ebx, 10 |
mov eax, 53 |
int 0x40 |
mcall |
mov result,eax |
} |
247,7 → 247,7 |
mov ebx, 255 |
mov ecx, 6 |
mov eax, 53 |
int 0x40 |
mcall |
mov status,eax |
} |
268,7 → 268,7 |
mov eax,52 |
mov ebx,16 |
xor ecx,ecx |
int 0x40 |
mcall |
} |
280,7 → 280,7 |
mov ebx,16 |
xor ecx,ecx |
inc ecx |
int 0x40 |
mcall |
} |
308,7 → 308,7 |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
inc edx |
cmp edx,30 |
331,7 → 331,7 |
mov eax,5 ; wait here for event |
mov ebx,10 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
eth.poll [socketNum] |
/programs/network/autodhcp/trunk/common.inc |
---|
1,17 → 1,17 |
macro wait time { |
mov ebx,time |
mov eax,5 |
int 0x40 |
mcall |
} |
macro get_time_counter result { |
mov eax,26 |
mov ebx,9 |
int 0x40 |
mcall |
mov result,eax |
} |
macro exit { |
mov eax,-1 |
int 0x40 |
or eax,-1 |
mcall |
} |
/programs/network/autodhcp/trunk/debug-fdo.inc |
---|
229,7 → 229,7 |
mov cl,al |
mov ebx,1 |
mov eax,63 |
int 0x40 |
mcall |
popad |
ret |
debug_endf |
243,7 → 243,7 |
mov cl,[edx] |
or cl,cl |
jz .l2 |
int 0x40 |
mcall |
inc edx |
jmp .l1 |
.l2: ret |
/programs/network/autodhcp/trunk/events.inc |
---|
2,23 → 2,23 |
macro set_event_mask mask { |
mov ebx, mask |
mov eax, 40 |
int 0x40 |
mcall |
} |
macro wait_for_event { |
mov eax, 10 |
int 0x40 |
mcall |
} |
macro check_for_event { |
mov eax, 11 |
int 0x40 |
mcall |
} |
macro wait_for_event_timeout timeout { |
mov ebx,timeout |
mov eax, 23 |
int 0x40 |
mcall |
} |
/programs/network/dhcp/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/dhcp/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm dhcp.asm dhcp |
@erase lang.inc |
@pause |
/programs/network/dhcp/trunk/dhcp.asm |
---|
5,18 → 5,19 |
; |
include 'lang.inc' |
include 'macros.inc' |
include '..\..\..\macros.inc' |
use32 |
org 0x0 |
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 |
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 |
START: ; start of execution |
24,11 → 25,12 |
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 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
38,19 → 40,14 |
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 |
int 0x40 |
mcall |
jmp still |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jnz noclose |
59,10 → 56,10 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov eax,0xffffffff ; close this program |
int 0x40 |
mcall |
noclose: |
cmp ah,3 ; Resolve address? |
246,7 → 243,7 |
mov ecx, 68 ; local port dhcp client |
mov edx, 67 ; remote port - dhcp server |
mov esi, 0xffffffff ; broadcast |
int 0x40 |
mcall |
mov [socketNum], eax |
265,7 → 262,7 |
mov ecx, [socketNum] |
mov edx, [dhcpMsgLen] |
mov esi, dhcpMsg |
int 0x40 |
mcall |
; Setup the DHCP buffer to receive response |
279,7 → 276,7 |
ctr001: |
mov eax,10 ; wait here for event |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je ctr003 |
293,7 → 290,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
cmp eax, 0 |
je ctr001 |
303,7 → 300,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte - block (high byte) |
mcall ; read byte - block (high byte) |
; Store the data in the response buffer |
mov eax, [dhcpMsgLen] |
313,7 → 310,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
cmp eax, 0 |
jne ctr002 ; yes, so get it |
365,7 → 362,7 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov [socketNum], dword 0xFFFF |
379,18 → 376,18 |
ctr004: ; key |
mov eax,2 ; just read it and ignore |
int 0x40 |
mcall |
jmp ctr001 |
ctr005: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
; close socket |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov [socketNum], dword 0xFFFF |
421,7 → 418,7 |
mov eax,47 |
push ecx |
movzx ecx,byte [edi] |
int 0x40 |
mcall |
pop ecx |
add edx,6*4*65536 |
inc edi |
477,7 → 474,7 |
add edx,1*65536+99 |
mov ecx,[esp+20] |
mov esi,0xffffff |
int 0x40 |
mcall |
popa |
sub ecx,4 |
ret |
487,22 → 484,14 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,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 edx,0x13224466 ; color of work area RRGGBB |
mov edi,title ; WINDOW LABEL |
mcall |
mov eax,8 ; Resolve |
mov ebx,20*65536+90 |
509,7 → 498,7 |
mov ecx,127*65536+15 |
mov edx,3 |
mov esi,0x557799 |
int 0x40 |
mcall |
; Pass in the IP address in edi |
; row to display in [ya] |
534,14 → 523,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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
550,7 → 538,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
574,8 → 562,7 |
dhms db ' d h m s' |
forever db 'Forever ' |
labelt: db 'DHCP Client Test' |
labellen: |
title db 'DHCP Client Test',0 |
dhcpMsgType: db 0 |
dhcpLease: dd 0 |
/programs/network/dnsr/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/dnsr/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm dnsr.asm dnsr |
@erase lang.inc |
@pause |
/programs/network/dnsr/trunk/dnsr.asm |
---|
17,18 → 17,17 |
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 |
38,11 → 37,12 |
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 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
52,19 → 52,14 |
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 |
int 0x40 |
mcall |
jmp still |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jnz noclose |
73,10 → 68,10 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov eax,0xffffffff ; close this program |
int 0x40 |
mcall |
noclose: |
cmp ah,3 ; Resolve address? |
122,7 → 117,7 |
f11: |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 |
jz fbu |
jmp still |
129,7 → 124,7 |
fbu: |
mov eax,2 |
int 0x40 ; get key |
mcall ; get key |
shr eax,8 |
cmp eax,8 |
jnz nobs |
169,7 → 164,7 |
shl ecx,16 |
mov cx,8 |
mov edx,0x224466 |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,103*65536 |
177,7 → 172,7 |
mov ecx,0xffffff |
mov edx,[addr] |
mov esi,26 |
int 0x40 |
mcall |
ret |
320,7 → 315,7 |
push ecx |
mov eax, 53 |
mov ebx, 9 |
int 0x40 |
mcall |
pop ecx |
cmp eax, 0 ; is this local port in use? |
jz getlp ; yes - so try next |
330,7 → 325,7 |
mov ebx, 0 |
mov edx, 53 ; remote port - dns |
mov esi, [dnsIP] |
int 0x40 |
mcall |
mov [socketNum], eax |
340,7 → 335,7 |
mov ecx, [socketNum] |
mov edx, [dnsMsgLen] |
mov esi, dnsMsg |
int 0x40 |
mcall |
; Setup the DNS response buffer |
354,7 → 349,7 |
ctr001: |
mov eax,10 ; wait here for event |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je ctr003 |
368,7 → 363,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
cmp eax, 0 |
je ctr001 |
378,7 → 373,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte - block (high byte) |
mcall ; read byte - block (high byte) |
; Store the data in the response buffer |
mov eax, [dnsMsgLen] |
393,7 → 388,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
cmp eax, 0 |
jne ctr002 ; yes, so get it |
402,7 → 397,7 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov [socketNum], dword 0xFFFF |
489,18 → 484,18 |
ctr004: ; key |
mov eax,2 ; just read it and ignore |
int 0x40 |
mcall |
jmp ctr001 |
ctr005: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
; close socket |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov [socketNum], dword 0xFFFF |
mov [hostIP], dword 0 |
554,22 → 549,14 |
draw_window: |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,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 edx,0x13224466 ; color of work area RRGGBB |
mov edi,title ; WINDOW LABEL; |
mcall |
mov eax,8 ; Resolve |
mov ebx,20*65536+190 |
576,21 → 563,19 |
mov ecx,79*65536+15 |
mov edx,3 |
mov esi,0x557799 |
int 0x40 |
mcall |
mov eax,8 |
;mov eax,8 |
mov ebx,270*65536+10 |
mov ecx,34*65536+10 |
mov edx,4 |
mov esi,0x557799 |
int 0x40 |
inc edx |
mcall |
mov eax,8 |
;mov eax,8 |
mov ebx,270*65536+10 |
mov ecx,50*65536+10 |
mov edx,5 |
mov esi,0x557799 |
int 0x40 |
inc edx |
mcall |
; Copy the file name to the screen buffer |
; file name is same length as IP address, to |
616,14 → 601,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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
644,7 → 628,7 |
ipdisplay: |
mov eax,47 |
movzx ecx,byte [edi] |
int 0x40 |
mcall |
add edx,6*4*65536 |
inc edi |
cmp edi,hostIP+4 |
653,7 → 637,7 |
dw001: |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
681,7 → 665,7 |
mov eax,63 |
mov ebx, 1 |
push esi |
int 0x40 |
mcall |
inc word [ind] |
mov ax, [ind] |
692,11 → 676,11 |
mov cl, 13 |
mov eax,63 |
mov ebx, 1 |
int 0x40 |
mcall |
mov cl, 10 |
mov eax,63 |
mov ebx, 1 |
int 0x40 |
mcall |
ds1: |
750,9 → 734,7 |
db 'x <- END MARKER, DONT DELETE ' |
labelt: |
db 'DNS Client' |
labellen: |
title db 'DNS Client',0 |
prompt: dd 0 |
770,7 → 752,7 |
dnsServer db '194.145.128.1 ' ; iolfree.ie DNS |
query db 'WWW.MENUETOS.ORG ' |
query db 'WWW.MENUETOS.NET ' |
hostIP: dd 0 |
dnsIP: dd 0 |
/programs/network/ethstat/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: 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 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
38,7 → 38,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 6 |
int 0x40 |
mcall |
mov ebx, text + 24 |
call printhex |
46,7 → 46,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 2 |
int 0x40 |
mcall |
mov ebx, text + 107 |
call printhex |
54,7 → 54,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 5 |
int 0x40 |
mcall |
mov ebx, text + 107 + 40 |
call printhex |
62,7 → 62,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 4 |
int 0x40 |
mcall |
mov ebx, text + 107 + 80 |
call printhex |
70,7 → 70,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 100 |
int 0x40 |
mcall |
mov ebx, text + 258 |
call printhex |
78,7 → 78,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 101 |
int 0x40 |
mcall |
mov ebx, text + 258 + 40 |
call printhex |
86,7 → 86,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 102 |
int 0x40 |
mcall |
mov ebx, text + 258 + 80 |
call printhex |
94,7 → 94,7 |
mov eax, 53 |
mov ebx, 255 |
mov ecx, 103 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
jmp still |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jnz still |
mov eax,0xffffffff ; close this program |
int 0x40 |
or eax,-1 ; close this program |
mcall |
jmp still |
132,34 → 132,26 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; DRAW WINDOW |
mov eax,0 ; function 0 : define and draw window |
xor eax,eax ; 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,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 |
mov edx,0x13224466 ; color of work area RRGGBB |
mov edi,title ; WINDOW LABEL |
mcall |
; 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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
168,7 → 160,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
211,9 → 203,7 |
db 'x <- END MARKER, DONT DELETE ' |
labelt: |
db 'Stack Status' |
labellen: |
title db 'Stack Status',0 |
hextable db '0123456789ABCDEF' |
/programs/network/ftps/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
/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] |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
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] |
int 0x40 |
mcall |
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] |
int 0x40 |
mcall |
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] |
int 0x40 |
mcall |
cmp eax, 0 |
jne read_input |
145,12 → 145,12 |
key: ; KEY |
mov eax,2 ; get but ignore |
int 0x40 |
mcall |
jmp still |
button: |
mov eax,17 |
int 0x40 |
mcall |
cmp ah,1 |
jne still |
158,11 → 158,11 |
mov eax,53 |
mov ebx,8 |
mov ecx,[CmdSocket] |
int 0x40 |
mcall |
; ... terminate program |
mov eax,-1 |
int 0x40 |
or eax,-1 |
mcall |
jmp still |
175,7 → 175,7 |
mov eax,12 |
mov ebx,1 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
; 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 |
int 0x40 |
mcall |
mov esi,contlen-contt ; display connected status |
203,7 → 203,7 |
mov eax,4 ; status text |
mov ebx,380*65536+276 |
mov ecx,0x00ffffff |
int 0x40 |
mcall |
; 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 |
int 0x40 |
mcall |
popa |
262,7 → 262,7 |
shl ebx, 16 |
mov bx, 6 |
mov eax, 13 |
int 0x40 |
mcall |
popa |
; draw character |
278,7 → 278,7 |
mov eax,4 |
mov edx,esi |
mov esi,1 |
int 0x40 |
mcall |
popa |
noletter: |
431,7 → 431,7 |
mov eax,53 |
mov ebx,7 |
mov ecx,[CmdSocket] |
int 0x40 |
mcall |
pop edx |
pop esi |
442,7 → 442,7 |
pusha |
mov eax,5 |
mov ebx,1 ; Delay for up 100ms |
int 0x40 |
mcall |
popa |
jmp outputStr |
os_exit: |
468,7 → 468,7 |
mov eax,53 |
mov ebx,7 |
mov ecx,[DataSocket] |
int 0x40 |
mcall |
pop edx |
pop esi |
479,7 → 479,7 |
pusha |
mov eax,5 |
mov ebx,20 ; Delay for upto 200ms |
int 0x40 |
mcall |
popa |
jmp outputDataStr |
ods_exit: |
580,7 → 580,7 |
mov eax, 53 ; Stack Interface |
mov ebx,8 ; Close TCP socket |
mov ecx,[CmdSocket] |
int 0x40 |
mcall |
ret |
602,13 → 602,13 |
pusha |
mov eax,5 |
mov ebx,200 ; Delay for 2s |
int 0x40 |
mcall |
popa |
mov eax, 53 ; Stack Interface |
mov ebx,8 ; Close TCP socket |
mov ecx,[DataSocket] |
int 0x40 |
mcall |
ret |
634,7 → 634,7 |
mov edx, 0 ; No remote port |
mov ecx, 21 ; ftp command port id |
mov edi, 0 ; passive open |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov [DataSocket], eax |
popa |
853,7 → 853,7 |
sd001: |
; Read the next DirBlocksPerCall (=16) blocks |
mov eax, 70 |
int 0x40 |
mcall |
; Did we read anything? |
test eax, eax |
jz @f |
1067,7 → 1067,7 |
sf002a: |
; now read the file.. |
mov eax,70 |
int 0x40 |
mcall |
test eax, eax |
jz @f |
cmp eax, 6 |
1083,7 → 1083,7 |
; wait a bit |
mov eax, 5 |
mov ebx, 10 |
int 0x40 |
mcall |
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] |
int 0x40 |
mcall |
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] |
int 0x40 ; returned data in bl |
mcall ; 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] |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
ret ; Finished |
1174,7 → 1174,7 |
; wait a bit |
mov eax,5 |
mov ebx,10 ; Delay for up 100ms |
int 0x40 |
mcall |
jmp gf000 ; try for more data |
1289,7 → 1289,7 |
and dword [ebx+12], 0 |
and dword [ebx+16], 0 |
mov eax, 70 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
; check connection status |
mov eax,53 |
mov ebx,6 ; Get socket status |
mov ecx,[DataSocket] |
int 0x40 |
mcall |
cmp eax, 4 |
jne cl001 |
1363,13 → 1363,13 |
; wait a bit |
mov eax,5 |
mov ebx,10 ; Delay for up 100ms |
int 0x40 |
mcall |
; check connection status |
mov eax,53 |
mov ebx,6 ; Get socket status |
mov ecx,[DataSocket] |
int 0x40 |
mcall |
cmp eax, 4 |
jne cr001 |
1402,13 → 1402,13 |
; wait a bit |
mov eax,5 |
mov ebx,10 ; Delay for up 100ms |
int 0x40 |
mcall |
; check connection status |
mov eax,53 |
mov ebx,6 ; Get socket status |
mov ecx,[DataSocket] |
int 0x40 |
mcall |
cmp eax, 4 |
je @f |
/programs/network/httpc/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/httpc/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm httpc.asm httpc |
@erase lang.inc |
@pause |
/programs/network/httpc/trunk/httpc.asm |
---|
23,18 → 23,17 |
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 |
50,14 → 49,15 |
mov eax,40 ; Report events |
mov ebx,10000111b ; Stack 8 + defaults |
int 0x40 |
mcall |
red: ; redraw |
call draw_window |
still: |
mov eax,23 ; wait here for event |
mov ebx,1 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je red |
75,7 → 75,7 |
mov eax,53 |
mov ebx,6 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [status],eax |
102,7 → 102,7 |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
call draw_page |
111,13 → 111,9 |
no_close: |
jmp still |
red: ; redraw |
call draw_window |
jmp still |
key: ; key |
mov eax,2 ; just read it and ignore |
int 0x40 |
mcall |
shr eax,8 |
cmp eax,184 |
jne no_down |
138,7 → 134,7 |
button: ; button |
;dps <"Button pressed",13,10> |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jne noclose |
147,7 → 143,7 |
mov eax, 53 |
mov ebx, 8 |
mov ecx, [socket] |
int 0x40 |
mcall |
;dpd eax |
;dps <13,10> |
154,7 → 150,7 |
exit: |
or eax,-1 ; close this program |
int 0x40 |
mcall |
noclose: |
cmp ah,31 |
189,7 → 185,7 |
f11: |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 ; key? |
jz fbu |
jmp still |
196,7 → 192,7 |
fbu: |
mov eax,2 |
int 0x40 ; get key |
mcall ; get key |
shr eax,8 |
cmp eax,8 |
jnz nobs |
258,7 → 254,7 |
mov ecx,[socket] |
mov edx,4 |
mov esi,string0 |
int 0x40 |
mcall |
mov edx,0 |
272,7 → 268,7 |
mov ebx,7 |
mov ecx,[socket] |
mov esi,document |
int 0x40 |
mcall |
mov eax,53 ; ' HTTP/1.0 .. ' |
mov ebx,7 |
279,7 → 275,7 |
mov ecx,[socket] |
mov edx,stringh_end-stringh |
mov esi,stringh |
int 0x40 |
mcall |
popa |
ret |
298,7 → 294,7 |
mov eax,26 |
mov ebx,9 |
int 0x40 |
mcall |
cmp eax,[nextupdate] |
jb status_return |
313,7 → 309,7 |
shl ecx,16 |
add ecx,-18*65536+10 |
mov edx,0xffffff |
int 0x40 |
mcall |
mov eax,47 |
mov ebx,3*65536 |
321,7 → 317,7 |
mov edx,12*65536-18 |
add edx,[winys] |
mov esi,0x000000 |
int 0x40 |
mcall |
mov eax,47 |
mov ebx,6*65536 |
329,7 → 325,7 |
mov edx,40*65536-18 |
add edx,[winys] |
mov esi,0x000000 |
int 0x40 |
mcall |
status_return: |
popa |
356,7 → 352,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socket] |
int 0x40 |
mcall |
cmp eax,0 |
je no_more_data |
365,7 → 361,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socket] |
int 0x40 |
mcall |
yesm: |
inc [pos] |
379,7 → 375,7 |
mov eax,5 |
mov ebx,50 |
int 0x40 |
mcall |
jmp newbyteread |
675,7 → 671,7 |
shl ecx,16 |
add ecx,10 |
mov edx,0xffffff |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,[esp+4] |
715,7 → 711,7 |
noecx128: |
mov esi,1 |
int 0x40 |
mcall |
pop ebx |
pop eax |
763,7 → 759,7 |
push ecx |
mov eax, 53 |
mov ebx, 9 |
int 0x40 |
mcall |
pop ecx |
cmp eax, 0 ; is this local port in use? |
jz getlp1 ; yes - so try next |
773,7 → 769,7 |
mov edx,80 |
mov esi,dword [server_ip] |
mov edi,1 |
int 0x40 |
mcall |
mov [socket], eax |
mov [pos],0 |
791,7 → 787,7 |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
call draw_page |
1068,7 → 1064,7 |
push ecx |
mov eax, 53 |
mov ebx, 9 |
int 0x40 |
mcall |
pop ecx |
cmp eax, 0 ; is this local port in use? |
jz getlp ; yes - so try next |
1078,7 → 1074,7 |
mov ebx, 0 |
mov edx, 53 ; remote port - dns |
mov esi, dword [dns_ip] |
int 0x40 |
mcall |
mov [socketNum], eax |
1088,7 → 1084,7 |
mov ecx, [socketNum] |
mov edx, [dnsMsgLen] |
mov esi, dnsMsg |
int 0x40 |
mcall |
; Setup the DNS response buffer |
1102,7 → 1098,7 |
ctr001: |
mov eax,10 ; wait here for event |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je ctr003 |
1116,7 → 1112,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
cmp eax, 0 |
je ctr001 |
1126,7 → 1122,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte - block (high byte) |
mcall ; read byte - block (high byte) |
; Store the data in the response buffer |
mov eax, [dnsMsgLen] |
1136,7 → 1132,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
cmp eax, 0 |
jne ctr002 ; yes, so get it |
1145,7 → 1141,7 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov [socketNum], dword 0xFFFF |
1239,12 → 1235,12 |
ctr004: ; key |
mov eax,2 ; just read it and ignore |
int 0x40 |
mcall |
jmp ctr001 |
ctr005: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
mov dl, ah |
1252,7 → 1248,7 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
cmp dl, 1 |
je exit |
1316,7 → 1312,7 |
mov cl, '"' |
mov eax,63 |
mov ebx, 1 |
int 0x40 |
mcall |
pop esi |
dps_000: |
1331,15 → 1327,15 |
mov cl, '"' |
mov eax,63 |
mov ebx, 1 |
int 0x40 |
mcall |
mov cl, 13 |
mov eax,63 |
mov ebx, 1 |
int 0x40 |
mcall |
mov cl, 10 |
mov eax,63 |
mov ebx, 1 |
int 0x40 |
mcall |
ret |
dps_001: |
1346,7 → 1342,7 |
mov eax,63 |
mov ebx, 1 |
push esi |
int 0x40 |
mcall |
pop esi |
inc esi |
1370,7 → 1366,7 |
shl ecx,16 |
mov cx,9 |
mov edx,0xFFFFFF |
int 0x40 |
mcall |
; write text |
mov eax,4 |
1379,7 → 1375,7 |
mov ecx,0x000000 |
mov edx,[addr] |
mov esi,URLMAXLEN |
int 0x40 |
mcall |
ret |
1390,47 → 1386,38 |
draw_window: |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,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 edx,0x13ffffff ; color of work area RRGGBB,8->color gl |
mov edi,title ; WINDOW LABEL |
mcall |
; 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 |
int 0x40 |
mcall |
mov eax,38 |
mov ebx,5*65536+545 |
mov ecx,60*65536+60 |
mov edx,0x000000 |
int 0x40 |
mcall |
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 |
int 0x40 |
;mov edx,0x000000 |
mcall |
; RELOAD |
mov eax,8 ; function 8 : define and draw button |
mov ebx,388*65536+50 ; [x start] *65536 + [x size] |
1437,23 → 1424,23 |
mov ecx,34*65536+14 ; [y start] *65536 + [y size] |
mov edx,22 ; button id |
mov esi,0x5588dd ; button color RRGGBB |
int 0x40 |
mcall |
; 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 |
int 0x40 |
;mov esi,0x5588dd ; button color RRGGBB |
mcall |
; 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 |
int 0x40 |
;mov esi,0x5588dd ; button color RRGGBB |
mcall |
; BUTTON TEXT |
mov eax,4 ; function 4 : write text to window |
1461,13 → 1448,13 |
mov ecx,0xffffff ; color of text RRGGBB |
mov edx,button_text ; pointer to text beginning |
mov esi,20 ; text length |
int 0x40 |
mcall |
call display_page |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
1499,8 → 1486,7 |
ya dd 0x0 |
len dd 0x00 |
labelt: db 'HTTPC - PgUp/PgDown' |
labellen: |
title db 'HTTPC - PgUp/PgDown',0 |
server_ip: db 207,44,212,20 |
dns_ip: db 194,145,128,1 |
/programs/network/https/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/https/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm https.asm https |
@erase lang.inc |
@pause |
/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 0x20000 |
dd 0x400000 |
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 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov [status],-1 |
mov [last_status],-2 |
98,10 → 98,10 |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
mov eax,11 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
ret |
button: ; button |
mov al,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; close |
jnz tst2 |
134,9 → 134,9 |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov eax,-1 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov [socket], eax |
mov [posy],1 |
mov [posx],0 |
167,14 → 167,14 |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov eax,5 |
mov ebx,2 |
int 0x40 |
mcall |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov [socket], eax |
no_re_open: |
245,7 → 245,7 |
je data_received |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
dec [retries] |
jnz wait_for_data |
jmp no_http_request |
280,7 → 280,7 |
mov ebx,7 |
mov ecx,[socket] |
mov esi,[filepos] |
int 0x40 |
mcall |
mov eax,esi |
add eax,edx |
312,16 → 312,16 |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
mov eax,11 |
int 0x40 |
mcall |
call check_events |
mov eax,53 |
mov ebx,255 |
mov ecx,103 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov eax,47 |
mov ebx,8*65536 |
353,7 → 353,7 |
mov ecx,edi |
mov edx,115*65536+178 |
mov esi,0x000000 |
int 0x40 |
mcall |
popa |
ret |
368,7 → 368,7 |
mov ecx,[socket] |
mov edx,h_len-html_header |
mov esi,html_header |
int 0x40 |
mcall |
mov eax,53 ; send file type |
mov ebx,7 |
375,7 → 375,7 |
mov ecx,[socket] |
mov edx,[type_len] |
mov esi,[file_type] |
int 0x40 |
mcall |
popa |
ret |
437,7 → 437,7 |
mov eax,70 |
mov ebx,filel |
int 0x40 |
mcall |
mov [board_size],ebx |
cmp [input_text+256+1],dword 'POST' |
599,7 → 599,7 |
mov eax,70 |
mov ebx,files |
int 0x40 |
mcall |
no_new_message: |
mov esi,0x20000 |
769,7 → 769,7 |
mov [fileinfo+12],dword 1 ; file exists ? |
mov eax,70 |
mov ebx,fileinfo |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
file_not_found: |
file_loaded: |
855,7 → 855,7 |
pusha |
mov eax,3 |
int 0x40 |
mcall |
mov ecx,3 |
new_time_digit: |
880,7 → 880,7 |
pusha |
mov eax,29 |
int 0x40 |
mcall |
mov ecx,3 |
add edi,6 |
910,7 → 910,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socket] |
int 0x40 |
mcall |
cmp eax,0 |
je _ret_now |
920,7 → 920,7 |
mov eax,53 |
mov ebx,2 |
mov ecx,[socket] |
int 0x40 |
mcall |
cmp eax,0 |
je _ret |
928,7 → 928,7 |
mov eax,53 |
mov ebx,3 |
mov ecx,[socket] |
int 0x40 |
mcall |
cmp bl,10 |
jne no_lf |
964,7 → 964,7 |
jne no_ld |
mov ebx,50 |
no_ld: |
int 0x40 |
mcall |
jmp check |
985,7 → 985,7 |
mov eax,53 |
mov ebx,6 |
mov ecx,[socket] |
int 0x40 |
mcall |
cmp eax,[status] |
je c_ret |
1021,11 → 1021,11 |
f11: |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 |
jne read_done |
mov eax,2 |
int 0x40 |
mcall |
shr eax,8 |
cmp eax,13 |
je read_done |
1083,7 → 1083,7 |
mov ecx,0x40000000 |
mov esi,23 |
mov edi,0xffffff |
int 0x40 |
mcall |
popa |
ret |
1098,7 → 1098,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,header ; WINDOW LABEL |
int 0x40 |
mov edi,title ; WINDOW LABEL |
mcall |
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 |
int 0x40 |
mcall |
; 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 |
int 0x40 |
mcall |
; Enter directory |
mov ebx,(25)*65536+66 |
1127,25 → 1127,25 |
mov ecx,135*65536+15 |
mov edx,6 |
mov esi,0x3388dd |
int 0x40 |
mcall |
mov eax,38 |
mov ebx,240*65536+240 |
mov ecx,22*65536+210 |
mov edx,0x6699cc ; 002288 |
int 0x40 |
mcall |
mov ebx,241*65536+241 |
mov ecx,22*65536+210 |
mov edx,0x336699 ; 002288 |
int 0x40 |
mcall |
call draw_data |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
1158,6 → 1158,7 |
mov ecx,0x000000 |
mov edx,text |
mov esi,35 |
mov eax,13 |
newline: |
pusha |
cmp ebx,25*65536+61 |
1170,13 → 1171,12 |
mov bx,35*6 |
shl ecx,16 |
mov cx,9 |
mov eax,13 |
mov edx,0xffffff |
int 0x40 |
mcall |
now: |
popa |
mov eax,4 |
int 0x40 |
mcall |
add ebx,13 |
add edx,40 |
cmp [edx],byte 'x' |
1199,10 → 1199,10 |
mov cx,9 |
mov eax,13 |
mov edx,0xffffff |
int 0x40 |
mcall |
popa |
mov eax,4 |
int 0x40 |
mcall |
add ebx,10 |
add edx,256 |
dec edi |
1294,7 → 1294,7 |
unkl: |
header db appname,version,0 |
title db appname,version,0 |
socket dd 0x0 |
server_active db 0x0 |
/programs/network/ipc/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/ipc/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@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,15 → 24,16 |
mov ebx,1 ; define receive area |
mov ecx,received_messages ; pointer to start |
mov edx,1000 ; size of area |
int 0x40 |
mcall |
mov eax,40 ; WANTED EVENTS |
mov ebx,01000111b ; IPC 7 + defaults |
int 0x40 |
mcall |
mov [received_messages+8],dword 0*256+0 |
mov [received_messages+12],dword 0 |
red: |
call draw_window ; at first, draw the window |
still: |
39,7 → 40,7 |
mov eax,23 ; wait here for event |
mov ebx,50 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je red |
56,23 → 57,19 |
jmp still |
red: ; redraw |
call draw_window |
jmp still |
key: ; key |
mov eax,2 ; just read it and ignore |
int 0x40 |
mcall |
jmp still |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jne noclose |
mov eax,-1 ; close this program |
int 0x40 |
mcall |
noclose: |
cmp ah,2 |
101,7 → 98,7 |
mov ecx,[PID] |
mov edx,message+4 |
mov esi,20;[message_size] |
int 0x40 |
mcall |
jmp still |
no_read: |
161,7 → 158,7 |
mov ebx,25*65536+245 |
mov ecx,105*65536+90 |
mov edx,0xdddddd |
int 0x40 |
mcall |
cmp [received_messages+4],dword 8 ; empty list |
je ipma1 |
179,7 → 176,7 |
mov eax,47 |
mov ebx,4*65536 |
mov esi,0xff0000 |
int 0x40 |
mcall |
popa |
pusha |
mov esi,20 |
186,7 → 183,7 |
add edx,8 |
add ebx,30*65536 |
mov eax,4 |
int 0x40 |
mcall |
popa |
add ebx,10 |
222,27 → 219,21 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,0x03ffffff ; color of work area RRGGBB,8->color gl |
int 0x40 |
mov edx,0x13ffffff ; color of work area RRGGBB,8->color gl |
mov edi,title ; WINDOW LABEL |
mcall |
; 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 |
int 0x40 |
mcall |
mov eax,47 |
mov ebx,4*65536 |
249,7 → 240,7 |
mov ecx,[process_info+30] |
mov edx,180*65536+35 |
mov esi,0x000000 |
int 0x40 |
mcall |
mov eax,8 ; MESSAGE |
mov ebx,25*65536+87 |
256,22 → 247,21 |
mov ecx,50*65536+16 |
mov edx,2 |
mov esi,0x5588dd |
int 0x40 |
mcall |
mov eax,8 ; POP |
;mov eax,8 ; POP |
mov ebx,216*65536+53 |
mov ecx,80*65536+16 |
mov edx,3 |
mov esi,0x5588dd |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,25*65536+35 ; draw info text with function 4 |
mov ecx,0x224466 |
mov edx,text |
mov esi,40 |
newline: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,10 |
add edx,40 |
cmp [edx],byte 'x' |
281,7 → 271,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
308,7 → 298,7 |
f11: |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 |
jz fbu |
319,7 → 309,7 |
fbu: |
mov eax,2 |
int 0x40 ; get key |
mcall ; get key |
shr eax,8 |
cmp eax,13 |
366,7 → 356,7 |
shl ecx,16 |
mov cx,8 |
mov edx,0xffffff |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,[xa] |
375,7 → 365,7 |
mov ecx,0x000000 |
mov edx,[addr] |
mov esi,25 |
int 0x40 |
mcall |
ret |
400,9 → 390,7 |
db 'x' ; <- END MARKER, DONT DELETE |
labelt: |
db 'IPC - START AT LEAST 2' |
labellen: |
title db 'IPC - START AT LEAST 2',0 |
I_END: |
/programs/network/local/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/local/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@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,10 → 26,11 |
mov ecx,0x2000 ; local port |
mov edx,0x3000 ; remote port |
mov esi,dword [host_ip] ; node IP |
int 0x40 |
mcall |
mov [socketNum], eax |
red: |
call draw_window ; at first, draw the window |
still: |
36,7 → 37,7 |
mov eax,23 ; wait here for event |
mov ebx,1 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
48,24 → 49,20 |
mov eax, 53 ; get data |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
cmp eax, 0 |
jne read |
jmp still |
red: |
call draw_window |
jmp still |
key: |
mov eax,2 |
int 0x40 |
mcall |
jmp still |
button: |
mov eax,17 |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jnz noclose |
72,9 → 69,9 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov eax,-1 |
int 0x40 |
mcall |
noclose: |
cmp ah,2 ; SEND CODE ? |
96,7 → 93,7 |
mov ecx,[socketNum] |
mov edx,23 + 4 |
mov esi,I_END |
int 0x40 |
mcall |
jmp still |
no_left: |
116,7 → 113,7 |
mov ecx,[socketNum] |
mov edx,23 + 4 |
mov esi,I_END |
int 0x40 |
mcall |
jmp still |
no_right: |
159,7 → 156,7 |
mov ecx,[socketNum] |
mov edx,23 + remote_code_end - remote_code_start |
mov esi,I_END |
int 0x40 |
mcall |
jmp still |
173,7 → 170,7 |
mov ecx,[socketNum] |
mov edx,19 |
mov esi,execute |
int 0x40 |
mcall |
mov edi,3 |
196,7 → 193,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
shl edx,8 |
mov dl,bl |
213,7 → 210,7 |
add ebx,15 |
add ecx,35 |
add ebx,[picture_position] |
int 0x40 |
mcall |
inc [xx] |
cmp [xx],dword 128 |
230,7 → 227,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
cmp eax, 0 |
jne cfr007 ; yes, so get it |
249,7 → 246,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; DRAW WINDOW |
mov eax,0 ; function 0 : define and draw window |
256,17 → 253,9 |
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 esi,0x80aabbcc ; color of grab bar RRGGBB,8->color gl |
mov edi,0x00aabbcc ; color of frames RRGGBB |
int 0x40 |
mov edi,title ; WINDOW LABEL |
mcall |
; 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 |
273,38 → 262,35 |
mov ecx,181*65536+13 |
mov edx,2 |
mov esi,0x667788 |
int 0x40 |
mcall |
mov eax,8 ; LEFT |
;mov eax,8 ; LEFT |
mov ebx,60*65536+75 |
mov ecx,197*65536+13 |
mov edx,3 |
mov esi,0x667788 |
int 0x40 |
mcall |
mov eax,8 ; RIGHT |
;mov eax,8 ; RIGHT |
mov ebx,148*65536+72 |
mov ecx,197*65536+13 |
mov edx,4 |
mov esi,0x667788 |
int 0x40 |
mcall |
mov eax,8 ; SEND EXECUTE |
;mov eax,8 ; SEND EXECUTE |
mov ebx,60*65536+160 |
mov ecx,213*65536+13 |
mov edx,5 |
mov esi,0x667788 |
int 0x40 |
mcall |
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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
312,7 → 298,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
328,11 → 314,10 |
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 |
labeltext: db 'CLUSTER LOCAL' ; |
lte: |
title db 'CLUSTER LOCAL',0 |
socketNum dd 0x0 |
492,11 → 477,11 |
mov ebx,4 |
mov ecx,[0] |
mov edx,3*16 |
int 0x40 |
mcall |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
popa |
/programs/network/mp3s/trunk/build_en.bat |
---|
0,0 → 1,5 |
@erase lang.inc |
@echo lang fix en >lang.inc |
@fasm mp3s.asm mp3s |
@erase lang.inc |
@pause |
/programs/network/mp3s/trunk/build_ru.bat |
---|
0,0 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm mp3s.asm mp3s |
@erase lang.inc |
@pause |
/programs/network/mp3s/trunk/mp3s.asm |
---|
0,0 → 1,782 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
; ; |
; Tiny MP3 Shoutcast Server v0.1 (vt) ; |
; ; |
; Compile with FASM for Menuet ; |
; ; |
; Listening to port 8008 ; |
; Connect with eg: 192.168.1.22:8008 ; |
; ; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
version equ '0.3' |
use32 |
org 0x0 |
db 'MENUET01' ; 8 byte id |
dd 0x01 ; header version |
dd START ; program start |
dd I_END ; program image size |
dd 0x80000 ; memory usage |
dd 0x20000 ; stack |
dd 0,0 |
include 'lang.inc' |
include '..\..\..\macros.inc' |
; 0x0+ program image |
; 0x1ffff stack |
; 0x20000 work area for file read |
; 0x40000+ file send buffer ( 100 kb ) |
START: ; start of execution |
mov [status],0 |
call clear_input |
call draw_window ; at first, draw the window |
still: |
mov eax,23 ; wait here for event |
mov ebx,2 |
mcall |
call check_events |
call check_connection_status |
cmp [status],4 |
je start_transmission |
jmp still |
check_events: |
cmp eax,1 ; redraw request ? |
jz red |
cmp eax,2 ; key in buffer ? |
jz key |
cmp eax,3 ; button in buffer ? |
jz button |
ret |
red: ; redraw |
call draw_window |
ret |
key: |
mov eax,2 ; Just read it and ignore |
mcall |
ret |
button: ; button |
mov eax,17 ; get id |
mcall |
cmp ah,1 ; close |
jne no_close |
mov eax,-1 |
mcall |
no_close: |
cmp ah,2 ; button id=2 ? |
jnz tst3 |
; open socket |
mov eax,53 |
mov ebx,5 |
mov ecx,8008 ; local port # - http |
mov edx,0 ; no remote port specified |
mov esi,0 ; no remote ip specified |
mov edi,0 ; PASSIVE open |
mcall |
mov [socket], eax |
mov [posy],1 |
mov [posx],0 |
mov [read_on],1 |
call check_for_incoming_data |
call draw_window |
ret |
tst3: |
cmp ah,4 |
je close_socket |
cmp ah,6 |
je close_socket |
jmp no_socket_close |
close_socket: |
mov edx,eax |
; Close socket |
mov eax, 53 |
mov ebx, 8 |
mov ecx, [socket] |
mcall |
mov esp,0x1fff0 |
cmp dh,6 |
je read_string |
jmp still |
no_socket_close: |
cmp ah,9 |
jne no_bps_add |
add [bps],8*1000 |
call draw_window |
ret |
no_bps_add: |
cmp ah,8 |
jne no_bps_sub |
sub [bps],8*1000 |
call draw_window |
ret |
no_bps_sub: |
ret |
clear_input: |
mov edi,input_text |
mov eax,0 |
mov ecx,60*40 |
cld |
rep stosb |
ret |
read_string: |
mov [addr],dword filename |
mov [ya],dword 95 |
mov edi,[addr] |
mov eax,32 |
mov ecx,30 |
cld |
rep stosb |
call print_text |
mov edi,[addr] |
f11: |
mov eax,10 |
mcall |
cmp eax,2 |
jne read_done |
mov eax,2 |
mcall |
shr eax,8 |
cmp eax,13 |
je read_done |
cmp eax,8 |
jnz nobsl |
cmp edi,[addr] |
jz f11 |
sub edi,1 |
mov [edi],byte 32 |
call print_text |
jmp f11 |
nobsl: |
cmp eax,dword 31 |
jbe f11 |
cmp eax,dword 95 |
jb keyok |
sub eax,32 |
keyok: |
mov [edi],al |
call print_text |
add edi,1 |
mov esi,[addr] |
add esi,30 |
cmp esi,edi |
jnz f11 |
read_done: |
mov ecx,40 |
mov eax,0 |
cld |
rep movsb |
call print_text |
jmp still |
print_text: |
pusha |
mov eax,13 |
mov ebx,56*65536+30*6 |
mov ecx,[ya] |
shl ecx,16 |
mov cx,8 |
mov edx,0xffffff |
mcall |
mov eax,4 |
mov edx,[addr] |
mov ebx,56*65536 |
add ebx,[ya] |
mov ecx,0x000000 |
mov esi,30 |
mcall |
popa |
ret |
wait_for dd 0x0 |
transmission_start dd 0x0 |
sentbytes dd 0x0 |
start_transmission: |
call clear_input |
mov eax,5 |
mov ebx,50 |
mcall |
call check_for_incoming_data |
call draw_window |
call send_header |
mov [fileinfo+4],dword 0 ; start from beginning |
mov [read_to],0x40000 |
mov [playpos],0x40000 |
mov ecx,1024 / 512 |
new_buffer: |
mov eax,[read_to] |
mov ebx,1 |
call read_file |
loop new_buffer |
newpart: |
call check_connection_status |
call draw_window |
mov eax,26 |
mov ebx,9 |
mcall |
mov [transmission_start],eax |
mov [sentbytes],0 |
newblock: |
mov eax,[read_to] |
mov ebx,2 |
call read_file |
wait_more: |
mov eax,26 |
mov ebx,9 |
mcall |
cmp eax,[wait_for] |
jge nomw |
mov eax,5 |
mov ebx,1 |
mcall |
jmp wait_more |
nomw: |
add eax,2 |
mov [wait_for],eax |
mov eax,11 |
mcall |
call check_events |
mov eax,53 |
mov ebx,255 |
mov ecx,103 |
mcall |
cmp eax,0 |
jne wait_more |
; write to socket |
mov eax,53 |
mov ebx,7 |
mov ecx,[socket] |
mov edx,[playadd] |
mov esi,[playpos] |
mcall |
add [sentbytes],edx |
mov esi,[playpos] |
add esi,[playadd] |
mov edi,0x40000 |
mov ecx,110000 / 4 |
cld |
rep movsd |
mov eax,[playadd] |
sub [read_to],eax |
call check_for_incoming_data |
call show_progress |
call check_rate |
mov eax, 53 |
mov ebx, 6 |
mov ecx, [socket] |
mcall |
cmp eax,4 |
jne end_stream |
cmp [read_to],0x40000 |
jge newblock |
end_stream: |
; Close socket |
mov eax, 53 |
mov ebx, 8 |
mov ecx, [socket] |
mcall |
mov eax,5 |
mov ebx,5 |
mcall |
; Open socket |
mov eax,53 |
mov ebx,5 |
mov ecx,8008 ; local port # - http |
mov edx,0 ; no remote port specified |
mov esi,0 ; no remote ip specified |
mov edi,0 ; PASSIVE open |
mcall |
mov [socket], eax |
mov [posy],1 |
mov [posx],0 |
mov [read_on],0 |
call draw_window |
jmp still |
check_rate: |
pusha |
mov eax,[bps] |
xor edx,edx |
mov ebx,8*100 |
div ebx |
shl eax,1 |
mov [playadd],eax |
mov eax,26 |
mov ebx,9 |
mcall |
sub eax,[transmission_start] |
shr eax,1 |
imul eax,[playadd] |
mov edx,0x00dd00 |
cmp [sentbytes],eax |
jge sendok |
sub eax,20000 |
cmp [sentbytes],eax ; a long buffer underrun correction |
jge no_buffer_overrun ; actually leads to overrun |
mov [sentbytes],eax |
no_buffer_overrun: |
add [playadd],150 |
mov edx,0xdd0000 |
sendok: |
mov eax,13 |
mov ebx,320*65536+10 |
mov ecx,105*65536+10 |
mcall |
mov eax,47 |
mov ebx,4*65536 |
mov ecx,[playadd] |
mov edx,322*65536+106 |
mov esi,0x000000 |
; mcall |
popa |
ret |
show_progress: |
pusha |
mov eax,13 |
mov ebx,236*65536+10*6 |
mov ecx,107*65536+8 |
mov edx,0xffffff |
mcall |
mov ecx,[fileinfo+4] |
imul ecx,512 |
mov eax,47 ; file read |
mov ebx,9*65536 |
mov edx,236*65536+107 |
mov esi,0x000000 |
mcall |
popa |
ret |
playpos dd 0x100000 |
playadd dd 256000 / 8 / 100 |
send_header: |
pusha |
mov [playpos],0x40000 |
mov esi,fileinfo+5*4 |
mov edi,transname |
mov ecx,30 |
cld |
rep movsb |
mov eax, 53 |
mov ebx, 7 |
mov ecx, [socket] |
mov edx, headere-headers |
mov esi, headers |
mcall |
popa |
ret |
read_file: |
cmp [read_to],0x40000+2000 |
jg cache_ok |
mov [read_on],1 |
cache_ok: |
cmp [read_to],0x40000+95500 |
jg no_read_1 |
mov [fileinfo+12],eax |
mov [fileinfo+8],ebx |
mov eax,58 |
mov ebx,fileinfo |
mcall |
cmp eax,0 |
jne no_read_1 |
mov eax,[fileinfo+8] |
add [fileinfo+4],eax |
add [read_to],512*2 |
ret |
no_read_1: |
mov [read_on],0 |
ret |
check_for_incoming_data: |
pusha |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socket] |
mcall |
cmp eax,0 |
je _ret_now |
new_data: |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socket] |
mcall |
cmp eax,0 |
je _ret |
mov eax,53 |
mov ebx,3 |
mov ecx,[socket] |
mcall |
cmp bl,10 |
jne no_lf |
inc [posy] |
mov [posx],0 |
jmp new_data |
no_lf: |
cmp bl,20 |
jb new_data |
inc [posx] |
cmp [posx],60 |
jbe xok |
inc [posy] |
mov [posx],0 |
xok: |
cmp [posy],12 |
jbe yok |
mov [posy],1 |
yok: |
mov eax,[posy] |
imul eax,60 |
add eax,[posx] |
mov [input_text+eax],bl |
jmp new_data |
_ret: |
; call draw_window |
_ret_now: |
popa |
ret |
check_connection_status: |
pusha |
mov eax, 53 |
mov ebx, 6 |
mov ecx, [socket] |
mcall |
cmp eax,[status] |
je .ccs_ret |
mov [status],eax |
add eax,48 |
mov [text+20],al |
call draw_window |
.ccs_ret: |
popa |
ret |
; ********************************************* |
; ******* WINDOW DEFINITIONS AND DRAW ******** |
; ********************************************* |
draw_window: |
pusha |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
mcall |
mov eax,0 ; Draw Window |
mov ebx,50*65536+410 |
mov ecx,100*65536+141 |
mov edx,0x13ffffff |
mov edi,title |
mcall |
mov eax,8 ; Start server |
mov ebx,(25)*65536+21 |
mov ecx,57*65536+10 |
mov edx,2 |
mov esi,0x409040 |
mcall ; Stop server |
; mov eax,8 |
mov ebx,(25)*65536+21 |
mov ecx,69*65536+10 |
mov edx,4 |
mov esi,0x904040 |
mcall |
mov esi,0x3366d0 |
; mov eax,8 ; Enter filename |
mov ebx,(25)*65536+21 |
mov ecx,93*65536+10 |
mov edx,6 |
mcall |
; mov eax,8 ; Decrease transfer rate |
mov ebx,(25)*65536+10 |
mov ecx,105*65536+10 |
; mov edx,8 |
mcall |
; mov eax,8 ; Increase transfer rate |
mov ebx,(36)*65536+10 |
mov ecx,105*65536+10 |
mov edx,9 |
mcall |
mov ebx,10*65536+35 ; draw info text |
mov ecx,0x00000000 |
mov edx,text |
mov esi,40 |
newline: |
mov eax,4 |
mcall |
add ebx,12 |
add edx,40 |
cmp [edx],byte 'x' |
jnz newline |
mov eax,4 ; Filename |
mov ebx,56*65536+95 |
mov ecx,0x000000 |
mov edx,filename |
mov esi,30 |
mcall |
mov eax,[bps] |
xor edx,edx |
mov ebx,1000 |
div ebx |
mov ecx,eax |
mov eax,47 |
mov ebx,3*65536 |
mov edx,58*65536+107 |
mov esi,0x00000000 |
mcall |
mov [input_text+0],dword 'RECE' |
mov [input_text+4],dword 'IVED' |
mov [input_text+8],dword ': ' |
mov ebx,230*65536+35 ; draw info text |
mov ecx,0x00000000 |
mov edx,input_text |
mov esi,28 |
mov edi,7 |
newline2: |
mov eax,4 |
mcall |
add ebx,10 |
add edx,60 |
dec edi |
jnz newline2 |
mov eax,38 |
mov ebx,210*65536+210 |
mov ecx,22*65536+136 |
mov edx,0x6699cc ; 002288 |
mcall |
mov eax,38 |
mov ebx,211*65536+211 |
mov ecx,22*65536+136 |
mov edx,0x336699 ; 002288 |
mcall |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
mcall |
popa |
ret |
; DATA AREA |
text: |
db ' TCB status: 0 ' |
db ' ' |
db ' Activate - port 8008 ' |
db ' Stop server ' |
db ' ' |
db ' > ' |
db ' < > Kbps ' |
db 'x'; <- END MARKER, DONT DELETE |
headers: |
db 'ICY 200 OK',13,10 |
db 'icy-notice1:This stream requires Winamp or xmms',13,10 |
db 'icy-url:http://www.menuetos.org',13,10 |
db 'icy-pub: 1',13,10 |
db 'icy-name: Menuet Mp3 Shoutcast Radio ',version,' - ' |
transname: |
db ' ',13,10,13,10 |
headere: |
title db 'MP3 shoutcast server ',version,0 |
socket dd 0 |
status dd 0 |
posy dd 1 |
posx dd 0 |
read_on db 1 |
read_to dd 0 |
addr dd 0 |
ya dd 0 |
bps dd 128*1000 |
fileinfo: dd 0,0,0,0,0x20000 |
filename: db '/RD/1/MENUET.MP3',0 |
times 50 db 0 |
input_text: |
I_END: |
/programs/network/netsendc/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/netsendc/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm netsendc.asm netsendc |
@erase lang.inc |
@pause |
/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 |
int 0x40 |
mcall |
mov [socketNum], eax |
44,7 → 44,7 |
still: |
mov eax,10 ; wait here for event |
int 0x40 |
mcall |
dec eax |
jz red |
53,12 → 53,12 |
key: |
mov al,2 |
int 0x40 |
mcall |
jmp still |
button: |
mov al,17 |
int 0x40 |
mcall |
dec ah ; button id=1 ? |
jnz noclose |
65,9 → 65,9 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mov eax,-1 |
int 0x40 |
mcall |
or eax,-1 |
mcall |
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 |
int 0x40 |
mcall |
jmp still |
98,22 → 98,16 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,0x03ffffff ; color of work area RRGGBB |
int 0x40 |
mov edx,0x13ffffff ; color of work area RRGGBB |
mov edi,title ; WINDOW LABEL |
mcall |
; 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 |
120,15 → 114,15 |
mov ecx,47*65536+13 |
mov edx,2 |
mov esi,0x667788 |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,25*65536+50 ; draw info text with function 4 |
mov ecx,0x000000 |
mov edx,text |
mov esi,40 |
newline: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,esi |
cmp [edx],byte 'x' |
136,7 → 130,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
161,8 → 155,7 |
db 'x' ; <- END MARKER, DONT DELETE |
end if |
labeltext: db 'NetSend(Client)' ; |
lte: |
title db 'NetSend(Client)',0 |
remote_ip db 192,168,1,2 |
/programs/network/netsends/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/netsends/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm netsends.asm netsends |
@erase lang.inc |
@pause |
/programs/network/netsends/trunk/netsends.asm |
---|
12,18 → 12,17 |
; |
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 |
34,10 → 33,11 |
mov ecx, 0x5000 ; local port |
mov edx, 0xffff ; remote port |
mov esi, dword [remote_ip] ; remote IP |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
56,7 → 56,7 |
mov eax,53 ; data from cluster terminal ? |
mov ebx,2 |
mov ecx,[socketNum] |
int 0x40 |
mcall |
cmp eax,0 |
jne data_arrived |
63,13 → 63,9 |
jmp still |
red: |
call draw_window |
jmp still |
key: |
mov eax,2 |
int 0x40 |
mcall |
jmp still |
button: |
77,9 → 73,9 |
mov eax,53 |
mov ebx,1 |
mov ecx,[socketNum] |
int 0x40 |
mov eax,-1 |
int 0x40 |
mcall |
or eax,-1 |
mcall |
data_arrived: |
86,7 → 82,7 |
mov eax,5 ; wait a second for everything to arrive |
mov ebx,10 |
int 0x40 |
mcall |
mov edi,I_END |
95,7 → 91,7 |
mov eax,53 |
mov ebx,3 |
mov ecx,[socketNum] |
int 0x40 |
mcall |
mov [edi],bl |
inc edi |
103,7 → 99,7 |
mov eax,53 |
mov ebx,2 |
mov ecx,[socketNum] |
int 0x40 |
mcall |
cmp eax,0 |
jne get_data |
114,7 → 110,7 |
mov ecx,0x000000 |
mov edx,I_END |
mov esi,100 |
int 0x40 |
mcall |
add [y],10 |
133,41 → 129,26 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,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 edx,0x13ffffff ; color of work area RRGGBB |
mov edi,title ; WINDOW LABEL |
mcall |
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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
176,7 → 157,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
197,8 → 178,7 |
db 'x' ; <- END MARKER, DONT DELETE |
end if |
labeltext: db 'NetSend(Server)' |
lte: |
title db 'NetSend(Server)',0 |
socketNum dd 0x0 |
/programs/network/nntpc/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/nntpc/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm nntpc.asm nntpc |
@erase lang.inc |
@pause |
/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] |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov ecx,-14 |
mov eax,[prev_state] |
123,7 → 123,7 |
mov ebx,435*65536+42 |
mov ecx,0x000000 |
mov esi,12 |
int 0x40 |
mcall |
no_cos: |
150,13 → 150,13 |
call draw_entries |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 |
jne no_more_text |
mov eax,2 |
int 0x40 |
mcall |
cmp ah,8 |
jne no_bg |
225,7 → 225,7 |
mov ecx,[socket] |
mov edx,[grouplen] |
mov esi,group |
int 0x40 |
mcall |
mov [status],3 |
call clear_text |
call save_coordinates |
320,7 → 320,7 |
mov ecx,[socket] |
mov edx,[statlen] ; -stat |
mov esi,stat |
int 0x40 |
mcall |
mov [status],5 |
call save_coordinates |
ret |
333,7 → 333,7 |
mov ecx,[socket] |
mov edx,articlelen-article |
mov esi,article |
int 0x40 |
mcall |
mov [status],7 |
call save_coordinates |
ret |
485,7 → 485,7 |
mov eax,5 |
mov ebx,10 |
int 0x40 |
mcall |
call check_for_incoming_data |
499,7 → 499,7 |
mov eax,40 |
mov ebx,10000111b |
int 0x40 |
mcall |
call clear_text |
512,7 → 512,7 |
mov eax,23 ; wait here for event |
mov ebx,5 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je red |
533,7 → 533,7 |
key: ; key |
mov eax,2 ; just read it and ignore |
int 0x40 |
mcall |
cmp ah,' ' |
jne no_space |
581,7 → 581,7 |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
shr eax,8 |
628,7 → 628,7 |
jne no_start |
call clear_text |
mov eax,3 |
int 0x40 |
mcall |
mov ecx,eax |
mov eax,53 |
mov ebx,5 |
635,7 → 635,7 |
mov edx,119 |
mov esi,dword [server_ip] |
mov edi,1 |
int 0x40 |
mcall |
mov [socket],eax |
mov [status],1 |
jmp still |
648,22 → 648,22 |
mov ecx,[socket] |
mov edx,quitlen-quit |
mov esi,quit |
int 0x40 |
mcall |
mov eax,5 |
mov ebx,10 |
int 0x40 |
mcall |
call check_for_incoming_data |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov eax,5 |
mov ebx,5 |
int 0x40 |
mcall |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
noclose: |
jmp still |
687,7 → 687,7 |
mov eax,53 |
mov ebx,2 |
mov ecx,[socket] |
int 0x40 |
mcall |
cmp eax,0 |
je ch_ret |
695,7 → 695,7 |
mov eax,53 |
mov ebx,3 |
mov ecx,[socket] |
int 0x40 |
mcall |
and ebx,0xff |
728,7 → 728,7 |
mov eax,53 |
mov ebx,2 |
mov ecx,[socket] |
int 0x40 |
mcall |
cmp eax,0 |
jne check_for_incoming_data |
754,35 → 754,25 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,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 edx,0x13ffffff ; color of work area RRGGBB,8->color gl |
mov edi,title ; WINDOW LABEL |
mcall |
mov eax,38 |
mov ebx,5*65536+515 |
mov ecx,101*65536+101 |
mov edx,0x99bbff |
int 0x40 |
mov eax,38 |
mov ebx,5*65536+515 |
mcall |
mov ecx,102*65536+102 |
mov edx,0x3366aa |
int 0x40 |
mcall |
; 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 |
789,28 → 779,21 |
mov ecx,30*65536+8 |
mov edx,11 |
mov esi,0x88aadd |
int 0x40 |
mov eax,8 |
mov ebx,238*65536+8 |
mcall |
mov ecx,41*65536+8 |
mov edx,12 |
int 0x40 |
mov eax,8 |
mov ebx,238*65536+8 |
mcall |
mov ecx,52*65536+8 |
mov edx,13 |
int 0x40 |
mcall |
mov eax,8 |
mov ebx,265*65536+75 |
mov ecx,39*65536+13 |
mov edx,14 |
int 0x40 |
mov eax,8 |
mcall |
mov ebx,351*65536+75 |
mov ecx,39*65536+13 |
mov edx,15 |
int 0x40 |
mcall |
call draw_entries |
818,7 → 801,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
popa |
833,18 → 816,16 |
mov ebx,30*65536+200 |
mov ecx,30*65536+44 |
mov edx,0xffffff |
int 0x40 |
mcall |
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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,11 |
add edx,66 |
dec edi |
862,7 → 843,7 |
mov eax,9 |
mov ebx,0x70000 |
mov ecx,-1 |
int 0x40 |
mcall |
mov eax,[0x70000+46] |
cmp eax,150 |
876,7 → 857,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] |
883,8 → 864,8 |
imul edx,80 |
add edx,nntp_text |
mov esi,80 |
newline: |
pusha |
mov ecx,ebx |
shl ecx,16 |
892,11 → 873,10 |
mov ebx,20*65536+80*6 |
mov cx,10 |
mov edx,0xffffff |
int 0x40 |
mcall |
popa |
mov eax,4 |
int 0x40 |
mcall |
add ebx,10 |
add edx,80 |
dec edi |
922,9 → 902,7 |
textl: |
labelt: |
db 'NNTP client v',version |
labellen: |
title db 'NNTP client v',version,0 |
nntp_text: |
/programs/network/popc/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm popc.asm popc |
@erase lang.inc |
@pause |
/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 |
int 0x40 |
mcall |
test eax,eax |
jz @f |
52,6 → 52,8 |
mov ebp,0 |
mov edx,I_END |
redraw: ; redraw |
call draw_window ; at first, draw the window |
still: |
58,10 → 60,10 |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
mov eax,11 ; wait here for event |
int 0x40 |
mcall |
cmp eax,1 ; redraw |
je redraw |
106,7 → 108,7 |
mov [ebx+12],eax |
mov eax,70 |
int 0x40 |
mcall |
popa |
150,7 → 152,7 |
mov eax,53 |
mov ebx,7 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [mcounter],0 |
cmp [esi],dword 'quit' |
175,12 → 177,12 |
mov ecx,[socket] |
mov edx,14 |
mov esi,quitc |
int 0x40 |
mcall |
mov [mcounter],0 |
mov eax,5 |
mov ebx,150 |
int 0x40 |
mcall |
call read_incoming_data |
187,16 → 189,16 |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov eax,5 |
mov ebx,2 |
int 0x40 |
mcall |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [server_active],0 |
209,16 → 211,10 |
;; |
redraw: ; redraw |
call draw_window |
jmp still |
key: |
mov eax,2 |
int 0x40 |
mcall |
jmp still |
226,13 → 222,13 |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,60 |
jne no_open |
mov eax, 70 |
mov ebx, tinypad_start |
int 0x40 |
mcall |
jmp still |
no_open: |
239,7 → 235,7 |
cmp ah,1 ; close program |
jne noclose |
mov eax,-1 |
int 0x40 |
mcall |
noclose: |
cmp ah,51 |
270,10 → 266,10 |
mov [ccounter],0 |
mov eax,3 |
int 0x40 |
mcall |
mov eax,3 |
int 0x40 |
mcall |
mov ecx,eax |
and ecx,0xffff |
282,7 → 278,7 |
mov edx,110 |
mov esi,dword [ip] |
mov edi,1 |
int 0x40 |
mcall |
mov [socket], eax |
ret |
294,7 → 290,7 |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [header_sent],0 |
mov [mail_rp],0 |
mov [server_active],0 |
320,7 → 316,7 |
mov eax,53 |
mov ebx,6 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [status],eax |
335,7 → 331,7 |
mov ebx,200*65536+30 |
mov ecx,160*65536+10 |
mov edx,0xffffff |
int 0x40 |
mcall |
pop ecx |
346,7 → 342,7 |
mov ebx,3*65536 |
mov edx,200*65536+160 |
mov esi,0x000000 |
int 0x40 |
mcall |
nopr: |
449,11 → 445,11 |
f11: |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 |
jne read_done |
mov eax,2 |
int 0x40 |
mcall |
shr eax,8 |
cmp eax,13 |
je read_done |
549,7 → 545,7 |
shl ecx,16 |
mov cx,9 |
mov edx,0xffffff |
int 0x40 |
mcall |
cmp [len],l3 |
je noprt |
560,7 → 556,7 |
add ebx,[ya] |
mov ecx,0x000000 |
mov esi,23 |
int 0x40 |
mcall |
noprt: |
778,7 → 774,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socket] |
int 0x40 |
mcall |
mov ecx,-1 |
788,7 → 784,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socket] |
int 0x40 |
mcall |
mov ecx,0 |
810,7 → 806,7 |
mov eax,12 |
mov ebx,1 |
int 0x40 |
mcall |
mov eax,0 ; draw window |
mov ebx,5*65536+435 |
817,7 → 813,7 |
mov ecx,5*65536+232 |
mov edx,0x13ffffff |
mov edi,labelt |
int 0x40 |
mcall |
mov [old_status],300 |
826,7 → 822,7 |
mov ecx,155*65536+10 |
mov edx,22 |
mov esi,0x44cc44 |
int 0x40 |
mcall |
; mov eax,8 ; button: close socket |
mov ebx,295*65536+22 |
833,7 → 829,7 |
mov ecx,155*65536+10 |
mov edx,24 |
mov esi,0xcc4444 |
int 0x40 |
mcall |
; mov eax,8 ; button: text entries |
mov ebx,243*65536+8 |
841,7 → 837,7 |
mov edx,51 |
mov esi,0x4488dd |
newi: |
int 0x40 |
mcall |
inc edx |
add ecx,12*65536 |
cmp edx,53 |
852,13 → 848,13 |
mov ecx,190*65536+14 |
mov edx,60 |
mov esi,0x5577dd |
int 0x40 |
mcall |
mov eax,38 ; line |
mov ebx,5*65536+430 |
mov ecx,114*65536+114 |
mov edx,0x000000 |
int 0x40 |
mcall |
mov ebx,5*65536+133 ; info text |
mov ecx,0x000000 |
866,7 → 862,7 |
mov esi,70 |
newline: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,12 |
add edx,70 |
cmp [edx],byte 'x' |
877,7 → 873,7 |
mov eax,12 |
mov ebx,2 |
int 0x40 |
mcall |
popa |
902,12 → 898,12 |
mov bx,word [rxs] |
imul bx,6 |
mov edx,0xffffff |
int 0x40 |
mcall |
popa |
push ecx |
mov eax,4 |
mov ecx,0 |
int 0x40 |
mcall |
add edx,[rxs] |
add ebx,10 |
pop ecx |
/programs/network/ppp/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/ppp/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm ppp.asm ppp |
@erase lang.inc |
@pause |
/programs/network/ppp/trunk/ppp.asm |
---|
60,20 → 60,18 |
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 |
87,7 → 85,7 |
mov eax, 52 ; Stack Interface |
mov ebx, 0 ; read configuration word |
int 0x40 |
mcall |
mov ecx, eax |
shr ecx, 16 ; get the port address |
mov [comport], ecx |
109,13 → 107,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 |
int 0x40 |
mcall |
cmp eax, 1 ; redraw request ? |
je red |
129,18 → 127,14 |
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 |
int 0x40 |
mcall |
jmp apploop |
button: ; button |
mov eax, 17 ; get id |
int 0x40 |
mcall |
cmp ah, 1 ; close program ? |
jne noclose |
152,8 → 146,8 |
call disable_port |
mov eax, -1 ; close this program |
int 0x40 |
or eax, -1 ; close this program |
mcall |
jmp apploop |
noclose: |
173,10 → 167,10 |
flush_input: |
mov eax,42 |
mov ebx, [comirq] |
int 0x40 |
mcall |
mov eax,11 ; This will return 0 most of the time |
int 0x40 |
mcall |
mov ebx, [comirq] |
add ebx, 16 |
cmp eax, ebx |
200,7 → 194,7 |
mov eax, 23 |
mov ebx, 100 |
int 0x40 ; wait for 1s to display message |
mcall ; wait for 1s to display message |
call PPPStateMachine ; This is the main code |
225,12 → 219,12 |
PPPLoop: |
mov eax, 11 ; check event |
int 0x40 |
mcall |
cmp eax, 3 |
jne PPPLred |
; button pressed |
mov eax, 17 ; get id |
int 0x40 |
mcall |
mov eax, hangp |
246,7 → 240,7 |
call disable_port |
mov eax, -1 ; close this program |
int 0x40 |
mcall |
jmp PPPLoop |
PPPLred: |
267,7 → 261,7 |
mov eax, 42 |
mov ebx, [comirq] ; ecx will return 0 =data read, 1 =no data |
int 0x40 ; or 2 =not irq owner |
mcall ; or 2 =not irq owner |
inc dword [rxbytes] |
426,7 → 420,7 |
mov eax,43 |
mov ecx, [comport] |
add ecx, 0x80000000 + 5 |
int 0x40 |
mcall |
and bl, 0x40 |
cmp bl, 0 |
jz wait_txd2 ; loop until free |
440,7 → 434,7 |
mov ecx, [comport] |
mov eax, 43 |
int 0x40 |
mcall |
ppp_003: |
mov eax, [packet] |
698,7 → 692,7 |
mov cl, [addr2] |
shl ecx, 8 |
mov cl, [addr1] |
int 0x40 ; Set the stacks IP address |
mcall ; Set the stacks IP address |
popa |
735,7 → 729,7 |
mov ebx, 6 |
mov edx, 1500 ; this should be exact amount |
mov esi, rx_str + 4 |
int 0x40 |
mcall |
; Debugging output to debug board |
pusha |
883,7 → 877,7 |
; 10ms Delay suggested by Ville |
mov eax,23 ; over here |
mov ebx,1 |
int 0x40 |
mcall |
902,7 → 896,7 |
mov eax, 52 |
mov ebx, 8 |
mov esi, ip_buff |
int 0x40 |
mcall |
cmp eax, 0 |
je ppp_013 |
1225,13 → 1219,13 |
and ecx, 0xFF0 |
mov edx, ecx |
or edx, 0x00F |
int 0x40 |
mcall |
end if |
mov eax, 45 ; free irq 4 |
mov ebx, 1 |
mov ecx, [comirq] |
int 0x40 |
mcall |
mov eax, 46 ; free port area |
mov ebx, 1 |
1240,7 → 1234,7 |
and ecx, 0xFF0 |
mov edx, ecx |
or edx, 0x00F |
int 0x40 |
mcall |
ret |
1263,12 → 1257,12 |
and ecx, 0xFF0 |
mov edx, ecx |
or edx, 0x00F |
int 0x40 ; reseve port memory to this process |
mcall ; reseve port memory to this process |
mov eax, 45 ; reserve irq 3 |
mov ebx, 0 |
mov ecx, 3 |
int 0x40 |
mcall |
mov ecx, 0x2f8 ; data format register |
1275,24 → 1269,24 |
add ecx, 3 |
mov bl, 0x80 ; enable access to divisor latch |
mov eax, 43 ; send data to device - com port setup |
int 0x40 |
mcall |
mov ecx, 0x2f8 ; interrupt enable register |
inc ecx |
mov bl, 0 ; No interruts enabled |
mov eax, 43 ; send data to device (modem) |
int 0x40 |
mcall |
mov ecx, 0x2f8 ; Divisor latch LSB |
mov bl, BAUDRATE ; set baud rate |
mov eax, 43 ; send data to device (modem) |
int 0x40 |
mcall |
mov ecx, 0x2f8 ; Data format register |
add ecx, 3 |
mov bl, 3 ; 8 data bits |
mov eax, 43 ; send data to device (modem) |
int 0x40 |
mcall |
mov ecx, 0x2f8 ; Modem control register |
add ecx, 4 ; ** bl must be 0x0b for modem to dial! |
1299,13 → 1293,13 |
mov bl, 0x0b ; 0x08 -> out2 enabled. No handshaking. |
; 0xb -> out2 enabled, RTS/DTR enabled |
mov eax, 43 ; send data to device (modem) |
int 0x40 |
mcall |
; 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) |
; int 0x40 |
; mcall |
end if |
1315,40 → 1309,40 |
and ecx, 0xFF0 |
mov edx, ecx |
or edx, 0x00F |
int 0x40 ; reseve port memory to this process |
mcall ; reseve port memory to this process |
mov eax, 45 ; reserve irq 4 |
mov ebx, 0 |
mov ecx, [comirq] |
int 0x40 |
mcall |
mov eax, 44 ; setup irq table |
mov ebx, irqtable |
mov ecx, [comirq] |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov ecx, [comport] ; interrupt enable register |
inc ecx |
mov bl, 0 ; No interruts enabled |
mov eax, 43 ; send data to device (modem) |
int 0x40 |
mcall |
mov ecx, [comport] ; Divisor latch LSB |
mov bl, BAUDRATE ; set baud rate |
mov eax, 43 ; send data to device (modem) |
int 0x40 |
mcall |
mov ecx, [comport] ; Data format register |
add ecx, 3 |
mov bl, 3 ; 8 data bits |
mov eax, 43 ; send data to device (modem) |
int 0x40 |
mcall |
mov ecx, [comport] ; Modem control register |
add ecx, 4 ; ** bl must be 0x0b for modem to dial! |
1355,13 → 1349,13 |
mov bl, 0x0b ; 0x08 -> out2 enabled. No handshaking. |
; 0xb -> out2 enabled, RTS/DTR enabled |
mov eax, 43 ; send data to device (modem) |
int 0x40 |
mcall |
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) |
int 0x40 |
mcall |
mov ecx, [comirq] |
add ecx, 16 |
1369,7 → 1363,7 |
shl ebx, cl |
add ebx, 111b |
mov eax,40 ; enable irq 4 data |
int 0x40 |
mcall |
popa |
ret |
1386,22 → 1380,15 |
draw_window: |
mov eax, 12 ; function 12:tell os about windowdraw |
mov ebx, 1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,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 |
mov edx,0x13224466 ; color of work area RRGGBB |
mov edi,title ; color of frames RRGGBB |
mcall |
; DIAL BUTTON |
mov eax, 8 ; function 8 : define and draw button |
mov ebx, (50)*65536+40 ; [x start] *65536 + [x size] |
1408,7 → 1395,7 |
mov ecx, 130*65536+12 ; [y start] *65536 + [y size] |
mov edx, 2 ; button id |
mov esi, 0x5599cc ; button color RRGGBB |
int 0x40 |
mcall |
mov ebx, 55*65536+133 ; Draw button text |
mov ecx, 0x00FFFFFF |
1417,7 → 1404,7 |
mov al, [button1_text_len] |
mov esi, eax |
mov eax, 4 |
int 0x40 |
mcall |
; DISCONNECT BUTTON |
mov eax, 8 ; function 8 : define and draw button |
mov ebx, (150)*65536+65 ; [x start] *65536 + [x size] |
1424,7 → 1411,7 |
mov ecx, 130*65536+12 ; [y start] *65536 + [y size] |
mov edx, 3 ; button id |
mov esi, 0x5599cc ; button color RRGGBB |
int 0x40 |
mcall |
mov ebx, 155*65536+133 ; Draw button text |
mov ecx, 0x00FFFFFF |
1433,7 → 1420,7 |
mov al, [button3_text_len] |
mov esi, eax |
mov eax, 4 |
int 0x40 |
mcall |
mov ebx, 5*65536+40 ; draw info text with function 4 |
mov ecx, 0x00FFFFFF |
1442,7 → 1429,7 |
mov al, [prompt_len] |
mov esi, eax |
mov eax, 4 |
int 0x40 |
mcall |
; Draw IP address |
mov edx, 10*65536+60 |
1450,25 → 1437,25 |
mov ebx, 0x00030000 |
movzx ecx, byte [addr1] |
mov eax, 47 |
int 0x40 |
mcall |
mov edx, 31*65536+60 |
mov esi, 0x00FFFFFF |
mov ebx, 0x00030000 |
movzx ecx, byte [addr2] |
mov eax, 47 |
int 0x40 |
mcall |
mov edx, 52*65536+60 |
mov esi, 0x00FFFFFF |
mov ebx, 0x00030000 |
movzx ecx, byte [addr3] |
mov eax, 47 |
int 0x40 |
mcall |
mov edx, 73*65536+60 |
mov esi, 0x00FFFFFF |
mov ebx, 0x00030000 |
movzx ecx, byte [addr4] |
mov eax, 47 |
int 0x40 |
mcall |
; Status byte |
mov edx, 100*65536+60 |
1476,7 → 1463,7 |
mov ebx, 0x00010000 |
movzx ecx, byte [state] |
mov eax, 47 |
int 0x40 |
mcall |
; bytes sent / received |
mov eax, 4 ; function 4 : write text to window |
1484,7 → 1471,7 |
mov ecx, 0x00ffffff ; color of text RRGGBB |
mov edx, txmsg ; pointer to text beginning |
mov esi, txmsglen-txmsg ; text length |
int 0x40 |
mcall |
mov eax, 4 ; function 4 : write text to window |
mov ebx, 10*65536+100 ; [x start] *65536 + [y start] |
1491,13 → 1478,13 |
mov ecx, 0x00ffffff ; color of text RRGGBB |
mov edx, rxmsg ; pointer to text beginning |
mov esi, rxmsglen-rxmsg ; text length |
int 0x40 |
mcall |
call draw_window_limited |
mov eax, 12 ; end of redraw |
mov ebx, 2 |
int 0x40 |
mcall |
ret |
1508,12 → 1495,9 |
mov ebx,80*65536+10*6 |
mov ecx,80*65536+10 |
mov edx,0x03224466 |
int 0x40 |
mov eax,13 |
mov ebx,80*65536+10*6 |
mcall |
mov ecx,100*65536+10 |
mov edx,0x03224466 |
int 0x40 |
mcall |
mov ebx, 0x000A0000 |
mov ecx, [txbytes] |
1520,7 → 1504,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] |
int 0x40 |
mcall |
mov ebx, 0x000A0000 |
mov ecx, [rxbytes] |
1527,7 → 1511,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] |
int 0x40 |
mcall |
ret |
1545,7 → 1529,7 |
push eax |
mov eax, 26 |
mov ebx, 9 |
int 0x40 ; get 100th second counter |
mcall ; get 100th second counter |
pop ebx |
sub eax, ebx ; This could have some funny side effecs if PPP |
; called within ebx seconds of startup |
1566,7 → 1550,7 |
gettimer: |
mov eax, 26 |
mov ebx, 9 |
int 0x40 ; get 100th second counter |
mcall ; get 100th second counter |
sub eax, [timerValue] |
ret |
1624,7 → 1608,7 |
; any data from modem? |
mov eax,11 ; This will return 0 most of the time |
int 0x40 |
mcall |
mov ecx, eax |
pop edx |
pop eax |
1660,7 → 1644,7 |
push eax |
mov eax,42 |
mov ebx, [comirq] |
int 0x40 |
mcall |
pop eax |
pop edx |
1785,7 → 1769,7 |
push edi |
mov eax, 5 |
mov ebx, 1 |
int 0x40 ; 10ms delay |
mcall ; 10ms delay |
pop edi |
; send the character |
1796,7 → 1780,7 |
inc eax |
push eax |
mov eax, 43 |
int 0x40 |
mcall |
pop eax |
pop edx |
1881,7 → 1865,7 |
wait_txd2t: |
mov eax,43 |
mov ecx,0x80000000 + 0x2f8 + 5 |
int 0x40 |
mcall |
and bl, 0x40 |
cmp bl, 0 |
jz wait_txd2t ; loop until free |
1893,7 → 1877,7 |
mov ecx, 0x2f8 |
mov eax, 43 |
int 0x40 |
mcall |
ret |
1924,7 → 1908,7 |
mov eax,63 |
mov ebx, 1 |
push esi |
int 0x40 |
mcall |
pop esi |
inc esi |
jmp debug_print_string |
2159,8 → 2143,7 |
prompt_len db 0 |
; Application Title |
labelt db 'PPP Dialer' |
labellen: |
title db 'PPP Dialer',0 |
txmsg: db 'Tx bytes :' |
txmsglen: |
/programs/network/rccc/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/rccc/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm rccc.asm rccc |
@erase lang.inc |
@pause |
/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 |
int 0x40 |
mcall |
mov [socket], eax |
43,8 → 43,9 |
mov ecx,[socket] |
mov edx,1 |
mov esi,connect |
int 0x40 |
mcall |
red: |
call draw_window ; at first, draw the window |
still: |
51,7 → 52,7 |
mov eax,23 ; wait here for event |
mov ebx,1 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
61,19 → 62,14 |
jz button |
jmp still |
red: |
call draw_window |
jmp still |
key: |
mov eax,2 |
int 0x40 |
mcall |
jmp still |
button: |
mov eax,17 |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jnz noclose |
80,9 → 76,9 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socket] |
int 0x40 |
mov eax,-1 |
int 0x40 |
mcall |
or eax,-1 |
mcall |
noclose: |
cmp ah,2 ; SEND SHUTDOWN COMMAND? |
118,7 → 114,7 |
mov ecx,[socket] |
mov edx,1 |
mov esi,sen_shutdown |
int 0x40 |
mcall |
jmp still |
129,7 → 125,7 |
mov ecx,[socket] |
mov edx,1 |
mov esi,sen_reboot |
int 0x40 |
mcall |
jmp still |
140,7 → 136,7 |
mov ecx,[socket] |
mov edx,1 |
mov esi,sen_savefi |
int 0x40 |
mcall |
jmp still |
151,7 → 147,7 |
mov ecx,[socket] |
mov edx,1 |
mov esi,sen_savehi |
int 0x40 |
mcall |
jmp still |
162,7 → 158,7 |
mov ecx,[socket] |
mov edx,1 |
mov esi,sen_hotreboot |
int 0x40 |
mcall |
jmp still |
173,7 → 169,7 |
mov ecx,[socket] |
mov edx,1 |
mov esi,sen_exit |
int 0x40 |
mcall |
jmp still |
182,7 → 178,7 |
mov eax,53 |
mov ebx,3 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [edi],bl |
inc edi |
190,7 → 186,7 |
mov eax,53 |
mov ebx,2 |
mov ecx,[socket] |
int 0x40 |
mcall |
cmp eax,0 |
jne get_data |
200,7 → 196,7 |
mov ecx,0x000000 |
mov edx,I_END |
mov esi,15 |
int 0x40 |
mcall |
jmp still |
; ********************************************* |
212,24 → 208,16 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,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 edx,0x13ffffff ; color of work area RRGGBB |
mov edi,title ; WINDOW LABEL |
mcall |
; 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 |
236,9 → 224,8 |
mov ecx,113*65536+9 |
mov edx,2 |
mov esi,0x667788 |
int 0x40 |
newbut: |
int 0x40 |
mcall |
add ecx,16*65536 |
inc edx |
cmp edx,8 |
245,13 → 232,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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
259,7 → 246,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
303,9 → 290,9 |
db 'x' ; <- END MARKER, DONT DELETE |
end if |
labeltext: db 'Remote Control Center(Client)' ; |
lte: |
title db 'Remote Control Center(Client)',0 |
socket dd 0x0 |
remote_ip db 192,168,0,2 |
/programs/network/rccs/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/rccs/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm rccs.asm rccs |
@erase lang.inc |
@pause |
/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,10 → 36,11 |
mov ecx, 0x6100 ; local port |
mov edx, 0x6000 ; remote port |
mov esi, dword [remote_ip] ; remote IP |
int 0x40 |
mcall |
mov [socket],eax |
mov [0],eax ; save for remote code |
red: |
call draw_window ; at first, draw the window |
still: |
46,7 → 47,7 |
mov eax,23 ; wait here for event |
mov ebx,1 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
58,7 → 59,7 |
mov eax,53 ; data from cluster terminal ? |
mov ebx,2 |
mov ecx,[socket] |
int 0x40 |
mcall |
cmp eax,0 |
jne data_arrived |
65,13 → 66,9 |
jmp still |
red: |
call draw_window |
jmp still |
key: |
mov eax,2 |
int 0x40 |
mcall |
jmp still |
button: |
79,9 → 76,9 |
mov eax,53 |
mov ebx,1 |
mov ecx,[socket] |
int 0x40 |
mov eax,-1 |
int 0x40 |
mcall |
or eax,-1 |
mcall |
data_arrived: |
88,7 → 85,7 |
mov eax,5 ; wait a second for everything to arrive |
mov ebx,10 |
int 0x40 |
mcall |
mov edi,I_END |
97,7 → 94,7 |
mov eax,53 |
mov ebx,3 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [edi],bl |
inc edi |
105,7 → 102,7 |
mov eax,53 |
mov ebx,2 |
mov ecx,[socket] |
int 0x40 |
mcall |
cmp eax,0 |
jne get_data |
118,7 → 115,7 |
mov ecx,0x000000 |
mov edx,inp_con |
mov esi,inp_con.len |
int 0x40 |
mcall |
add [y],10 |
jmp still |
132,13 → 129,13 |
mov ecx,0x000000 |
mov edx,inp_shut |
mov esi,inp_shut.len |
int 0x40 |
mcall |
add [y],10 |
mov eax,18 |
mov ebx,9 |
mov ecx,2 |
int 0x40 |
mcall |
jmp still |
151,13 → 148,13 |
mov ecx,0x000000 |
mov edx,inp_reb |
mov esi,inp_reb.len |
int 0x40 |
mcall |
add [y],10 |
mov eax,18 |
mov ebx,9 |
mov ecx,3 |
int 0x40 |
mcall |
jmp still |
no_reb: |
169,13 → 166,13 |
mov ecx,0x000000 |
mov edx,inp_savefi |
mov esi,inp_savefi.len |
int 0x40 |
mcall |
add [y],10 |
mov eax,18 |
mov ebx,9 |
mov ecx,1 |
int 0x40 |
mcall |
jmp still |
no_savefi: |
187,13 → 184,13 |
mov ecx,0x000000 |
mov edx,inp_savehi |
mov esi,inp_savehi.len |
int 0x40 |
mcall |
add [y],10 |
mov eax,18 |
mov ebx,6 |
mov ecx,2 |
int 0x40 |
mcall |
jmp still |
206,13 → 203,13 |
mov ecx,0x000000 |
mov edx,inp_hotreb |
mov esi,inp_hotreb.len |
int 0x40 |
mcall |
add [y],10 |
mov eax,18 |
mov ebx,9 |
mov ecx,4 |
int 0x40 |
mcall |
jmp still |
no_hotreb: |
224,7 → 221,7 |
mov ecx,0x000000 |
mov edx,inp_exit |
mov esi,inp_exit.len |
int 0x40 |
mcall |
add [y],10 |
call button |
237,7 → 234,7 |
mov ecx,0x000000 |
mov edx,inp_com |
mov esi,inp_com.len |
int 0x40 |
mcall |
add [y],10 |
jmp still |
251,41 → 248,26 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,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 edx,0x13ffffff ; color of work area RRGGBB |
mov edi,title ; WINDOW LABEL |
mcall |
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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
294,7 → 276,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
315,8 → 297,7 |
db 'x' ; <- END MARKER, DONT DELETE |
end if |
labeltext: db 'Remote Control Center(Server)' |
lte: |
title db 'Remote Control Center(Server)',0 |
socket dd 0x0 |
y dd 0x10 |
/programs/network/remote/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/remote/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm remote.asm remote |
@erase lang.inc |
@pause |
/programs/network/remote/trunk/remote.asm |
---|
6,18 → 6,17 |
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 |
28,10 → 27,11 |
mov ecx, 0x3000 ; local port |
mov edx, 0xffff ; remote port |
mov esi, dword [remote_ip] ; remote IP |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
50,7 → 50,7 |
mov eax,53 ; data from cluster terminal ? |
mov ebx,2 |
mov ecx,[socketNum] |
int 0x40 |
mcall |
cmp eax,0 |
jne data_arrived |
57,13 → 57,9 |
jmp still |
red: |
call draw_window |
jmp still |
key: |
mov eax,2 |
int 0x40 |
mcall |
jmp still |
button: |
71,9 → 67,9 |
mov eax,53 |
mov ebx,1 |
mov ecx,[socketNum] |
int 0x40 |
mov eax,-1 |
int 0x40 |
mcall |
or eax,-1 |
mcall |
data_arrived: |
80,7 → 76,7 |
mov eax,5 ; wait a second for everything to arrive |
mov ebx,10 |
int 0x40 |
mcall |
mov edi,I_END |
89,7 → 85,7 |
mov eax,53 |
mov ebx,3 |
mov ecx,[socketNum] |
int 0x40 |
mcall |
mov [edi],bl |
inc edi |
97,7 → 93,7 |
mov eax,53 |
mov ebx,2 |
mov ecx,[socketNum] |
int 0x40 |
mcall |
cmp eax,0 |
jne get_data |
110,7 → 106,7 |
mov ecx,0x000000 |
mov edx,I_END |
mov esi,23 |
int 0x40 |
mcall |
add [y],10 |
146,41 → 142,26 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; 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,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 edx,0x13ffffff ; color of work area RRGGBB |
mov edi,title ; WINDOW LABEL |
mcall |
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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
189,7 → 170,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
200,11 → 181,10 |
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 |
labeltext: db 'CLUSTER REMOTE' |
lte: |
title db 'CLUSTER REMOTE',0 |
socketNum dd 0x0 |
218,7 → 198,6 |
db 2 ; 14 execute |
dd 0x0 ; 15 position |
; 19 |
I_END: |
/programs/network/smtps/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm smtps.asm smtps |
@erase lang.inc |
@pause |
/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 |
int 0x40 |
mcall |
ret |
49,7 → 49,7 |
mov eax,70 |
mov ebx,filel |
int 0x40 |
mcall |
test eax,eax |
jz @f |
72,6 → 72,8 |
mov ebp,0 |
mov edx,I_END |
redraw: |
call draw_window ; at first, draw the window |
still: |
80,10 → 82,10 |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
mov eax,11 ; wait here for event |
int 0x40 |
mcall |
cmp eax,1 ; redraw |
je redraw |
130,28 → 132,21 |
mov ecx,[socket] |
mov edx,6 |
mov esi,r220 |
int 0x40 |
mcall |
mov [header_sent],1 |
jmp still |
redraw: ; redraw |
call draw_window |
jmp still |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; close program |
jne noclose |
mov eax,-1 |
int 0x40 |
or eax,-1 |
mcall |
noclose: |
call socket_commands |
168,7 → 163,7 |
mov eax,53 |
mov ebx,6 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [status],eax |
183,7 → 178,7 |
mov ebx,360*65536+30 |
mov ecx,151*65536+10 |
mov edx,0xffffff |
int 0x40 |
mcall |
pop ecx |
mov eax,47 |
194,7 → 189,7 |
cmp [server_active],0 |
je no_print |
int 0x40 |
mcall |
no_print: |
208,7 → 203,7 |
cmp ah,22 ; open socket |
jnz tst3 |
mov eax,3 |
int 0x40 |
mcall |
mov [server_active],1 |
218,7 → 213,7 |
mov edx,0 ; no remote port specified |
mov esi,0 ; no remote ip specified |
mov edi,0 ; PASSIVE open |
int 0x40 |
mcall |
mov [socket], eax |
ret |
230,7 → 225,7 |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [header_sent],0 |
mov [mail_rp],0 |
mov [server_active],0 |
246,7 → 241,7 |
key: |
mov eax,2 |
int 0x40 |
mcall |
jmp still |
349,7 → 344,7 |
mov ecx,[socket] |
mov edx,6 |
mov esi,r354 |
int 0x40 |
mcall |
mov [cmd],0 |
popa |
ret |
363,7 → 358,7 |
mov ecx,[socket] |
mov edx,6 |
mov esi,r250 |
int 0x40 |
mcall |
mov [cmd],0 |
popa |
ret |
390,26 → 385,26 |
mov ecx,[socket] |
mov edx,6 |
mov esi,r221 |
int 0x40 |
mcall |
mov [cmd],0 |
mov eax,5 |
mov ebx,5 |
int 0x40 |
mcall |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov eax,5 |
mov ebx,5 |
int 0x40 |
mcall |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov [header_sent],0 |
mov [mail_rp],0 |
418,7 → 413,7 |
mov eax,5 |
mov ebx,20 |
int 0x40 |
mcall |
mov eax,53 |
mov ebx,5 |
426,7 → 421,7 |
mov edx,0 ; no remote port specified |
mov esi,0 ; no remote ip specified |
mov edi,0 ; PASSIVE open |
int 0x40 |
mcall |
mov [socket], eax |
popa |
442,7 → 437,7 |
mov ecx,[socket] |
mov edx,6 |
mov esi,r250 |
int 0x40 |
mcall |
mov [cmd],0 |
popa |
ret |
596,7 → 591,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socket] |
int 0x40 |
mcall |
mov ecx,-1 |
606,7 → 601,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socket] |
int 0x40 |
mcall |
mov ecx,0 |
622,7 → 617,7 |
mov eax,12 |
mov ebx,1 |
int 0x40 |
mcall |
mov [old_status],300 |
630,8 → 625,8 |
mov ebx,5*65536+400 |
mov ecx,5*65536+200 |
mov edx,0x13ffffff |
mov edi,labelt |
int 0x40 |
mov edi,title |
mcall |
mov eax,8 ; button: open socket |
mov ebx,23*65536+22 |
638,28 → 633,27 |
mov ecx,169*65536+10 |
mov edx,22 |
mov esi,0x55aa55 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
mov eax,38 ; line |
mov ebx,5*65536+395 |
mov ecx,108*65536+108 |
mov edx,0x000000 |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,5*65536+123 ; info text |
mov ecx,0x000000 |
mov edx,text |
mov esi,70 |
newline: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,12 |
add edx,70 |
cmp [edx],byte 'x' |
670,7 → 664,7 |
mov eax,12 |
mov ebx,2 |
int 0x40 |
mcall |
popa |
698,7 → 692,7 |
mov bx,word [rxs] |
imul bx,6 |
mov edx,0xffffff |
int 0x40 |
mcall |
popa |
push ecx |
mov eax,4 |
717,7 → 711,7 |
jne no_blue |
mov ecx,0x00ff00 |
no_blue: |
int 0x40 |
mcall |
add edx,[rxs] |
add ebx,10 |
pop ecx |
735,7 → 729,6 |
db ' Timeout is set to 15 seconds. ' |
db ' ' |
db ' Open SMTP server port 25 Close SMTP ' |
db 'x' ; <- END MARKER, DONT DELETE |
830,6 → 823,6 |
numtext db ' ' |
labelt db 'Tiny SMTP email server v ',version,0 |
title db 'Tiny SMTP email server v ',version,0 |
I_END: |
/programs/network/stackcfg/trunk/stackcfg.asm |
---|
22,6 → 22,8 |
dd PARAMS , 0x0 ; I_Param , I_Icon |
include 'lang.inc' |
include '..\..\..\macros.inc' |
START: ; start of execution |
cmp [PARAMS], byte 0 |
29,41 → 31,34 |
no_params: |
red: |
call draw_window ; at first, draw the window |
still: |
mov eax,10 ; wait here for event |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je red |
jz red |
cmp eax,2 ; key in buffer ? |
je key |
cmp eax,3 ; button in buffer ? |
je button |
jnz button |
jmp still |
red: ; redraw |
call draw_window |
jmp still |
key: ; key |
mov eax,2 ; just read it and ignore |
int 0x40 |
mov al,2 ; just read it and ignore |
mcall |
jmp still |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mov al,17 ; get id |
mcall |
shr eax,8 |
cmp eax,1 ; button id=1 ? |
jne noclose |
mov eax,-1 ; close this program |
int 0x40 |
or eax,-1 ; close this program |
mcall |
noclose: |
cmp eax,2 |
282,27 → 277,27 |
mov eax,52 |
mov ebx,0 |
int 0x40 |
mcall |
mov [config],eax |
mov eax,52 |
mov ebx,1 |
int 0x40 |
mcall |
mov dword [ip_address],eax |
mov eax,52 |
mov ebx,9 |
int 0x40 |
mcall |
mov dword [gateway_ip],eax |
mov eax,52 |
mov ebx,10 |
int 0x40 |
mcall |
mov dword [subnet_mask],eax |
mov eax,52 |
mov ebx,13 |
int 0x40 |
mcall |
mov dword [dns_ip],eax |
mov eax,[config] ; unwrap com IRQ |
345,27 → 340,27 |
mov eax,52 |
mov ebx,3 |
mov ecx,dword [ip_address] |
int 0x40 |
mcall |
mov eax,52 |
mov ebx,11 |
mov ecx,dword [gateway_ip] |
int 0x40 |
mcall |
mov eax,52 |
mov ebx,12 |
mov ecx,dword [subnet_mask] |
int 0x40 |
mcall |
mov eax,52 |
mov ebx,14 |
mov ecx,dword [dns_ip] |
int 0x40 |
mcall |
mov eax,52 |
mov ebx,2 |
mov ecx,[config] |
int 0x40 |
mcall |
ret |
jmp still |
390,11 → 385,11 |
mov edi,string |
f11: |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 |
jne read_done |
mov eax,2 |
int 0x40 |
mcall |
shr eax,8 |
cmp eax,13 |
je read_done |
442,7 → 437,7 |
shl ecx,16 |
mov cx,8 |
mov edx,0xffffff |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,[string_x] |
451,7 → 446,7 |
mov ecx,0x000000 |
mov edx,string |
mov esi,[string_length] |
int 0x40 |
mcall |
popa |
ret |
471,7 → 466,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; DRAW WINDOW |
mov eax,0 ; function 0 : define and draw window |
478,8 → 473,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,header ; WINDOW LABEL |
int 0x40 |
mov edi,title ; WINDOW LABEL |
mcall |
mov eax,8 ; BUTTON : READ SETUP |
487,13 → 482,13 |
mov ecx,127*65536+12 |
mov edx,2 |
mov esi,[button_color] |
int 0x40 |
mcall |
;mov eax,8 ; BUTTON : APPLY SETUP |
mov ebx,163*65536+65 |
mov ecx,127*65536+12 |
mov edx,3 |
int 0x40 |
mcall |
;mov eax,8 ; BUTTONS 11-14 : SELECT INTERFACE |
mov ebx,29*65536+8 |
500,7 → 495,7 |
mov ecx,39*65536+8 |
mov edx,11 |
interface_select: |
int 0x40 |
mcall |
add ecx,10*65536 |
inc edx |
cmp edx,11+4 |
513,7 → 508,7 |
mov ecx,0xffffff |
mov edx,xx |
mov esi,1 |
int 0x40 |
mcall |
mov eax,8 ; BUTTONS 21-22 : SERVER / MANUAL IP |
mov ebx,143*65536+8 |
520,12 → 515,12 |
mov ecx,69*65536+8 |
mov edx,21 |
mov esi,[button_color] |
int 0x40 |
mcall |
;mov eax,8 |
mov ebx,143*65536+8 |
mov ecx,79*65536+8 |
mov edx,22 |
int 0x40 |
mcall |
mov ebx,[assigned] ; PRINT SELECTED SERVER/MANUAL 'X' |
not ebx |
and ebx,1 |
535,7 → 530,7 |
mov ecx,0xffffff |
mov edx,xx |
mov esi,1 |
int 0x40 |
mcall |
mov eax,47 ; COM ADDRESS |
mov ebx,3*65536+1*256 |
542,7 → 537,7 |
mov ecx,[com_add] |
mov edx,272*65536+40 |
mov esi,0x000000 |
int 0x40 |
mcall |
;mov eax,47 ; COM IRQ |
mov ebx,1*65536+1*256 |
549,7 → 544,7 |
mov ecx,[com_irq] |
mov edx,(266+3*6)*65536+50 |
mov esi,0x000000 |
int 0x40 |
mcall |
mov edi,ip_address |
mov edx,205*65536+80 |
558,7 → 553,7 |
ipdisplay: |
;mov eax,47 |
movzx ecx,byte [edi] |
int 0x40 |
mcall |
add edx,6*4*65536 |
inc edi |
cmp edi,ip_address+4 |
571,7 → 566,7 |
gipdisplay: |
;mov eax,47 |
movzx ecx,byte [edi] |
int 0x40 |
mcall |
add edx,6*4*65536 |
inc edi |
cmp edi,gateway_ip+4 |
584,7 → 579,7 |
sipdisplay: |
;mov eax,47 |
movzx ecx,byte [edi] |
int 0x40 |
mcall |
add edx,6*4*65536 |
inc edi |
cmp edi,subnet_mask+4 |
597,7 → 592,7 |
dipdisplay: |
;mov eax,47 |
movzx ecx,byte [edi] |
int 0x40 |
mcall |
add edx,6*4*65536 |
inc edi |
cmp edi,dns_ip+4 |
609,35 → 604,31 |
mov ecx,39*65536+8 |
mov edx,5 |
mov esi,[button_color] |
int 0x40 |
mcall |
;mov eax,8 ; BUTTON 6 : SET IRQ |
mov ebx,299*65536+8 |
mov ecx,49*65536+8 |
mov edx,6 |
int 0x40 |
mcall |
;mov eax,8 ; BUTTON 7 : SET IP |
mov ebx,299*65536+8 |
mov ecx,79*65536+8 |
mov edx,7 |
int 0x40 |
mcall |
;mov eax,8 ; BUTTON 8 : SET gateway IP |
mov ebx,299*65536+8 |
mov ecx,89*65536+8 |
mov edx,8 |
int 0x40 |
mcall |
;mov eax,8 ; BUTTON 9 : SET subnet |
mov ebx,299*65536+8 |
mov ecx,99*65536+8 |
mov edx,9 |
int 0x40 |
mcall |
;mov eax,8 ; BUTTON 10 : SET dns ip |
mov ebx,299*65536+8 |
mov ecx,109*65536+8 |
mov edx,10 |
int 0x40 |
mcall |
mov ebx,31*65536+40 ; draw info text with function 4 |
mov edx,text |
650,7 → 641,7 |
mov ecx,0xeeeeee |
nowhite: |
inc edx |
int 0x40 |
mcall |
add ebx,10 |
add edx,49 |
cmp [edx],byte 'x' |
658,7 → 649,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
675,7 → 666,7 |
mov eax,52 |
mov ebx,0 |
int 0x40 |
mcall |
mov [config],eax |
shr eax,8 ; unwrap com IRQ |
690,7 → 681,7 |
call apply_stack_setup |
mov eax,-1 ; close this program |
int 0x40 |
mcall |
;****************************************************************************** |
713,7 → 704,7 |
button_color dd 0x2254b9 |
header db 'STACK CONFIGURATION',0 |
title db 'STACK CONFIGURATION',0 |
;ENTER YOUR SETTINGS HERE: |
/programs/network/telnet/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/telnet/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm telnet.asm telnet |
@erase lang.inc |
@pause |
/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] |
int 0x40 |
mcall |
mov ebx, [socket_status] |
mov [socket_status], eax |
45,12 → 45,13 |
cmp eax, ebx |
je waitev |
red: |
call draw_window |
waitev: |
mov eax,23 ; wait here for event |
mov ebx,20 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je red |
64,7 → 65,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socket] |
int 0x40 |
mcall |
cmp eax, 0 |
jne read_input |
77,7 → 78,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socket] |
int 0x40 |
mcall |
pop ecx |
call handle_data |
86,7 → 87,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socket] |
int 0x40 |
mcall |
pop ecx |
cmp eax, 0 |
133,7 → 134,7 |
mov ebx,7 |
mov ecx,[socket] |
mov esi, telnetrep |
int 0x40 |
mcall |
ret |
hd001: |
200,14 → 201,9 |
newdata: |
ret |
red: ; REDRAW WINDOW |
call draw_window |
jmp still |
key: ; KEY |
mov eax,2 ; send to modem |
int 0x40 |
mcall |
mov ebx, [socket_status] |
cmp ebx, 4 ; connection open? |
246,7 → 242,7 |
button: ; BUTTON |
mov eax,17 |
int 0x40 |
mcall |
cmp ah,1 ; CLOSE PROGRAM |
jne noclose |
253,10 → 249,10 |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
mov eax,-1 |
int 0x40 |
or eax,-1 |
mcall |
noclose: |
cmp ah, 2 ; Set IP |
jne notip |
376,7 → 372,7 |
mov ebx,7 |
mov ecx,[socket] |
mov esi, tx_buff |
int 0x40 |
mcall |
pop bx |
mov al, [echo] |
cmp al, 0 |
405,7 → 401,7 |
mov eax,53 |
mov ebx,8 |
mov ecx,[socket] |
int 0x40 |
mcall |
ret |
420,7 → 416,7 |
push ecx |
mov eax, 53 |
mov ebx, 9 |
int 0x40 |
mcall |
pop ecx |
cmp eax, 0 ; is this local port in use? |
jz getlp ; yes - so try next |
437,7 → 433,7 |
mov esi, edx |
movzx edx, word [port] ; telnet port id |
mov edi,1 ; active open |
int 0x40 |
mcall |
mov [socket], eax |
popa |
457,14 → 453,14 |
mov eax,12 |
mov ebx,1 |
int 0x40 |
mcall |
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,labelt |
int 0x40 |
mov edi,title |
mcall |
; draw status bar |
mov eax, 13 |
471,7 → 467,7 |
mov ebx, 4*65536+484 + 8 +15 |
mov ecx, 270*65536 + 3 |
mov edx, 0x00557799 |
int 0x40 |
mcall |
mov eax,8 ; BUTTON 2: SET IP |
mov ebx,4*65536+70 |
478,7 → 474,7 |
mov ecx,273*65536+12 |
mov esi, 0x00557799 |
mov edx,2 |
int 0x40 |
mcall |
mov eax,4 ; Button text |
mov ebx,6*65536+276 |
485,17 → 481,17 |
mov ecx,0x00ffffff |
mov edx,setipt |
mov esi,setiplen-setipt |
int 0x40 |
mcall |
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] |
int 0x40 |
mcall |
add edx,6*4*65536 |
inc edi |
cmp edi,ip_address+4 |
506,7 → 502,7 |
mov ecx,273*65536+12 |
mov edx,3 |
mov esi, 0x00557799 |
int 0x40 |
mcall |
mov eax,4 ; Button text |
mov ebx,178*65536+276 |
513,7 → 509,7 |
mov ecx,0x00ffffff |
mov edx,setportt |
mov esi,setportlen-setportt |
int 0x40 |
mcall |
mov edx,216*65536+276 ; display port |
521,7 → 517,7 |
mov ebx,4*65536 |
mov eax,47 |
movzx ecx,word [port] |
int 0x40 |
mcall |
mov eax,8 ; BUTTON 4: Connect |
mov ebx,250*65536+50 |
528,7 → 524,7 |
mov ecx,273*65536+12 |
mov esi, 0x00557799 |
mov edx,4 |
int 0x40 |
mcall |
mov eax,4 ; Button text |
mov ebx,255*65536+276 |
535,7 → 531,7 |
mov ecx,0x00ffffff |
mov edx,cont |
mov esi,conlen-cont |
int 0x40 |
mcall |
mov eax,8 ; BUTTON 5: disconnect |
543,7 → 539,7 |
mov ecx,273*65536+12 |
mov edx,5 |
mov esi, 0x00557799 |
int 0x40 |
mcall |
mov eax,4 ; Button text |
551,7 → 547,7 |
mov ecx,0x00ffffff |
mov edx,dist |
mov esi,dislen-dist |
int 0x40 |
mcall |
mov esi,contlen-contt ; display connected status |
566,7 → 562,7 |
mov eax,4 ; status text |
mov ebx,380*65536+276 |
mov ecx,0x00ffffff |
int 0x40 |
mcall |
mov eax,8 ; BUTTON 6: echo |
574,7 → 570,7 |
mov ecx,273*65536+12 |
mov edx,6 |
mov esi, 0x00557799 |
int 0x40 |
mcall |
mov edx,echot |
mov esi,echolen-echot |
588,7 → 584,7 |
mov eax,4 ; Button text |
mov ebx,463*65536+276 |
mov ecx,0x00ffffff |
int 0x40 |
mcall |
xor eax,eax |
601,7 → 597,7 |
mov eax,12 |
mov ebx,2 |
int 0x40 |
mcall |
popa |
636,7 → 632,7 |
shl ebx, 16 |
mov bx, 6 |
mov eax, 13 |
int 0x40 |
mcall |
popa |
; draw character |
652,7 → 648,7 |
mov eax,4 |
mov edx,esi |
mov esi,1 |
int 0x40 |
mcall |
popa |
noletter: |
683,11 → 679,11 |
mov edi,string |
f11: |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 |
jne read_done |
mov eax,2 |
int 0x40 |
mcall |
shr eax,8 |
cmp eax,13 |
je read_done |
735,7 → 731,7 |
shl ecx,16 |
mov cx,8 |
mov edx,0x00000000 |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,[string_x] |
744,7 → 740,7 |
mov ecx,0x00ffffff |
mov edx,string |
mov esi,[string_length] |
int 0x40 |
mcall |
popa |
ret |
773,7 → 769,7 |
scroll dd 1 |
dd 24 |
wcolor dd 0x000000 |
labelt db 'Telnet v0.1',0 |
title db 'Telnet v0.1',0 |
setipt db 'IP Address: . . .' |
setiplen: |
setportt db 'Port:' |
/programs/network/terminal/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/terminal/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm terminal.asm terminal |
@erase lang.inc |
@pause |
/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 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je red |
45,7 → 45,7 |
push ecx |
mov eax,42 |
mov ebx,4 |
int 0x40 |
mcall |
pop ecx |
cmp bl,27 ; ESCAPE COMMAND |
121,7 → 121,7 |
mov [pos],eax |
newdata: |
mov eax,11 |
int 0x40 |
mcall |
cmp eax,16+4 |
je read_input |
call draw_text |
134,7 → 134,7 |
key: ; KEY |
mov eax,2 ; send to modem |
int 0x40 |
mcall |
shr eax,8 |
cmp eax,178 ; ARROW KEYS |
jne noaup |
164,25 → 164,25 |
mov ecx,0x3f8 |
mov bl,al |
mov eax,43 |
int 0x40 |
mcall |
jmp still |
button: ; BUTTON |
mov eax,17 |
int 0x40 |
mcall |
cmp ah,1 ; CLOSE PROGRAM |
jne noclose |
mov eax,45 ; FREE IRQ |
mov ebx,1 |
mov ecx,4 |
int 0x40 |
mcall |
mov eax,46 |
mov ebx,1 |
mov ecx,0x3f0 |
mov edx,0x3ff |
int 0x40 |
mov eax,-1 |
int 0x40 |
mcall |
or eax,-1 |
mcall |
noclose: |
jmp still |
208,10 → 208,10 |
mov ecx,0x3f8 |
mov ebx,eax |
mov eax,43 |
int 0x40 |
mcall |
mov eax,5 |
mov ebx,5 |
int 0x40 |
mcall |
popa |
ret |
267,17 → 267,17 |
mov ebx,0 |
mov ecx,0x3f0 |
mov edx,0x3ff |
int 0x40 |
mcall |
mov eax,45 ; reserve irq 4 |
mov ebx,0 |
mov ecx,4 |
int 0x40 |
mcall |
mov eax,44 |
mov ebx,irqtable |
mov ecx,4 |
int 0x40 |
mcall |
; jmp noportint |
284,38 → 284,38 |
mov cx,0x3f8+3 |
mov bl,0x80 |
mov eax,43 |
int 0x40 |
mcall |
mov cx,0x3f8+1 |
mov bl,0 |
mov eax,43 |
int 0x40 |
mcall |
mov cx,0x3f8+0 |
mov bl,0x30 / 16 |
mov eax,43 |
int 0x40 |
mcall |
mov cx,0x3f8+3 |
mov bl,3 |
mov eax,43 |
int 0x40 |
mcall |
mov cx,0x3f8+4 |
mov bl,0xB |
mov eax,43 |
int 0x40 |
mcall |
mov cx,0x3f8+1 |
mov bl,1 |
mov eax,43 |
int 0x40 |
mcall |
noportint: |
mov eax,40 |
mov ebx,0000000000010000b shl 16 + 111b |
int 0x40 |
mcall |
popa |
334,14 → 334,14 |
mov eax,12 |
mov ebx,1 |
int 0x40 |
mcall |
mov eax,0 ; DRAW WINDOW |
mov ebx,100*65536+491 |
mov ecx,100*65536+270 |
mov edx,0x13000000 |
mov edi,labelt |
int 0x40 |
mov edi,title |
mcall |
xor eax,eax |
mov edi,text+80*30 |
353,7 → 353,7 |
mov eax,12 |
mov ebx,2 |
int 0x40 |
mcall |
popa |
412,7 → 412,7 |
shl ebx,16 |
mov bx,6 |
mov eax,13 |
int 0x40 |
mcall |
popa |
pusha |
429,7 → 429,7 |
mov eax,4 |
mov edx,esi |
mov esi,1 |
int 0x40 |
mcall |
popa |
noletter: |
458,12 → 458,12 |
newescc: |
mov eax,42 |
mov ebx,4 |
int 0x40 |
mcall |
cmp ecx,0 |
je escok |
mov eax,5 |
mov ebx,1 |
int 0x40 |
mcall |
jmp newescc |
escok: |
mov [edi],bl |
613,7 → 613,7 |
mov ebx,250*65536+100 |
mov ecx,8*65536+8 |
mov edx,0x000000 |
int 0x40 |
mcall |
mov eax,[escnumbers] |
xor edx,edx |
638,7 → 638,7 |
mov ecx,0xffffff |
mov edx,numtext |
mov esi,10 |
int 0x40 |
mcall |
popa |
652,7 → 652,7 |
mov ebx,150*65536+100 |
mov ecx,8*65536+8 |
mov edx,0xffffff |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,150*65536+8 |
659,7 → 659,7 |
mov ecx,0x000000 |
mov edx,esccmd |
mov esi,20 |
int 0x40 |
mcall |
popa |
ret |
720,7 → 720,7 |
escend db 'ZrhlABCDHfDME=>NmKJgincoyq',0 |
escnumbers dd 0,0,0,0,0 |
wcolor dd 0x000000 |
labelt db 'TERMINAL FOR MODEM IN COM1 0.03',0 |
title db 'TERMINAL FOR MODEM IN COM1 0.03',0 |
text: |
db ' ' |
735,8 → 735,4 |
db ' ' |
I_END: |
/programs/network/tftpa/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/tftpa/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm tftpa.asm tftpa |
@erase lang.inc |
@pause |
/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,12 → 28,13 |
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 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
43,19 → 44,14 |
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 |
int 0x40 |
mcall |
jmp still |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jnz noclose |
65,13 → 61,13 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov [socketNum], dword 0 |
mov eax,0xffffffff ; close this program |
int 0x40 |
or eax,-1 ; close this program |
mcall |
noclose: |
cmp ah,2 ; copy file to local machine? |
119,13 → 115,13 |
f11: |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 |
jz fbu |
jmp still |
fbu: |
mov eax,2 |
int 0x40 ; get key |
mcall ; get key |
shr eax,8 |
cmp eax,8 |
jnz nobs |
162,7 → 158,7 |
shl ecx,16 |
mov cx,8 |
mov edx,0x224466 |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,103*65536 |
170,7 → 166,7 |
mov ecx,0xffffff |
mov edx,[addr] |
mov esi,15 |
int 0x40 |
mcall |
ret |
309,7 → 305,7 |
; Get a random # for the local socket port # |
mov eax, 3 |
int 0x40 |
mcall |
mov ecx, eax |
shr ecx, 8 ; Set up the local port # with a random # |
318,7 → 314,7 |
mov ebx, 0 |
mov edx, 69 ; remote port |
mov esi, [tftp_IP] ; remote IP ( in intenet format ) |
int 0x40 |
mcall |
mov [socketNum], eax |
328,12 → 324,12 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
cmp eax, 0 |
jne cfr001 ; yes, so get it |
344,13 → 340,13 |
mov ecx, [socketNum] |
mov edx, [tftp_len] |
mov esi, tftp_filename |
int 0x40 |
mcall |
cfr002: |
mov eax,23 ; wait here for event |
mov ebx,1 ; Time out after 10ms |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je cfr003 |
363,7 → 359,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
cmp eax, 0 |
je cfr002 |
385,12 → 381,12 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
pop eax |
; bl holds tftp opcode. Can only be 3 (data) or 5 ( error ) |
404,7 → 400,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
mov [blockNumber], bl |
411,7 → 407,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
mov [blockNumber+1], bl |
419,7 → 415,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
mov esi, [fileposition] |
mov [esi], bl |
429,7 → 425,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
cmp eax, 0 |
jne cfr007 ; yes, so get it |
442,11 → 438,11 |
mov eax,5 ; wait for correct timer position |
; to trigger new play block |
mov ebx,1 |
int 0x40 |
mcall |
mov eax,26 |
mov ebx,9 |
int 0x40 |
mcall |
cmp eax,[wait_for] |
jb wait_more |
463,11 → 459,11 |
mov eax,55 |
mov ebx,0 |
mov ecx,0x10000 |
int 0x40 |
mcall |
mov eax,55 |
mov ebx,1 |
int 0x40 |
mcall |
mov [fileposition],0x20000 |
486,7 → 482,7 |
mov ecx, [socketNum] |
mov edx, ackLen - ack |
mov esi, ack |
int 0x40 |
mcall |
; If # of chars in the frame is less that 516, |
; this frame is the last |
500,7 → 496,7 |
mov edx, [filesize] |
mov ecx, I_END + 512 |
mov esi, 0 |
int 0x40 |
mcall |
jmp cfrexit |
509,12 → 505,12 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
cmp eax, 0 |
jne cfrerr ; yes, so get it |
527,12 → 523,12 |
cfr004: ; key pressed |
mov eax,2 ; just read it and ignore |
int 0x40 |
mcall |
jmp cfr002 |
cfr005: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jne cfr002 ; If not, ignore. |
542,12 → 538,12 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov [socketNum], dword 0 |
mov eax,-1 ; close this program |
int 0x40 |
mcall |
jmp $ |
556,7 → 552,7 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
mov [socketNum], dword 0 |
578,7 → 574,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; DRAW WINDOW |
mov eax,0 ; function 0 : define and draw window |
585,37 → 581,24 |
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,labelt |
int 0x40 |
mov edi,title |
mcall |
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 |
int 0x40 |
mcall |
mov eax,8 |
mov ebx,200*65536+10 |
mov ecx,34*65536+10 |
mov edx,4 |
mov esi,0x557799 |
int 0x40 |
mcall |
mov eax,8 |
mov ebx,200*65536+10 |
mov ecx,50*65536+10 |
mov edx,5 |
mov esi,0x557799 |
int 0x40 |
mcall |
; Copy the file name to the screen buffer |
642,13 → 625,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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
657,7 → 640,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
691,7 → 674,7 |
db 'x' ; <- END MARKER, DONT DELETE |
labelt db 'TFTP Wave Player',0 |
title db 'TFTP Wave Player',0 |
prompt: dd 0 |
promptlen: dd 0 |
/programs/network/tftpc/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
Property changes: |
Deleted: svn:eol-style |
-native |
\ No newline at end of property |
/programs/network/tftpc/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm tftpc.asm tftpc |
@erase lang.inc |
@pause |
/programs/network/tftpc/trunk/tftpc.asm |
---|
12,21 → 12,22 |
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 |
int 0x40 |
mcall |
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 |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
jz red |
37,18 → 38,14 |
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 |
int 0x40 |
mcall |
jmp still |
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jnz noclose |
63,8 → 60,8 |
mov [socketNum], dword 0 |
mov eax,0xffffffff ; close this program |
int 0x40 |
or eax,-1 ; close this program |
mcall |
noclose: |
cmp ah,2 ; copy file to local machine? |
127,13 → 124,13 |
f11: |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 |
jz fbu |
jmp still |
fbu: |
mov eax,2 |
int 0x40 ; get key |
mcall ; get key |
shr eax,8 |
cmp eax,8 |
jnz nobs |
170,7 → 167,7 |
shl ecx,16 |
mov cx,8 |
mov edx,0x224466 |
int 0x40 |
mcall |
mov eax,4 |
mov ebx,103*65536 |
178,7 → 175,7 |
mov ecx,0xffffff |
mov edx,[addr] |
mov esi,15 |
int 0x40 |
mcall |
ret |
357,7 → 354,7 |
cfr002: |
mov eax,10 ; wait here for event |
int 0x40 |
mcall |
cmp eax,1 ; redraw request ? |
je cfr003 |
427,7 → 424,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
cmp eax, 0 |
je no_more_data ; no |
435,7 → 432,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
mov esi, [fileposition] |
mov [esi], bl |
473,7 → 470,7 |
mov edx, [filesize] |
mov ecx, I_END + 512 |
mov esi, 0 |
int 0x40 |
mcall |
jmp cfrexit |
500,12 → 497,12 |
cfr004: ; key pressed |
mov eax,2 ; just read it and ignore |
int 0x40 |
mcall |
jmp cfr002 |
cfr005: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
cmp ah,1 ; button id=1 ? |
jne cfr002 ; If not, ignore. |
520,7 → 517,7 |
mov [socketNum], dword 0 |
mov eax,-1 ; close this program |
int 0x40 |
mcall |
jmp $ |
809,7 → 806,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
; DRAW WINDOW |
mov eax,0 ; function 0 : define and draw window |
816,8 → 813,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,labelt |
int 0x40 |
mov edi,title |
mcall |
mov eax,8 ; COPY BUTTON |
mov ebx,20*65536+190 |
824,28 → 821,25 |
mov ecx,79*65536+15 |
mov edx,2 |
mov esi,0x557799 |
int 0x40 |
mcall |
mov eax,8 ; DELETE BUTTON |
; mov eax,8 ; DELETE BUTTON |
mov ebx,20*65536+190 |
mov ecx,111*65536+15 |
mov edx,3 |
mov esi,0x557799 |
int 0x40 |
mcall |
mov eax,8 |
mov ebx,200*65536+10 |
; mov eax,8 |
; mov ebx,200*65536+10 |
mov ecx,34*65536+10 |
mov edx,4 |
mov esi,0x557799 |
int 0x40 |
mcall |
mov eax,8 |
mov ebx,200*65536+10 |
; mov eax,8 |
; mov ebx,200*65536+10 |
mov ecx,50*65536+10 |
mov edx,5 |
mov esi,0x557799 |
int 0x40 |
mcall |
; Copy the file name to the screen buffer |
872,13 → 866,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: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
887,7 → 881,7 |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
ret |
921,7 → 915,7 |
db 'x' ; <- END MARKER, DONT DELETE |
labelt db 'TFTP Client',0 |
title db 'TFTP Client',0 |
prompt: dd 0 |
promptlen: dd 0 |
/programs/network/ym/trunk/build_en.bat |
---|
1,4 → 1,5 |
@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,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm ym.asm ym |
@erase lang.inc |
@pause |
/programs/network/ym/trunk/ym.asm |
---|
14,6 → 14,7 |
;E:. |
include 'lang.inc' |
include '..\..\..\macros.inc' |
;B+ Definitions |
v_sp equ 330 |
h_sp equ 400 |
32,6 → 33,12 |
START: |
;B+ Main execution |
mov ebx,3 |
mov ecx,sys_colors |
mov edx,10*4 |
mov eax,48 |
mcall |
call clear_text |
red: |
39,7 → 46,7 |
still: |
mov ebx,50 |
mov eax,23 |
int 0x40 |
mcall |
cmp eax,1 |
je red |
54,7 → 61,7 |
key: |
mov eax,2 |
int 0x40 |
mcall |
cmp [is_connect],0 |
je still |
call send_key_string |
62,12 → 69,12 |
button: |
mov eax,17 |
int 0x40 |
mcall |
cmp ah,1 |
jne noclose |
mov eax,-1 |
int 0x40 |
or eax,-1 |
mcall |
jmp $ |
noclose: |
113,7 → 120,7 |
mov ecx,(v_sp-53) shl 16 + 10 |
mov edx,[sys_colors+4*5] |
mov eax,13 |
int 0x40 |
mcall |
popa |
;show item |
145,15 → 152,9 |
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 |
int 0x40 |
mcall |
xor eax,eax ;DRAW WINDOW |
mov ebx,150*65536+h_sp |
160,8 → 161,8 |
mov ecx,100*65536+v_sp |
mov edx,[sys_colors+4*5] |
or edx,0x13000000 |
mov edi,header |
int 0x40 |
mov edi,title |
mcall |
;B+ Friend panel |
mov ebx,(h_sp-fr_sp) shl 16 + 3 |
168,7 → 169,7 |
mov ecx,20 shl 16 + v_sp-31 -56 |
mov edx,[sys_colors+4*9] |
mov eax,13 |
int 0x40 |
mcall |
call show_friends |
;E:. |
177,12 → 178,12 |
mov ecx,(v_sp-31 -33-3) shl 16 + 3 |
mov edx,[sys_colors+4*9] |
mov eax,13 |
int 0x40 |
mcall |
mov ebx,(h_sp-(fr_sp-12)*8/6) shl 16 + 4 |
mov ecx,(v_sp-31-33) shl 16 + 30 |
int 0x40 |
mcall |
mov ebx,(h_sp-8) shl 16 + 4 |
int 0x40 |
mcall |
call show_a_friend |
call show_string |
;E:. |
192,14 → 193,14 |
mov ecx,(v_sp-35) shl 16 + 31 |
mov edx,[sys_colors+4*9] |
mov eax,13 |
int 0x40 |
mcall |
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] |
int 0x40 |
mcall |
mov ebx,(171+2+8+(psw_txt_end-psw_txt)*6) shl 16 + 6*23+7 |
mov ecx,(v_sp-32) shl 16 + 12 |
int 0x40 |
mcall |
;connect button |
mov ebx,(h_sp-128) shl 16 + (con_txt_end-con_txt)*6 + 7 |
207,21 → 208,21 |
mov edx,101 |
mov esi,[sys_colors+4*6] |
mov eax,8 |
int 0x40 |
mcall |
;disconnect button |
shl ebx,16 |
add ebx,(h_sp-128+3) shl 16 + (dis_txt_end-dis_txt)*6 + 7 |
mov edx,102 |
int 0x40 |
mcall |
;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 |
int 0x40 |
mcall |
;password button |
mov ebx,174 shl 16 + (psw_txt_end-psw_txt)*6 + 5 |
mov edx,104 |
int 0x40 |
mcall |
;login text |
mov ebx,11 shl 16 + v_sp-15 |
229,27 → 230,27 |
mov edx,login_txt |
mov esi,login_txt_end-login_txt |
mov eax,4 |
int 0x40 |
mcall |
;user text |
mov ebx,11 shl 16 + v_sp-15-15 |
mov edx,user_txt |
mov esi,user_txt_end-user_txt |
int 0x40 |
mcall |
;password text |
mov ebx,(174+5) shl 16 + v_sp-15-15 |
mov edx,psw_txt |
mov esi,psw_txt_end-psw_txt |
int 0x40 |
mcall |
;connect text |
mov ebx,(h_sp-128+5) shl 16 + v_sp-15 |
mov edx,con_txt |
mov esi,con_txt_end-con_txt |
int 0x40 |
mcall |
;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 |
int 0x40 |
mcall |
call show_username |
call show_password |
259,7 → 260,7 |
mov ebx,2 |
mov eax,12 |
int 0x40 |
mcall |
ret |
;E:. |
282,7 → 283,7 |
.next_button: |
call test_friend |
jc .no_b |
int 0x40 |
mcall |
inc edx |
.no_b: |
inc edi |
318,11 → 319,11 |
call hi_light |
jne .no_online |
mov ecx,[sys_colors+4*7] |
;int 0x40 |
;mcall |
;or ecx,0x10000000 |
.no_online: |
;sub ebx,1 shl 16 |
int 0x40 |
mcall |
;and ecx,not 0x10000000 |
.no_item: |
add ebx,15 |
352,7 → 353,7 |
jne .no_group |
sub ebx,12 shl 16 |
.no_group: |
int 0x40 |
mcall |
add ebx,15 |
inc edi |
cmp edi,[last_friend_line] |
425,7 → 426,7 |
.next_line: |
cmp [edx-1],byte 0 |
jne .shift |
int 0x40 |
mcall |
.next: |
add ebx,10 |
add edx,45 |
435,7 → 436,7 |
ret |
.shift: |
add ebx,3 shl 16 |
int 0x40 |
mcall |
sub ebx,3 shl 16 |
jmp .next |
457,7 → 458,7 |
mov ecx,(25-2) shl 16 + 24*10-2 +2 |
mov edx,[sys_colors+4*5] |
mov eax,13 |
int 0x40 |
mcall |
;show text |
call show_text |
popa |
508,7 → 509,7 |
mov edx,[.m_p] |
mov esi,line_wid |
mov eax,4 |
int 0x40 |
mcall |
add ebx,3 shl 16 |
.next_line: |
add ebx,10 |
515,7 → 516,7 |
add edx,line_wid |
cmp [edx-1],byte 0 |
je .good3 |
int 0x40 |
mcall |
jmp .next_line |
.good3: |
mov [.m_p],edx |
532,7 → 533,7 |
mov edx,[f_name_b] |
mov esi,[f_name_l] |
mov eax,4 |
int 0x40 |
mcall |
ret |
f_name_b dd fnb |
570,7 → 571,7 |
mov edx,.this_c |
mov esi,1 |
mov eax,4 |
int 0x40 |
mcall |
; |
cmp [.c_pl],41 |
je .new_line |
615,7 → 616,7 |
mov edx,.this_c |
mov esi,1 |
mov eax,4 |
int 0x40 |
mcall |
mov ebx,[.c_pl] |
mov [in_text+ebx],byte 0 |
jmp show_cursor |
649,7 → 650,7 |
mov ecx,(v_sp-31 -33) shl 16 + 29 |
mov edx,[sys_colors+4*5] |
mov eax,13 |
int 0x40 |
mcall |
;; move cursor |
mov ebx,7 shl 16 + v_sp-62 |
mov [send_key_string.xy],ebx |
671,16 → 672,16 |
mov edx,curs |
mov esi,1 |
mov eax,4 |
int 0x40 |
mcall |
add ebx,4 |
int 0x40 |
mcall |
mov ebx,[send_key_string.xy] |
mov [.old_xy],ebx |
sub ebx,3 shl 16 + 2 |
mov ecx,0xffffff;[sys_colors+4*8] |
int 0x40 |
mcall |
add ebx,4 |
int 0x40 |
mcall |
ret |
.old_xy dd 7 shl 16 + v_sp-62 |
692,13 → 693,13 |
mov edx,in_text |
mov esi,41 |
mov eax,4 |
int 0x40 |
mcall |
add ebx,2 shl 16 + 9 |
add edx,41 |
int 0x40 |
mcall |
add ebx,9 |
add edx,41 |
int 0x40 |
mcall |
call show_cursor |
ret |
837,7 → 838,7 |
;get enen |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,1 |
je .end |
846,7 → 847,7 |
;key |
mov eax,2 |
int 0x40 |
mcall |
cmp ah,13 |
je .end |
887,7 → 888,7 |
mov edx,f_password |
mov esi,4 |
mov eax,4 |
int 0x40 |
mcall |
jmp still |
.unp dd username |
897,7 → 898,7 |
mov ecx,(v_sp-15-15) shl 16 + 9 |
mov edx,[sys_colors+4*5] |
mov eax,13 |
int 0x40 |
mcall |
;show |
mov ebx,(4+12*6) shl 16 + v_sp-15-15 |
mov ecx,[sys_colors+4*8] |
904,7 → 905,7 |
mov edx,username |
mov esi,16 |
mov eax,4 |
int 0x40 |
mcall |
ret |
username: times (16+1) db 0 |
925,12 → 926,12 |
mov edx,f_password |
mov esi,4 |
mov eax,4 |
int 0x40 |
mcall |
.next: |
;get enen |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,1 |
je still |
939,7 → 940,7 |
;key |
mov eax,2 |
int 0x40 |
mcall |
cmp [.unp],password+24 |
je .no_next |
965,7 → 966,7 |
mov edx,f_password |
mov esi,4 |
mov eax,4 |
int 0x40 |
mcall |
.end: |
ret |
1047,7 → 1048,7 |
;del |
last_friend_line dd 0x6 ;del |
header db 'Messenger (Yahoo Compatible)',0 |
title db 'Messenger (Yahoo Compatible)',0 |
;User / Password |
login_txt db 'STATUS: SESSION: ___.___.___.___' |