<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
After reading the FPC manual more closely , the correct compiler
command is {$ASMMODE default} where<i> default </i>is the native
system ... in this case Orange Pi arm64 and the compiler now allows
accepting ARM assembler instructions.<br>
<br>
However it won't allow referencing a Pascal variable.<br>
<br>
Here is an example (32-bit) of x86 inline assembler that works
correctly<br>
<br>
procedure MSBitTest ( DataIn : longword);<br>
var<br>
MSBit : longword;<br>
<br>
begin<br>
asm<br>
bsr eax , DataIn<br>
mov MsBit , eax<br>
end;<br>
end;<br>
<br>
.......... the ARM version fails (similar code : ignore the fact it
is the reverse of BSR) ... what am I missing ?<br>
<br>
procedure MSBitTest ( DataIn : longword);<br>
var<br>
MSBit : longword;<br>
<br>
begin<br>
asm<br>
clz w4 , DataIn<br>
mov MsBit , w4<br>
end;<br>
end;<br>
<br>
Regards<br>
Vern<br>
<br>
<div class="moz-cite-prefix">On 06/04/2023 11:36 a.m., Sven Barth
via fpc-pascal wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFMUeB-9Fo4H=B2Q+Hyr1i_Muf9rePVeK5kn4c3nVUd4OyRnWg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">
<div>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Vern via fpc-pascal <<a
href="mailto:fpc-pascal@lists.freepascal.org"
moz-do-not-send="true" class="moz-txt-link-freetext">fpc-pascal@lists.freepascal.org</a>>
schrieb am Do., 6. Apr. 2023, 17:32:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Does the
current FPC compiler support ARM inline assembler ?<br>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Yes. </div>
<div dir="auto"><br>
</div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If so what is the equivalent ARM command for {$ASMMODE
intel}<br>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">There is none, because only one syntax is
supported. </div>
<div dir="auto"><br>
</div>
<div dir="auto">Regards, </div>
<div dir="auto">Sven </div>
<div dir="auto">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote>
</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-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="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a>
</pre>
</blockquote>
<br>
</body>
</html>