<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16525" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><A 
  title=oskar@atk-it.com href="mailto:oskar@atk-it.com">Oskar Atkinson</A> 
  wrote:</DIV>
  <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><FONT 
  face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT face=Arial 
  size=2></FONT><BR>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2>Hi,</FONT></SPAN></DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>I am absulutly new 
  to programming on Frescale uC's ( HC9S12C64 ), professionally I am developing 
  for the win32 platform.</FONT></SPAN></DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>I am attemting to 
  port code which is written for GNU&nbsp;&nbsp;to ICC. Of course I am getting 
  all kinds of compiler errors</FONT></SPAN></DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV></BLOCKQUOTE>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>Porting is easy when 
you know what you are doing. I'm not familiar with GCC, I may only guess what 
all those attributes are about. </FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>How would this be 
  correct&nbsp;in ICC ?</FONT></SPAN></DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>#define 
  LOOKUP_ATTR __attribute__ ((section (".lookup")))</FONT></SPAN></DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>#define VECT_ATTR 
  __attribute__ ((section (".vectors")))</FONT></SPAN></DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>extern const int 
  cltfactor_table[1024] LOOKUP_ATTR;</FONT></SPAN></DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV></BLOCKQUOTE>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>^^ this looks like 
putting some&nbsp;table of constants into nondefault memory area. Well, with 
extern declaration (in the header probably) you shouldn't do anything, just 
remove LOOKUP_ATTR.</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>extern const int 
cltfactor_table[1024];</FONT></SPAN></DIV></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007></SPAN><SPAN 
class=147271915-23082007></SPAN><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>Definition is bit 
different. First of all create you custom memory section by putting -b linker 
option into </FONT></SPAN><SPAN class=147271915-23082007><FONT face=Arial 
size=2>Project-&gt;Options-&gt;Other Options edit box. For 
example</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2>-blookup:0x1000.0x4FFF</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>^^ this defines area 
lookup from 0x1000 to 0x4FFF</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>Then in C source you 
write</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>#pragma 
text:lookup</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>const int 
cltfactor_table[1024]={1,2,3,4,5,6};</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007>// add here more initialized const 
variables</SPAN></DIV>
<DIV><SPAN class=147271915-23082007>#pragma 
text:text</SPAN></DIV></FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2>&nbsp;</FONT></SPAN></DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>INTERRUPT void 
  UnimplementedISR(void) POST_INTERRUPT;<BR>INTERRUPT void ISR_Ign_TimerIn(void) 
  POST_INTERRUPT_TEXT3;</FONT></SPAN></DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV></BLOCKQUOTE>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>ISR's must 
be&nbsp;easier than in GCC. 1) Remove&nbsp; INTERRUPT and POST_xxx, 2) add 
#pragma interrupt_handler &lt;function name&gt; to the file where ISR's are 
defined:</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>#pragma 
interrupt_handler UnimplementedISR</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>void 
UnimplementedISR(void)</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2>{</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007>...</SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial 
size=2>}<BR></FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>
<DIV><SPAN class=147271915-23082007><FONT face=Arial size=2>#pragma 
interrupt_handler ISR_Ign_TimerIn</FONT></SPAN></DIV>
<DIV><SPAN class=147271915-23082007></SPAN>void 
ISR_Ign_TimerIn(void)</FONT></SPAN></DIV></DIV>
<DIV><SPAN class=147271915-23082007>{</SPAN></DIV>
<DIV><SPAN class=147271915-23082007>}</SPAN></DIV>
<DIV><SPAN class=147271915-23082007></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007></SPAN>&nbsp;</DIV>
<DIV><SPAN class=147271915-23082007>Regards</SPAN></DIV>
<DIV><SPAN class=147271915-23082007>Edward</SPAN></DIV></FONT></SPAN></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2>TIA</FONT></SPAN></DIV>
  <DIV><SPAN class=147271915-23082007><FONT face=Arial 
  size=2>Oskar</FONT></SPAN></DIV>
  <P></P><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><FONT 
  face=Arial size=2></FONT><FONT face=Arial size=2></FONT>
  <HR>

  <P></P>_______________________________________________<BR>Icc-mot mailing 
  list<BR>Icc-mot@imagecraft.com<BR>http://dragonsgate.net/mailman/listinfo/icc-mot<BR></BLOCKQUOTE></BODY></HTML>