<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<blockquote type="cite" cite="mid:20180517172024.7601650B@atlas.cz">
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Linux 64-bit Lazarus
1.9.0 r57948M FPC 3.1.1 x86_64-linux-qt gives</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> 1.000000000000000000E+00
10000</p>
</blockquote>
What is dissassembly for:<br>
i:=Int64(c);?<br>
<br>
I have for Win32:<br>
test_curr_int64.lpr:19 i1 := Int64(c);<br>
0040158D a100c04200 mov 0x42c000,%eax<br>
00401592 a310c04200 mov %eax,0x42c010<br>
00401597 a104c04200 mov 0x42c004,%eax<br>
0040159C a314c04200 mov %eax,0x42c014<br>
<br>
and for Win64:<br>
test_curr_int64.lpr:19 i1 := Int64(c);<br>
00000001000015BD 488b0d3caa0300 mov
0x3aa3c(%rip),%rcx # 0x10003c000<br>
00000001000015C4 48b84b598638d6c56d34 movabs
$0x346dc5d63886594b,%rax<br>
00000001000015CE 48f7e9 imul %rcx<br>
00000001000015D1 48c1fa0b sar $0xb,%rdx<br>
00000001000015D5 48c1e93f shr $0x3f,%rcx<br>
00000001000015D9 4801ca add %rcx,%rdx<br>
00000001000015DC 4889152daa0300 mov
%rdx,0x3aa2d(%rip) # 0x10003c010<br>
<br>
<br>
L.<br>
<blockquote type="cite" cite="mid:20180517172024.7601650B@atlas.cz">
<div><br>
</div>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br>
> Od: LacaK <a class="moz-txt-link-rfc2396E" href="mailto:lacak@zoznam.sk"><lacak@zoznam.sk></a><br>
> Komu: FPC-Pascal users discussions
<a class="moz-txt-link-rfc2396E" href="mailto:fpc-pascal@lists.freepascal.org"><fpc-pascal@lists.freepascal.org></a><br>
> Datum: 17.05.2018 13:33<br>
> Předmět: [fpc-pascal] Currency and Int64 casting<br>
></p>
Hi,<br>
<br>
consider following program:<br>
<br>
var<br>
c: currency;<br>
<br>
begin<br>
c := 1;<br>
writeln(c,' ',Int64(c));<br>
readln;<br>
end.<br>
<br>
FPC 3.0.4<br>
On Win32/x86 I get: 1, 1000 (what I am expecting)<br>
On Win64/x86_64 I get: 1, 1<br>
<br>
Is is as expected ?<br>
<br>
Is there safe way for both platforms how to get 1000 (beside that
I can <br>
use: i: int64 absolute c;)<br>
<br>
Thanks<br>
<br>
-Laco.<br>
<br>
_______________________________________________<br>
fpc-pascal maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a
href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal"
moz-do-not-send="true">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
fpc-pascal maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a></pre>
</blockquote>
<br>
</body>
</html>