<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>inline assembly help linker error</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/14962/inline-assembly-help-linker-error</link><description> 
#include &amp;lt;reg5000.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;

void main(void);
void writebyte (unsigned char ch);


void main()
{
	unsigned char ch;
	ch=0x0A;
	writebyte(ch);
}

void writebyte (unsigned char ch)
{
	ACC=ch;

#pragma ASM
	PUSH	MCON
	ORL	MCON,	#4
	MOVX	@R0</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: inline assembly help linker error</title><link>https://community.arm.com/thread/38715?ContentTypeID=1</link><pubDate>Mon, 13 May 2002 14:01:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:eeb1f040-c9e9-406d-bcf5-b57dbab1ce95</guid><dc:creator>Jon Young</dc:creator><description>&lt;p&gt;Just included a dummy C file into your project. Right now it thinks you are compiling a pure assemble routine, and it does not include the C runtime modules.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: inline assembly help linker error</title><link>https://community.arm.com/thread/38724?ContentTypeID=1</link><pubDate>Mon, 13 May 2002 13:57:27 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:91ee38d2-860c-487d-912d-fd97af6d654f</guid><dc:creator>Jim Nanney</dc:creator><description>&lt;p&gt;Doh!!&lt;br /&gt;
&lt;br /&gt;
Just to follow up...&lt;br /&gt;
&lt;br /&gt;
I found the answer here:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.keil.com/support/docs/1980.htm"&gt;http://www.keil.com/support/docs/1980.htm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
and for those too lazy to look above, here it is...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CAUSE&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
When you compile all your C modules with the SRC directive and the assembler, the linker does not detect the required C run-time libraries (because the files were assembled). In this case, you must add the libraries to your project manually. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;RESOLUTION&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
For a project in the SMALL memory model that uses no floating point arithmetic, C51S.LIB is required. &lt;br /&gt;
&lt;br /&gt;
For a project in the LARGE memory model that uses floating-point, C51FPL.LIB and C51L.LIB are required. &lt;br /&gt;
&lt;br /&gt;
If a project uses floating arithmetic, it is important that C51FPx.LIB is included before the standard library file C51x.LIB. Otherwise printf and scanf will not work with floating-point numbers. &lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: inline assembly help linker error</title><link>https://community.arm.com/thread/38723?ContentTypeID=1</link><pubDate>Mon, 13 May 2002 12:38:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8a5e7ee3-a47f-4ea3-a9ef-a7d616811e8d</guid><dc:creator>Jim Nanney</dc:creator><description>&lt;p&gt;s/STARTINIT.A51/STARTUP.A51/g&lt;br /&gt;
(meant STARTUP.a51 not STARTINIT.a51)&lt;br /&gt;
&lt;br /&gt;
sorry (coffee depletion imminent)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>