English
Forum

get Wrong Result with XPSE in the Loop.

 

funkheld
Hello, good day, I have a problem.
Why comes under the Ergenis 6 out?
If I The Whilelloop rausnehme comes correctly. 9 out.

Thank you.
greeting
 
04/18/12  
 



You must of it go out, that windows-APIs as well as XPSE-functions
as well as Kontrollstrukturen The ASM-Registerwerte Change because tappt im dunkeln with them works.

want one of these Values works then ought to one tappt im dunkeln z.B. with push and pop
secure/ restore. with manchen APIs is this even explizit notwenwie z.B.
with LineDDA or many others ENUM-Procs.

would your Loop means to cmp or. Test and jmp or. jle or jl adjust -
means without While, then would too The Registerwerte not affect or use
even push and pop.

Übrigens... according to the what one lying...

You can naturally:
nproc Addi(long x,y){ ... }


write but just as too:

This is for procs How for nprocs.
 
04/18/12  
 




funkheld
Hmm.., with push and pop changes itself the Result not.

greeting
 
04/18/12  
 



the WhileLoop and Wend uses likewise at least eax and ebx,

if then müsstest your add eax,ebx abkapseln but You can against
neither of it go out that the while whom ebx worth unchanged into Loop
durchlässt.

In this case eignet itself the mix with ASM not. the against is well with all
"ehrlichen" nativen Programmiersprachen the case and even too so with windows-APIs
for a More on speed To achieve or. circa not unnecessary Registerwerte To secure.

You could but your Loop (So the while wend) too complete to asm
umsetzen (How supra written) with cmp or. Test(-asm)-instructions.

If you write what very You achieve want then can I you whom
ASM moreover too write down.
 
04/18/12  
 



another small TIP:
can You complete drop there the Return Value
the in EAX Dropped worth is. so too with windows-APIs.
 
04/18/12  
 




funkheld
Jup, thanks.
eax have I rausgelassen, now functions it.

but this not working with the typischen MASM or JWASM-SChleife:

The XPIA knows these typische Loop again.

greeting
 
04/18/12  
 




funkheld

cmp or. Test and jmp or. jle or jl


If you time Please a ASM-demonstration make could for XPSE, which a if-Loop, a Whileloop-Loop and a While-Loop darstellt, so could I then plenty with begin.

Thank you.

greeting
 
04/18/12  
 



tommorrow,

as here (  [...]  ) already written can You if, while, whileloop simply directly use
without The explicit schmächtigere High-Level-Syntax (HLS) of jwasm.

a couple plakativ-patterning ASM-Examples of if, while and Zählschleife without HLS
could so looks:
and spending:

0
1
1
0
10

where even this here Yes selbes Ergebis supply:
 {$cleq}

nProc Test.ifgleich

    parameters v&,w&

    if v&=w&

        return 1

    else

        return 0

    endif

endproc

nProc Test.ifkleiner

    parameters v&,w&

    if v&<w&

        return 1

    else

        return 0

    endif

endproc

nProc Test.whileZaehle

    parameters v&

    whileloop v&

        'schleifenkörper

    wend

    sub eax,1'<-- not important, only kosmetisch so 10 back given becomes

endproc

cls
print Test.ifgleich(9,10)
print Test.ifgleich(10,10)
print Test.ifkleiner(9,10)
print Test.ifkleiner(10,10)
print Test.whileZaehle(10)
waitInput
end

and this here a optimiertere Variante of it is:
 {$cleq}

nProc Test.ifgleich

    parameters v&,w&
    case v&=w& : return 1
    return 0

endproc

nProc Test.ifkleiner

    parameters v&,w&
    case v&<w& : return 1
    return 0

endproc

nProc Test.whileZaehle

    parameters v&

    whileloop v&

        'schleifenkörper

    wend

    sub eax,1'<-- not important, only kosmetisch so 10 back given becomes

endproc

cls
print Test.ifgleich(9,10)
print Test.ifgleich(10,10)
print Test.ifkleiner(9,10)
print Test.ifkleiner(10,10)
print Test.whileZaehle(10)
waitInput
end

and it yet kürzer goes:
 {$cleq}

nProc Test.ifgleich

    parameters v&,w&
    return v&=w&

endproc

nProc Test.ifkleiner

    parameters v&,w&
    return v&<w&

endproc

nProc Test.whileZaehle

    parameters v&

    whileloop v&

        'schleifenkörper

    wend

    sub eax,1'<-- not important, only kosmetisch so 10 back given becomes

endproc

cls
print Test.ifgleich(9,10)
print Test.ifgleich(10,10)
print Test.ifkleiner(9,10)
print Test.ifkleiner(10,10)
print Test.whileZaehle(10)
waitInput
end

and it too yet "cooler" goes:
 {$cleq}

nProc Test.ifgleich(long v,w){ return v&==w& }

nProc Test.ifkleiner(long v,w){ return v&<w& }

nProc Test.whileZaehle(long v){

    whileloop v {

        'schleifenkörper

    }

    sub eax,1'<-- not important, only kosmetisch so 10 back given becomes

}

cls
print Test.ifgleich(9,10)
print Test.ifgleich(10,10)
print Test.ifkleiner(9,10)
print Test.ifkleiner(10,10)
print Test.whileZaehle(10)
waitInput
end

hope helps.
 
04/19/12  
 




funkheld
Yes thanks, the sees Yes well from.
the are nice Examples, The I well utilize can.

Thank you.

greeting
 
04/19/12  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

11.604 Views

Untitledvor 0 min.
funkheld07/29/17
iF11/28/14
mein06/02/13
Andreas Koch01/14/13
More...

Themeninformationen

this Topic has 2 subscriber:

funkheld (5x)
iF (4x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie