<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 03 Oct 2012, at 03:29, luiz americo pereira camara wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">I'm porting some Delphi assembly code.<br><br>It worked fine with fpc 2.6.0 i386-64bit windows compiler<br><br>When i tried the same code with fpc 2.6.0 i386-64bit for linux it failed to<br>compile with the following error:<br><br>Error: Asm: 16 or 32 Bit references not supported<br><br>at the line<br> // Load XMM5 with the bias value.<br> MOVD XMM5, [Bias] //Bias = Integer<br><br>Is it a know issue or a limitation of linux version?<br></span></span></blockquote></div><br><div>Win64 uses a different calling convention compared to every other x86-64 operating system (Microsoft probably started working on it before the x86-64 ABI was finalized). One of the differences is that only passes the first three integer parameters in registers, while other operating systems pass the first six integer parameters in registers. This means that on Win64, the above translates into</div><div><br></div><div> movd xmm5, [rpb + some_offset]</div><div><br></div><div>while on other platforms, it translates into</div><div><br></div><div> movd xmm5, [r8d]</div><div><br></div><div>So you are creating a reference with r8d as base register, which is invalid (because it's a 32 bit register)</div><div><br></div><div><br></div><div>Jonas</div></body></html>