> Christmas craziness now over.  A slightly modified version now seems to 
 > run:
 > 
 > target memsize 8 byteorder little pointersize 32 wordsize 32;
 > export H1 as "main";
 > H1(
 > ){
 > bits32 H3;
 > bits32 H4;
 > bits32 H5;
 > H5=%sub(7::bits32,1::bits32);
 > H4=%mul(8::bits32,H5);
 > H3=%add(H4,2::bits32);
 > return;
 > }
 > 
 > At least, it starts and finished.  I haven't any output yet, so I can't 
 > really tell if it's evaluating 8 * (7 - 1) + 2 correctly.  I'll still 
 > have to declare main properly as having "C" linkage, but it seems to work 
 > without for now -- perhaps because of no parameters?

Likely.  The semantics of the x86 call instruction militate strongly
toward having all calling conventions expect the return address in the
same place.

On most platforms you can expect either that the C-- calling
convention passes parameters in similar registers or that it uses more
registers than the C convention.   If any parameters are passed on the
stack, there is zero chance of compatibility.


Norman
_______________________________________________
Cminusminus mailing list
[email protected]
https://cminusminus.org/mailman/listinfo/cminusminus

Reply via email to