| |
|
|
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
|
|
|
| |
|
|
|
| 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:
write but just as too:
This is for procs How for nprocs. |
|
|
| |
|
|
|
funkheld | Hmm.., with push and pop changes itself the Result not.
greeting
|
|
|
| |
|
|
|
| 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. |
|
|
| |
|
|
|
| another small TIP: can You complete drop there the Return Value the in EAX Dropped worth is. so too with windows-APIs. |
|
|
| |
|
|
|
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 |
|
|
| |
|
|
|
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 |
|
|
| |
|
|
|
| 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:
{$cleq}
nProc Test.ifgleich
parameters v&,w&
mov eax,1
mov ebx,v&
mov ecx,w&
cmp ebx,ecx
apiece uebersprung
mov eax,0
uebersprung:
endproc
nProc Test.ifkleiner
parameters v&,w&
mov eax,1
mov ebx,v&
mov ecx,w&
cmp ebx,ecx
jl uebersprung
mov eax,0
uebersprung:
endproc
nProc Test.whileZaehle
parameters v&
mov ebx,v&
xor ecx,ecx
beginning:
add ecx,1
'schleifenkörper, ecx is here 1 To 10
cmp ecx,ebx
jge uebersprung
jmp beginning
uebersprung:
mov eax,ecx
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 spending:
0 1 1 0 10 where even this here Yes selbes Ergebis supply:
and this here a optimiertere Variante of it is:
and it yet kürzer goes:
and it too yet "cooler" goes:
hope helps. |
|
|
| |
|
|
|
funkheld | Yes thanks, the sees Yes well from. the are nice Examples, The I well utilize can.
Thank you.
greeting |
|
|
| |
|
|