Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > my getline is better than yours

Reply
Thread Tools

my getline is better than yours

 
 
Rosario
Guest
Posts: n/a
 
      11-13-2007
In data Tue, 13 Nov 2007 07:28:10 +0100, Rosario scrisse:

this is my last version but i have not debug well it...
(today i were out all the day)

/* 0k, 4j, 8i, 12b, 16Ra, 20P_s, 24P_len, 28P_f
GetLine_m:
< b, i, j, k
a=^20; k=^28; i=0; a==0#.e2; k==0#.e2;
b=*a; j=4; / era j=64
a=^24; D*a==0#.0; D*a==1#.e2; --D*a; / 0..(len-1),
..0: b#.1; a=j; a+=4; _malloc_m<(a);
/ thre are problems if i change one arg?
a==0#.e0; b=a; a=^20; *a=b; #.1;
..e0: a=3; stc; ##.c;
/ errori iniziale di memoria [non settati "s" e "len"]
..e2: a=2; stc; ##.c;
/ errori di parametro [non settati "s" e "len"]
..e3: k=3; ##.8; / errori di memoria
..e4: k=4; ##.8; / errori di overflow indice
..e5: k=5; ##.8; / errori di lettura file
..1: j&i!#.2 | j+=i; jc .e4; a=j; a+=4; jc .e4;
| _realloc_m<(b, a); a==0#.e3;
| b=a; a= ^20; *a=b;
..2: _fgetc_m<(k); a==-1!#.3| D [k+12]& 16 #.e5 // ferror(k)? (ext)
| k=1; #.8; // EOF (ext)
..3: i==-1#.e4; [b+i]=al; r=^24; ++i;
r==0#.4; D*r==0#.1; i>=*r#.e4; // ceck if i>max_index
..4: al!=10#.1;
..7: k=0; / here "\n" is found
..8: a=i; a+=4; _realloc_m<(b, a); a==0#.9;
b=a; a=^20; *a=b;
..9: a=k;
B[b+i]=0; r=^24; r==0#.a; *r=i; // save len
..a: a<=1#.b| stc; #.c; / error
..b: | clc; / ok
..c:
> b, i, j, k

ret 12

; int __stdcall GetLine_m( char** s, uns* len, FILE* f)
; trash ecx, edx
; Assegna a "s" un indirizzo a una stringa contenente una
; linea di "f", (o tutto il file puntato da f se len==0)
; ritorna un codice di errore e assegna (se len!=0) ad len
; la lunghezza di tale stringa
; usare come in
; char *s;
; uns len;
; int i;
; FILE *f;
; ....open file
; ----------------------
; len=0; s=0;
; n=GetLine_m(&s, &len, f); // per avere in s tutto il file
; if(n==1) // tutto ok il file Ŕ in s e nessun errore
; else if(n==2) // errore di parametro etc
; free(s); // alla fine s deve essere liberato
; ----------------------
; len=12345678; s=0; n=GetLine_m(&s, &len, f); ... free(s);
; ----------------------
; s=0; n=GetLine_m(&s, &len, f); ... free(s);
; ----------------------
; ritorna 0 se tutto ok e EOF non raggiunto CF==0
; 1 Eof raggiunto e nessun errore trovato CF==0
; 2 errore parametro CF==1
; 3 errore memoria CF==1
; 4 errori di overflow indice CF==1
; 5 errori di lettura file CF==1
;
; 0k, 4j, 8i, 12b, 16Ra, 20P_s, 24P_len, 28P_f
GetLine_m:
push ebx
push esi
push edi
push ebp
mov eax, [ esp + 20 ]
mov ebp, [ esp + 28 ]
mov esi, 0
cmp eax, 0
je .e2
cmp ebp, 0
je .e2
mov ebx, [eax] ; era j=64
mov edi, 4
mov eax, [ esp + 24 ] ; 0..(len-1),
cmp dword[eax], 0
je .0
cmp dword[eax], 1
je .e2
dec dword[eax]
..0: ; thre are problems if i change one arg?
cmp ebx, 0
jne .1
mov eax, edi
add eax, 4
push eax
call _malloc_m
add esp, 4
cmp eax, 0
je .e0
mov ebx, eax
mov eax, [ esp + 20 ]
mov [eax], ebx
jmp short .1
..e0: ; errori iniziale di memoria [non settati "s" e "len"]
mov eax, 3
stc
jmp .c
..e2: ; errori di parametro [non settati "s" e "len"]
mov eax, 2
stc
jmp .c
..e3: ; errori di memoria
mov ebp, 3
jmp .8
..e4: ; errori di overflow indice
mov ebp, 4
jmp .8
..e5: ; errori di lettura file
mov ebp, 5
jmp .8
..1:
test edi, esi
jz .2
add edi, esi
jc .e4
mov eax, edi
add eax, 4
jc .e4

push eax
push ebx
call _realloc_m
add esp, 8
cmp eax, 0
je .e3

mov ebx, eax
mov eax, [ esp + 20 ]
mov [eax], ebx
..2: ;/ ferror(k)? (ext)
push ebp
call _fgetc_m
add esp, 4
cmp eax, -1
jne .3
test dword [ebp+12], 16
jnz .e5
;/ EOF (ext)
mov ebp, 1
jmp short .8
..3:
cmp esi, -1
je .e4
mov [ebx+esi], al
mov edx, [ esp + 24 ]
inc esi
cmp edx, 0
je .4 ;/ ceck if i>max_index
cmp dword[edx], 0
je .1
cmp esi, [edx]
jae .e4
..4:
cmp al, 10
jne .1
..7: ; here "\n" is found
mov ebp, 0
..8:
mov eax, esi
add eax, 4
push eax
push ebx
call _realloc_m
add esp, 8
cmp eax, 0
je .9
mov ebx, eax
mov eax, [ esp + 20 ]
mov [eax], ebx
..9:
mov eax, ebp
mov byte[ebx+esi], 0
mov edx, [ esp + 24 ]
cmp edx, 0
je .a
mov [edx], esi
..a: ; error
cmp eax, 1
jbe .b
stc
jmp short .c
..b: ; ok

clc
..c:
pop ebp
pop edi
pop esi
pop ebx
ret 12


 
Reply With Quote
 
 
 
 
Rod Pemberton
Guest
Posts: n/a
 
      11-13-2007

"Rosario" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 3) Because this show that all theories that say goto and jumps are
> not for structured programming are all wrong
>


Structured programming techniques can be applied to unstructured languages
such as Basic or assembly. That's what you've done. This isn't new. It's
many decades old.

Some languages, assembly or BASIC, only have unstructured programming flow
control like goto and jump. This doesn't mean that the gotos and jumps are
the _cause_ of the problem or can't be used in a structured manner. They
were the _effect_ of the language design and programmer choice. The purpose
of structured programming was to _force_ programmers to use structured
methods via language design instead of allowing them to _choose_
unstructured methods.

The use of unstructured programming techniques, where allowed, frequently
results in coding errors. One of the main problems was multiple entry and
exit points to code blocks or loops. This was the plague of line oriented
BASIC. It was difficult to reorganize code once it was on a specific line
or set of lines. So, the solution was to goto somewhere else and goto back
later. But, as the a number of these jump out, jump back patches were
applied, the code became unreadable and unmaintainable, i.e., "spaghetti"
code. And, as a result, difficult to locate and correct programming errors,
such as part of the loop or block not being executed, would arise.

C allows unstructured coding using a) goto's, b) the unstructured form of
the switch statement, c) multiple exit points via returns from procedures or
functions, and d) coroutines (multiple entry points) (See Duff's Device or
Simon Tatham's coroutines) e) multiple exit points from loops using break,
etc., but is usually considered to be a structured programming language like
Pascal because it has many semi-structured forms of control flow that can be
used as structured forms. Those who use multiple returns from procedures or
functions or use goto's to setup error routines within a procedure usually
haven't learned a programming technique called "fall through." The code
falls through to the next section or the programmer sets a flag to skip some
code before falling into another section or return. With structured
programming techniques, one never has to use a goto but may do so for
clarity, speed, size reduction etc. Multiple entry and exit points aren't
needed in new code, but can be very useful when patching two or more pieces
of existing code together.

Unfortunately, structured programming languages have problems too. One of
the most notable is the "cut 'n' paste" problem. It is much easier in a
structured programming language to copy a small section of code than write a
procedure to reuse it. Therefore, the code becomes bloated with large
amounts of small pieces of repeated code like identical if statements. This
tends to affect larger applications.


Rod Pemberton

 
Reply With Quote
 
 
 
 
Terence
Guest
Posts: n/a
 
      11-13-2007
On Nov 13, 8:35 pm, Philip Potter <(E-Mail Removed)> wrote:

> Incidentally, I have read a paper by Knuth called, I think, "Structured
> programming with gotos" which was interesting reading; he gave examples
> of constructs which are more efficiently implemented using gotos than
> "traditional" structured constructs.


Yes, as part of my M.Sc Thesis I was requested to comment on
"Structured Programming with Come-froms", a real paper (no, not mine)
showing an alternative to Knuth, which is not the joke it first seems.
It has been implemented.

> This was in the mid-70s, though, and I don't think such efficiency savings are worthwhile today given how
> few programmers are at all familiar with gotos.
>


Oh come ON Phillip!
I run a programming enterprise. Everybody I know knows and uses GOTOs.

One of the best structure tools for following code later (apart from
using another program on a tested production program, to rewrite and
resequence all labels from 1 up and all FORMAT statements from 900 up,
each by order of occurence), was to use
GOTO ( long, long series of cases ), index
wherever possible (we parse text a lot) and have nice self-explanatory
blocks of code for each case, each GOING somewhere onward afterwards.
The CASE structure cannot do this well without using internal GOTOs;
so if they have to have them there, why not use the GOTO to make all
the code more readable because it really can be structured with that
facility?.

The only decent addition to older Fortran, in my opinion, was the IF-
THEN- ELSE- ENDIF structure, which I have come to like for saving
labels, (but I wish it had some labelling system to avoid getting the
nesting wrong)..

 
Reply With Quote
 
Rosario
Guest
Posts: n/a
 
      11-14-2007
In data Tue, 13 Nov 2007 18:43:52 +0100, Rosario scrisse:
>In data Tue, 13 Nov 2007 07:28:10 +0100, Rosario scrisse:
>
>this is my last version but i have not debug well it...
>(today i were out all the day)


you have to change only the name realloc_m -> realloc,
fgetc_m -> fgetc,
D [k+12]& 16 #.e5 ->
"push ebp; call _ferror; pop edx; cmp eax, 0; jnz .e5"
How many errors do you see?
but it will be full of errors

/* int __stdcall
/* GetLine_m( char** s, uns* len, uns max_len, FILE* f)
/* trash ecx, edx
/* NB: *deve essere* "s"=0 oppure "s" allocato
/* tramite malloc() o realloc().
/* Assegna a "s" un indirizzo a una stringa contenente una
/* linea di "f", o tutto il file puntato da "f" se "max_len"==0;
/* se "max_len!=0" la lunghezza massima della stringa Ŕ "max_len"
/* ritorna 0 se tutto ok e EOF non raggiunto CF==0
/* 1 EOF raggiunto e nessun errore trovato CF==0
/* 2 errore parametro CF==1
/* 3 errore memoria CF==1
/* 4 errori di overflow indice CF==1
/* 5 errori di lettura file CF==1
/* usare come in: char *s; uns len; int i; FILE *f;
/* ----------------------
/* s=0; n=GetLine_m(&s, &len, 0, f); ... free(s); // tutto il file
/* ----------------------
/* s=0; n=GetLine_m(&s, &len, -1, f); ... free(s); // la linea
/* ----------------------
/* 0k, 4j, 8i, 12b, 16Ra, 20P_s, 24P_len, 28P_max_len, 32P_f
GetLine_m:
< b, i, j, k
a=^20; k=^32; i=0; a==0#.e2; k==0#.e2;
b=*a; j=4; D[s+28]==1#.e2
..0: a=j; a+=4; _realloc_m<(b, a); a==0#.e0;
b=a; a=^20; *a=b; #.1;
..e0: b#.e3;
a=3; stc; ##.c; / errori iniziale di memoria
..e2: a=2; stc; ##.c; / errori di parametro
..e3: k=3; ##.8; / errori di memoria
..e4: k=4; ##.8; / errori di overflow indice
..e5: k=5; ##.8; / errori di lettura file
..1: j&i!#.2 | j+=i; jc .e4; a=j; a+=4; jc .e4;
| _realloc_m<(b, a); a==0#.e3;
| b=a; a=^20; *a=b;
..2: _fgetc_m<(k); a==-1!#.3| D [k+12]& 16 #.e5 / ferror(k)? (ext)
| k=1; #.8; / EOF (ext)
..3: i==-1#.e4; [b+i]=al; r=^28; ++i; r==0#.1; i>=r#.e4;
..4: al!=10#.1;
..7: k=0; / here "\n" is found
..8: a=i; a+=4; _realloc_m<(b, a); a==0#.9;
b=a; a=^20; *a=b;
..9: a=k;
B[b+i]=0; r=^24; r==0#.a; *r=i;
..a: a<=1#.b| stc; #.c; / error
..b: | clc; / ok
..c:
> b, i, j, k

ret 16

GetLine_m:
push ebx
push esi
push edi
push ebp
mov eax, [ esp + 20 ]
mov ebp, [ esp + 32 ]
mov esi, 0
cmp eax, 0
je .e2
cmp ebp, 0
je .e2
mov ebx, [eax]
mov edi, 4
cmp dword[esp+28], 1
je .e2
..0:
mov eax, edi
add eax, 4
push eax
push ebx
call _realloc_m
add esp, 8
cmp eax, 0
je .e0
mov ebx, eax
mov eax, [ esp + 20 ]
mov [eax], ebx
jmp short .1
..e0:
cmp ebx, 0
jne .e3
mov eax, 3 ; errori iniziale di memoria
stc
jmp .c
..e2: ; errori di parametro
mov eax, 2
stc
jmp .c
..e3: ; errori di memoria
mov ebp, 3
jmp .8
..e4: ; errori di overflow indice
mov ebp, 4
jmp .8
..e5: ; errori di lettura file
mov ebp, 5
jmp .8
..1:
test edi, esi
jz .2
add edi, esi
jc .e4
mov eax, edi
add eax, 4
jc .e4

push eax
push ebx
call _realloc_m
add esp, 8
cmp eax, 0
je .e3

mov ebx, eax
mov eax, [ esp + 20 ]
mov [eax], ebx
..2: ; ferror(k)? (ext)
push ebp
call _fgetc_m
add esp, 4
cmp eax, -1
jne .3
test dword [ebp+12], 16
jnz .e5
; EOF (ext)
mov ebp, 1
jmp short .8
..3:
cmp esi, -1
je .e4
mov [ebx+esi], al
mov edx, [ esp + 28 ]
inc esi
cmp edx, 0
je .1
cmp esi, edx
jae .e4
..4:
cmp al, 10
jne .1
..7: ; here "\n" is found
mov ebp, 0
..8:
mov eax, esi
add eax, 4
push eax
push ebx
call _realloc_m
add esp, 8
cmp eax, 0
je .9
mov ebx, eax
mov eax, [ esp + 20 ]
mov [eax], ebx
..9:
mov eax, ebp
mov byte[ebx+esi], 0
mov edx, [ esp + 24 ]
cmp edx, 0
je .a
mov [edx], esi
..a: ; error
cmp eax, 1
jbe .b
stc
jmp short .c
..b: ; ok

clc
..c:
pop ebp
pop edi
pop esi
pop ebx
ret 16


 
Reply With Quote
 
Philip Potter
Guest
Posts: n/a
 
      11-14-2007
Terence wrote:
> On Nov 13, 8:35 pm, Philip Potter <(E-Mail Removed)> wrote:
>> This was in the mid-70s, though, and I don't think such efficiency savings are worthwhile today given how
>> few programmers are at all familiar with gotos.
>>

>
> Oh come ON Phillip!
> I run a programming enterprise. Everybody I know knows and uses GOTOs.


Oh come ON Terence! Your company does not seem representative, some have
explicit coding policies against gotos. (And please spell my name
correctly.)

> One of the best structure tools for following code later (apart from
> using another program on a tested production program, to rewrite and
> resequence all labels from 1 up and all FORMAT statements from 900 up,
> each by order of occurence), was to use
> GOTO ( long, long series of cases ), index
> wherever possible (we parse text a lot) and have nice self-explanatory
> blocks of code for each case, each GOING somewhere onward afterwards.
> The CASE structure cannot do this well without using internal GOTOs;
> so if they have to have them there, why not use the GOTO to make all
> the code more readable because it really can be structured with that
> facility?.


I don't understand why you need a goto /after/ the end of each case. And
without that goto, I don't understand why you don't just use a switch.

--
Philip Potter pgp <at> doc.ic.ac.uk
 
Reply With Quote
 
Rosario
Guest
Posts: n/a
 
      11-14-2007
In data Wed, 14 Nov 2007 06:30:32 +0100, Rosario scrisse:

for this there is the need to know how the malloc and realloc have to
save the size of the buffer, and to do some calculation that dipend of
that

/* int __stdcall
/* GetLine_m( char** s, uns* len, uns size_max, FILE* f)
/* trash ecx, edx
/* NB: *deve essere* "s"=0 oppure "s" allocato
/* tramite malloc() o realloc().
/* Assegna a "s" un indirizzo a una stringa contenente una
/* linea di "f", o tutto il file puntato da "f" se "size_max"==0;
/* se "size_max"!=0 la lunghezza massima della stringa Ŕ "size_max-1"
/* ritorna 0 se tutto ok e EOF non raggiunto CF==0
/* 1 EOF raggiunto e nessun errore trovato CF==0
/* 2 errore parametro CF==1
/* 3 errore memoria CF==1
/* 4 errori di overflow indice CF==1
/* 5 errori di lettura file CF==1
/* usare come in: char *s; uns len; int i; FILE *f;
/* ----------------------
/* s=0; n=GetLine_m(&s, &len, 0, f); ... free(s); // tutto il file
/* ----------------------
/* s=0; n=GetLine_m(&s, &len, -1, f); ... free(s); // la linea
/* ----------------------
/* s=0; while(!(n=GetLine_m(&s, &len, -1, f))){...}
/* if( n==0|| n==1 ) { tutto ok}
/* free(s)
/* ----------------------
/* 0k, 4j, 8i, 12b, 16Ra, 20P_s, 24P_len, 28P_max_len, 32P_f
GetLine_m:
< b, i, j, k
a=^20; k=^32; i=0; a==0#.e2; k==0#.e2;
b=*a; j=4; D[s+28]==1#.e2; D[s+24]==0#.e2;
/ e' dword[ebx-4] la dimensione
/ in unitÓ sizeof(header)==8bytes della memoria
/ nunits = (nbytes+/8 + (nbytes%8?1:0) + 1
/ 8*nunits = nbytes + 8 + 8*(nbytes%8?1:0) + 8
/ nbytes = 8*(nunits-1) - 8*(nbytes%8?1:0) - 8
/ nbytes <= 8*(nunits-1) -8
b==0#.0; a=[b-4]; a<=1#.ee; --a; a<<=3; jc .e0; a>8#.1;
..0: a=j; a+=4; _realloc_m<(b, a); a==0#.e0;
b=a; a=^20; *a=b; #.1;
..e0: b#.e3;
..ee: a=3; stc; ##.c; / errori iniziale di memoria
..e2: a=2; stc; ##.c; / errori di parametro
..e3: k=3; ##.8; / errori di memoria
..e4: k=4; ##.8; / errori di overflow indice
..e5: k=5; ##.8; / errori di lettura file
..1: j&i!#.2 | j+=i; jc .e4; a=j; a+=8; jc .e4;
| r=[b-4]; r<=1#.ee; --r; r<<=3; jc .e3; r>a#.2;
| _realloc_m<(b, a); a==0#.e3;
| b=a; a=^20; *a=b;
..2: _fgetc_m<(k); a==-1!#.3| D [k+12]& 16 #.e5 / ferror(k)? (ext)
| k=1; #.8; / EOF (ext)
/ i non va in overflow (prima di j)
..3: [b+i]=al; r=^28; ++i; r==0#.1; --r; i>=r#.e4; / 0..size-1
..4: al!=10#.1;
..7: k=0; / here "\n" is found
..8: a=i; r=[b-4]; r<=1#.ee; --r; r<<=3; jc .9; r-=i;
r<16#.9; / in teoria mai in realloc
a+=4; _realloc_m<(b, a); a==0#.9;
b=a; a=^20; *a=b;
..9: a=k;
B[b+i]=0; r=^24; r==0#.a; *r=i;
..a: a<=1#.b| stc; #.c; / error
..b: | clc; / ok
..c:
> b, i, j, k

ret 16



; int __stdcall
; GetLine_m( char** s, uns* len, uns size_max, FILE* f)
; trash ecx, edx
; NB: *deve essere* "s"=0 oppure "s"
; allocato tramite malloc() o realloc().
; Assegna a "s" un indirizzo a una stringa contenente una
; linea di "f", o tutto il file puntato da "f" se "size_max"==0;
; se "size_max"!=0 la lunghezza massima della stringa Ŕ "size_max-1"
; ritorna 0 se tutto ok e EOF non raggiunto CF==0
; 1 EOF raggiunto e nessun errore trovato CF==0
; 2 errore parametro CF==1
; 3 errore memoria CF==1
; 4 errori di overflow indice CF==1
; 5 errori di lettura file CF==1
; usare come in: char *s; uns len; int i; FILE *f;
; ----------------------
; s=0; n=GetLine_m(&s, &len, 0, f); ... free(s); // tutto il file
; ----------------------
; s=0; n=GetLine_m(&s, &len, -1, f); ... free(s); // la linea
; ----------------------
; s=0; while(!(n=GetLine_m(&s, &len, -1, f))){...}
; if( n==0|| n==-1 ) { tutto ok}
; free(s)
; ----------------------
; 0k, 4j, 8i, 12b, 16Ra, 20P_s, 24P_len, 28P_max_len, 32P_f
GetLine_m:
push ebx
push esi
push edi
push ebp
mov eax, [ esp + 20 ]
mov ebp, [ esp + 32 ]
mov esi, 0
cmp eax, 0
je .e2
cmp ebp, 0
je .e2
mov ebx, [eax]
mov edi, 4
cmp dword[esp+28], 1
je .e2
cmp dword[esp+24], 0
je .e2
; e' D b[-4]la dimensione in unitÓ
; sizeof(header)==8bytes della memoria
; nunits = (nbytes+/8 + (nbytes%8?1:0) + 1
; 8*nunits = nbytes + 8 + 8*(nbytes%8?1:0) + 8
; nbytes = 8*(nunits-1) - 8*(nbytes%8?1:0) - 8
; nbytes <= 8*(nunits-1) -8
cmp ebx, 0
je .0
mov eax, [ebx-4]
cmp eax, 1
jbe .ee
dec eax
shl eax, 3
jc .e0
cmp eax, 8
ja .1
..0:
mov eax, edi
add eax, 4
push eax
push ebx
call _realloc_m
add esp, 8
cmp eax, 0
je .e0
mov ebx, eax
mov eax, [ esp + 20 ]
mov [eax], ebx
jmp short .1
..e0:
cmp ebx, 0
jne .e3
..ee: ; errori iniziale di memoria
mov eax, 3
stc
jmp .c
..e2: ; errori di parametro
mov eax, 2
stc
jmp .c
..e3: ; errori di memoria
mov ebp, 3
jmp .8
..e4: ; errori di overflow indice
mov ebp, 4
jmp .8
..e5: ; errori di lettura file
mov ebp, 5
jmp .8
..1:
test edi, esi
jz .2
add edi, esi
jc .e4
mov eax, edi
add eax, 8
jc .e4

mov edx, [ebx-4]
cmp edx, 1
jbe .ee
dec edx
shl edx, 3
jc .e3
cmp edx, eax
ja .2

push eax
push ebx
call _realloc_m
add esp, 8
cmp eax, 0
je .e3

mov ebx, eax
mov eax, [ esp + 20 ]
mov [eax], ebx
..2: ; ferror(k)? (ext)
push ebp
call _fgetc_m
add esp, 4
cmp eax, -1
jne .3
test dword [ebp+12], 16
jnz .e5
; EOF (ext)
mov ebp, 1
jmp short .8
; i non va in overflow (prima di j)
..3: ; 0..size-1
mov [ebx+esi], al
mov edx, [ esp + 28 ]
inc esi
cmp edx, 0
je .1
dec edx
cmp esi, edx
jae .e4
..4:
cmp al, 10
jne .1
..7: ; here "\n" is found
mov ebp, 0
..8:
mov eax, esi
mov edx, [ebx-4]
cmp edx, 1
jbe .ee
dec edx
shl edx, 3
jc .9
sub edx, esi
cmp edx, 16
jb .9 ; in teoria mai in realloc
add eax, 4
push eax
push ebx
call _realloc_m
add esp, 8
cmp eax, 0
je .9
mov ebx, eax
mov eax, [ esp + 20 ]
mov [eax], ebx
..9:
mov eax, ebp
mov byte[ebx+esi], 0
mov edx, [ esp + 24 ]
cmp edx, 0
je .a
mov [edx], esi
..a: ; error
cmp eax, 1
jbe .b
stc
jmp short .c
..b: ; ok

clc
..c:
pop ebp
pop edi
pop esi
pop ebx
ret 16



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GL2 better than the XLs? Consumer grade HDs better than pro-sumer Mini DVs? dh@. DVD Video 1 08-28-2008 07:20 PM
Your getline is better than mine Richard Harter C Programming 0 11-29-2007 09:11 PM
Is splint really better than lint? Is there a better tool than splint? Peter Bencsik C Programming 2 09-21-2006 10:02 PM
My virus count is bigger than yours! NYAH! :P Dan A+ Certification 5 01-05-2005 09:30 AM
my PC is bigger than yours fruitbat Computer Information 14 02-20-2004 03:55 AM



Advertisments