<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CodeWarrior 8- &amp; 16-bit tools: Adding ansiis.lib adds 12k to HCS08 project in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-8-16-bit-tools-Adding-ansiis-lib-adds-12k-to-HCS08/m-p/124875#M115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Posted: Oct 05, 2005 - 09:41 PM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I used the project wizard to create a project for the M68DEMO908GB60 board.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The sample app compiled and linked, but I noticed that it was 12k. Our final processor is only going to have 16k of flash so I tried to trim things down by removing the ansiis.lib. Everything compiled and linked just fine.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The problem was when I created a C routine that was called from main(). It was in the same file, nothing really fancy just a simple call. The linker gave me the following error:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Link Error : L1822: Symbol _Jump_Table_Header_Offset in file C:\USB_Debug\ObjectCode\main.c.&lt;BR /&gt;o is undefined&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;I then added back the ansiis.lib file and things worked again, but it went back to 12k. Is there anywhere to call C routines without including the entire ansiis.lib?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Has anyone got around this problem?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;thanks,&lt;/DIV&gt;&lt;DIV&gt;jon&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;Posted: Oct 06, 2005 - 02:47 PM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Well, it turns out that is was not the calling the C routines that was the problem, but rather my C routine had a switch() in it. The linker was looking for the C library routine that handles switch statements.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So now the question is whether I can just include the file that I need or do I have to include the whole lib along with all the 12k baggage.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;mw_ron&lt;BR /&gt;Moderator&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Posted: Oct 07, 2005 - 03:59 PM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SalsaMan wrote:&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;Well, it turns out that is was not the calling the C routines that was the problem, but rather my C routine had a switch() in it. The linker was looking for the C library routine that handles switch statements.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So now the question is whether I can just include the file that I need or do I have to include the whole lib along with all the 12k baggage.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;There is no library routine that handles switch statement that is part of the compiler. It looks to me like maybe you put an o (oh) instead of a 0 (zero) in your code. Check your code again.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Ron&lt;/DIV&gt;&lt;DIV&gt;_________________&lt;BR /&gt;Ron Liechty&lt;BR /&gt;Ombudsman for Metrowerks&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Posted: Oct 07, 2005 - 04:14 PM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Ron,&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;I'm not sure what you mean by put a zero or 0.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can you verify that having the ansiis.lib adds 12k of code to a project? This lib was added by the wizard.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I disassembled my C code:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;0000 8b PSHH&lt;BR /&gt;143: switch(command)&lt;BR /&gt;0001 a109 CMP #9&lt;BR /&gt;0003 2246 BHI L4B ;abs = 004b&lt;BR /&gt;0005 a106 CMP #6&lt;BR /&gt;0007 95 TSX&lt;BR /&gt;0008 f7 STA ,X&lt;BR /&gt;0009 250f BCS L1A ;abs = 001a&lt;BR /&gt;000b a109 CMP #9&lt;BR /&gt;000d 220b BHI L1A ;abs = 001a&lt;BR /&gt;000f a006 SUB #6&lt;BR /&gt;0011 97 TAX&lt;BR /&gt;0012 4f CLRA&lt;BR /&gt;0013 cd0000 JSR _Jump_Table_Offset&lt;BR /&gt;0016 2c DC.B L43&lt;BR /&gt;0017 2b DC.B L43&lt;BR /&gt;0018 2a DC.B L43&lt;BR /&gt;0019 29 DC.B L43&lt;BR /&gt;001a L1A:&lt;BR /&gt;001a 410106 CBEQA #1,L23 ;abs = 0023&lt;BR /&gt;001d a102 CMP #2&lt;BR /&gt;001f 262a BNE L4B ;abs = 004b&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;And you will notice the _Jump_Table_Offset routine which can be found in rtshc08.c which is part of ansiis.lib. So it would look to me that the compiler HCS08 is using a library routine to handle the switch statement.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I was able to extract the routine and put it in one of my source files so I would not have to include the entire library.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What granularity can the linker add routines. I thought some linkers would just add a file if a routine is needed. It looks like it adds the entire library is any one routine is needed.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am assuming that the numbers at the bottom of the project window are accurate for the code size and data size.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;thanks,&lt;/DIV&gt;&lt;DIV&gt;jon&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Posted: Oct 17, 2005 - 03:06 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The numbers at the bottom of the project aren't accurate at all.&lt;BR /&gt;They just indicate the total size of all code you have written.&lt;BR /&gt;The linker does not link functions to the program which aren't used,&lt;BR /&gt;unless explicitly told to do so with ENTRIES in the prm-file.&lt;/DIV&gt;&lt;DIV&gt;For details about the actual program size, check the .map file.&lt;/DIV&gt;&lt;DIV&gt;You can not remove the ansi-lib because then writing code in C won't work anymore.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Posted: Oct 17, 2005 - 10:03 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;datekdev,&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks for the reply! That makes sense now that I looked at the map file. I am used to using CodeWarrior for developing PC and Mac so I am still adjusting to the slight differences for the embedded toolset.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;jon&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Jan 2006 01:48:21 GMT</pubDate>
    <dc:creator>marc_paquette</dc:creator>
    <dc:date>2006-01-28T01:48:21Z</dc:date>
    <item>
      <title>CodeWarrior 8- &amp; 16-bit tools: Adding ansiis.lib adds 12k to HCS08 project</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-8-16-bit-tools-Adding-ansiis-lib-adds-12k-to-HCS08/m-p/124875#M115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Posted: Oct 05, 2005 - 09:41 PM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I used the project wizard to create a project for the M68DEMO908GB60 board.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The sample app compiled and linked, but I noticed that it was 12k. Our final processor is only going to have 16k of flash so I tried to trim things down by removing the ansiis.lib. Everything compiled and linked just fine.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The problem was when I created a C routine that was called from main(). It was in the same file, nothing really fancy just a simple call. The linker gave me the following error:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Link Error : L1822: Symbol _Jump_Table_Header_Offset in file C:\USB_Debug\ObjectCode\main.c.&lt;BR /&gt;o is undefined&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;I then added back the ansiis.lib file and things worked again, but it went back to 12k. Is there anywhere to call C routines without including the entire ansiis.lib?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Has anyone got around this problem?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;thanks,&lt;/DIV&gt;&lt;DIV&gt;jon&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;Posted: Oct 06, 2005 - 02:47 PM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Well, it turns out that is was not the calling the C routines that was the problem, but rather my C routine had a switch() in it. The linker was looking for the C library routine that handles switch statements.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So now the question is whether I can just include the file that I need or do I have to include the whole lib along with all the 12k baggage.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;mw_ron&lt;BR /&gt;Moderator&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Posted: Oct 07, 2005 - 03:59 PM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SalsaMan wrote:&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;Well, it turns out that is was not the calling the C routines that was the problem, but rather my C routine had a switch() in it. The linker was looking for the C library routine that handles switch statements.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So now the question is whether I can just include the file that I need or do I have to include the whole lib along with all the 12k baggage.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;There is no library routine that handles switch statement that is part of the compiler. It looks to me like maybe you put an o (oh) instead of a 0 (zero) in your code. Check your code again.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Ron&lt;/DIV&gt;&lt;DIV&gt;_________________&lt;BR /&gt;Ron Liechty&lt;BR /&gt;Ombudsman for Metrowerks&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Posted: Oct 07, 2005 - 04:14 PM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Ron,&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;I'm not sure what you mean by put a zero or 0.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can you verify that having the ansiis.lib adds 12k of code to a project? This lib was added by the wizard.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I disassembled my C code:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;0000 8b PSHH&lt;BR /&gt;143: switch(command)&lt;BR /&gt;0001 a109 CMP #9&lt;BR /&gt;0003 2246 BHI L4B ;abs = 004b&lt;BR /&gt;0005 a106 CMP #6&lt;BR /&gt;0007 95 TSX&lt;BR /&gt;0008 f7 STA ,X&lt;BR /&gt;0009 250f BCS L1A ;abs = 001a&lt;BR /&gt;000b a109 CMP #9&lt;BR /&gt;000d 220b BHI L1A ;abs = 001a&lt;BR /&gt;000f a006 SUB #6&lt;BR /&gt;0011 97 TAX&lt;BR /&gt;0012 4f CLRA&lt;BR /&gt;0013 cd0000 JSR _Jump_Table_Offset&lt;BR /&gt;0016 2c DC.B L43&lt;BR /&gt;0017 2b DC.B L43&lt;BR /&gt;0018 2a DC.B L43&lt;BR /&gt;0019 29 DC.B L43&lt;BR /&gt;001a L1A:&lt;BR /&gt;001a 410106 CBEQA #1,L23 ;abs = 0023&lt;BR /&gt;001d a102 CMP #2&lt;BR /&gt;001f 262a BNE L4B ;abs = 004b&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;And you will notice the _Jump_Table_Offset routine which can be found in rtshc08.c which is part of ansiis.lib. So it would look to me that the compiler HCS08 is using a library routine to handle the switch statement.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I was able to extract the routine and put it in one of my source files so I would not have to include the entire library.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What granularity can the linker add routines. I thought some linkers would just add a file if a routine is needed. It looks like it adds the entire library is any one routine is needed.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am assuming that the numbers at the bottom of the project window are accurate for the code size and data size.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;thanks,&lt;/DIV&gt;&lt;DIV&gt;jon&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Posted: Oct 17, 2005 - 03:06 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The numbers at the bottom of the project aren't accurate at all.&lt;BR /&gt;They just indicate the total size of all code you have written.&lt;BR /&gt;The linker does not link functions to the program which aren't used,&lt;BR /&gt;unless explicitly told to do so with ENTRIES in the prm-file.&lt;/DIV&gt;&lt;DIV&gt;For details about the actual program size, check the .map file.&lt;/DIV&gt;&lt;DIV&gt;You can not remove the ansi-lib because then writing code in C won't work anymore.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Posted: Oct 17, 2005 - 10:03 AM&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;datekdev,&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks for the reply! That makes sense now that I looked at the map file. I am used to using CodeWarrior for developing PC and Mac so I am still adjusting to the slight differences for the embedded toolset.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;jon&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jan 2006 01:48:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-8-16-bit-tools-Adding-ansiis-lib-adds-12k-to-HCS08/m-p/124875#M115</guid>
      <dc:creator>marc_paquette</dc:creator>
      <dc:date>2006-01-28T01:48:21Z</dc:date>
    </item>
  </channel>
</rss>

