May 31, 2007 assembler parameter | ||||
|---|---|---|---|---|
| ||||
Hello,
this programm should print 5;
int fak(int count) {
asm {
naked;
//mov EAX,7; // print 7
mov EAX, [ESP+4]; // load parameter count
ret; // get EAX
}
}
void main() {
int f = fak(5);
writefln(f);
}
| ||||
May 31, 2007 Re: assembler parameter | ||||
|---|---|---|---|---|
| ||||
Posted in reply to nobody | nobody wrote: > int fak(int count) { > > asm { > naked; > //mov EAX,7; // print 7 > mov EAX, [ESP+4]; // load parameter count > ret; // get EAX > } > } count is already in EAX. See "Parameters" under "Function Calling Conventions" at http://www.digitalmars.com/d/abi.html | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply