Hi<br><br>May I have some help in this code ? I am on arm-linux-uclibc. Compiling using :-<br><br><br># ppcrossarm -MObjFPC -TLinux -Parmv5 -gl -Xd -Xs -l -darm -XParm-unknown-linux-uclibcgnueabi- -CfSOFT -CaEABI -darm -gl -O- -CpARMV5 -uUSE_LOCALIZE -Fu/usr/local/lib/fpc/2.5.1/units/arm-linux/* -Fl$/usr/staging/usr/arm-unknown-linux-uclibcgnueabi/lib -FL/usr/staging/lib/ld-uClibc.so.0 -XR/usr/staging -Fl/usr/staging/lib -Fl/usr/staging/usr/lib -k"--sysroot=/usr/staging" -k"-rpath-link=/usr/staging/usr/arm-unknown-linux-uclibcgnueabi/lib/" main1.pas<br>
<br><br>Program main;<br><br>function fact(x : integer):integer;assembler;<br><br>label<br> loop;<br>asm<br>.text<br>.align 2<br> mov r1,r0 <br> mov r2,#1<br> loop: <br> mul r3,r2,r1<br> mov r2,r3<br>
subs r1,r1,#1<br> cmp r1,#0<br> bgt loop<br><br> MOV r0,r2<br> MOV pc,lr<br>end;<br><br><br>var <br>i:integer;<br><br>begin<br> for i:=1 to 10 do<br> writeln('factorial',i,fact(i));<br>
end.<br><br><br><br>This compiles and links. But wont execute on Arm target (at91sam9263ek). Just waits endless. The equivalent C code linked to the external assembled code works well.<br><br><br><br> regards<br><br>Nataraj<br>