<?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>Asm/C preprocessor does not like Long Constants.</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/13989/asm-c-preprocessor-does-not-like-long-constants</link><description> Hi, 
	I have a problem with the way your preprocessor works. This problem occurs in both assembly and in C. 
	The reason we started trying to do this in C was that the assembler had a problem and while it accepted the code, did not produce the correct</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Asm/C preprocessor does not like Long Constants.</title><link>https://community.arm.com/thread/37335?ContentTypeID=1</link><pubDate>Thu, 15 Mar 2001 12:45:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:252d1629-7ee7-4a97-8263-c73434e3a9dc</guid><dc:creator>Thomas Mazowiesky</dc:creator><description>&lt;p&gt;You may have run into the same problem we did.  We found that you had to give both constants the proper cast when dividing.  The original code:&lt;br /&gt;
#define DELAY_20_MS ((USHORT)((long)(2000000L) / CLOCK_PERIOD_32K_100)) &lt;br /&gt;
&lt;br /&gt;
would need to be changed to:&lt;br /&gt;
#define DELAY_20_MS ((USHORT)((long)(2000000L) / (long)CLOCK_PERIOD_32K_100)) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I assume the USHORT is an unsigned int and not an unsigned char.  Once we added the cast for the second parameter, the value was calculated correctly, otherwise it was set to 0.&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>