digitalmars.D - 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
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
May 31 2007








Deewiant <deewiant.doesnotlike.spam gmail.com>