... > I'm not sure, at least > > > .L9: > > movw %dx,-12(%ebp) > > .Ll3: > > suggests that the target is not an integer, but instead is a (possibly > unsigned) word type. Please check again! ...
This is the result of the compilation: "ppc386 tord -al" (shortened of course). Since "MOVW" moves 16-bit values, it does not matter if it's signed or not, it just has to be 16 bit of something. That "MOVW" occurs with range/overflow check on or off, doesn't matter. The complete pascal program, as compiled by me: {$R+}{$Q+} program tord ; function d(a,b:Char):Integer; begin d := integer(Ord(a))-Ord(b); end; var i: Integer; begin i := Ord('0')-Ord('1'); WriteLn(i); WriteLn(d('0','1')); end. Gerhard _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel