<?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>CodeWarrior for MCUのトピックRe: Codewarrior 6.0 for Microcontrollers &amp; 9S08AW60</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192420#M6952</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The implicit parameter declaration is a warning only because this is legal in ANSI C.&lt;BR /&gt;The point is, as bigmac mentioned, the type of implicit parameters is deduced from the actually given arguments, and given the ANSI C rules of expressions they end up being at least int. So there is no legal way of an implicit parameter declaration of a function with a char parameter, but the compiler cannot issue an error for this case as he only sees the usage and not the declaration.&lt;BR /&gt;About the actual parameter passing, out of my mind the parameter passing is different for a single 16 bit argument for the HC08 and the S08. As the S08 has improves capabilities for using HX together, the compiler is using H:X if I remember right (really not sure).&lt;BR /&gt;Anyway, in the first pattern the BSR did jump to an internal label, while in the second path the actual function was called, so the two patterns really do not show the same. The first pattern compiled with -OnF would probably show more. Anyway, in C never use implicit parameter declarations, configuring this warning to an error is highly recommended.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Feb 2008 04:00:30 GMT</pubDate>
    <dc:creator>CompilerGuru</dc:creator>
    <dc:date>2008-02-22T04:00:30Z</dc:date>
    <item>
      <title>Codewarrior 6.0 for Microcontrollers &amp; 9S08AW60</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192416#M6948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello All,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;For those that have seen my previous posts you know I have been working with a third party GUI library for graphic LCDs.&amp;nbsp; Part of the idea behind these GUI libs is compatibility with any compiler so there is not any processor specific calls made in the lib itself.&amp;nbsp; I have to provide all the low level (the actual writes\reads from the MCU to the LCD controller) which is no problem since the LCD Controller is setup for SPI.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Anyways I keep sending random 0x00 command or data bytes to the LCD controller out the SPI port and I couldn't figure out why.&amp;nbsp; Well I think I hve narrowed down the problem but I am not sure if it's a bug in the compiler or with the GUI libs.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here is a snippet of the code along with the ASM info from the listing file:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;// This is important since it redifines the function sgwrby()#define&amp;nbsp; sgwrby(a,d) simwrby((a),(d))#define&amp;nbsp; sgrdby(a)&amp;nbsp;&amp;nbsp; simrdby((a))// Here is my function that inits the LCD by using the ghw_cmd() function109:&amp;nbsp; void Display_init(void)&amp;nbsp;&amp;nbsp; //UC1601&amp;nbsp; AVC1&amp;nbsp; 110:&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Function: Display_initSource&amp;nbsp; : C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\CODE\UA_Disp_A.cOptions : -Cs08 -D__NO_FLOAT__ -Env"GENPATH=C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\bin;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\prm;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\Sources;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\src;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\lib;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\src;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\cmd;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\CODE;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\DOC;C:\Projects\Universal Actuator\Software\UA_Disp_A;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\asm_include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\HC08c\include" -Env"LIBPATH=C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\asm_include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\HC08c\include" -Env"OBJPATH=C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\bin" -Env"TEXTPATH=C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\bin" -Lasm=%n.lst -Ll=logfile.txt -Ms -ObjN="C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\UA_Disp_A_Data\Standard\ObjectCode\UA_Disp_A.c.o" -OiLib -WmsgSd1106&amp;nbsp; 111:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ghw_cmd(0xe2);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //SET RESET&amp;nbsp; 0000 aee2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [2]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDX&amp;nbsp;&amp;nbsp; #-30&amp;nbsp;&amp;nbsp; // this is loading 0xe2 into the X register&amp;nbsp; 0002 ad45&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [5]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BSR&amp;nbsp;&amp;nbsp; L49 ;abs = 0049// This is the actual function// SGUCHAR = unsigned char 8-bits of course 247:&amp;nbsp; void ghw_cmd( SGUCHAR cmd )&amp;nbsp; 248:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {Function: ghw_cmdSource&amp;nbsp; : C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\CODE\ghwinit.cOptions : -Cs08 -D__NO_FLOAT__ -Env"GENPATH=C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\bin;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\prm;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\Sources;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\src;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\lib;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\src;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\cmd;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\CODE;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\DOC;C:\Projects\Universal Actuator\Software\UA_Disp_A;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\asm_include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\HC08c\include" -Env"LIBPATH=C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\asm_include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\HC08c\include" -Env"OBJPATH=C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\bin" -Env"TEXTPATH=C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\bin" -Lasm=%n.lst -Ll=logfile.txt -Ms -ObjN="C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\UA_Disp_A_Data\Standard\ObjectCode\ghwinit.c.o" -OiLib&amp;nbsp; 249:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #ifdef GHW_PCSIM&amp;nbsp; 250:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ghw_cmd_KS07XXsim( cmd );&amp;nbsp; 251:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&amp;nbsp; 252:&amp;nbsp;&amp;nbsp;&amp;nbsp; 253:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #ifndef GHW_NOHDW&amp;nbsp; 254:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ghw_wait();&amp;nbsp; 255:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sgwrby(GHWCMD, cmd);&amp;nbsp; 0000 5f&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [1]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLRX&amp;nbsp; // remember we loaded the variable we were passing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // now we just cleared X register so we lost the data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // we are trying to send&amp;nbsp; 0001 cc0000&amp;nbsp;&amp;nbsp; [4]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JMP&amp;nbsp;&amp;nbsp; simwrby&amp;nbsp; // this is calling the redefined sgwrby()&amp;nbsp; 256:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endif&amp;nbsp; 257:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }// here is the simwrby()&amp;nbsp;&amp;nbsp;&amp;nbsp; 56:&amp;nbsp; void simwrby(SGUCHAR adr, SGUCHAR dat)&amp;nbsp;&amp;nbsp; 57:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {Function: simwrbySource&amp;nbsp; : C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\CODE\bussim.cOptions : -Cs08 -D__NO_FLOAT__ -Env"GENPATH=C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\bin;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\prm;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\Sources;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\src;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\lib;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\src;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\cmd;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\CODE;C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\DOC;C:\Projects\Universal Actuator\Software\UA_Disp_A;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\asm_include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\HC08c\include" -Env"LIBPATH=C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\hc08c\device\asm_include;C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.0\lib\HC08c\include" -Env"OBJPATH=C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\bin" -Env"TEXTPATH=C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\bin" -Lasm=%n.lst -Ll=logfile.txt -Ms -ObjN="C:\Projects\Universal Actuator\Software\UA_Disp_A\UA_Disp_A\UA_Disp_A_Data\Standard\ObjectCode\bussim.c.o" -OiLib -WmsgSd1106&amp;nbsp; 0000 89&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [2]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PSHX&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 58:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; register SGUCHAR tmp,msk;&amp;nbsp;&amp;nbsp; 59:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 1. Read state of unused bits and initiate used bits for chipselect */&amp;nbsp;&amp;nbsp; 60:&amp;nbsp;&amp;nbsp;&amp;nbsp; // tmp = (sgrdby(_PTFD) &amp;amp; (~(A0|SCLK|SDA|CS))) | ((adr &amp;amp; 0x1) — A0 : 0);&amp;nbsp;&amp;nbsp; 61:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 62:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 2. Set chip select (and clock) low, update address bit */&amp;nbsp;&amp;nbsp; 63:&amp;nbsp;&amp;nbsp;&amp;nbsp; // sgwrby(_PTFD, tmp);&amp;nbsp;&amp;nbsp; 64:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 65:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 3. Loop while clocking data out, msb first */&amp;nbsp;&amp;nbsp; 66:&amp;nbsp; //&amp;nbsp;&amp;nbsp; msk=0x80;&amp;nbsp;&amp;nbsp; 67:&amp;nbsp; //&amp;nbsp;&amp;nbsp; do&amp;nbsp;&amp;nbsp; 68:&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; 69:&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (((dat &amp;amp; msk) != 0))&amp;nbsp;&amp;nbsp; 70:&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; 71:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //sgwrby(_PTFD,tmp|SDA);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 4.a Set data high&amp;nbsp; (other bits is unchanged) */&amp;nbsp;&amp;nbsp; 72:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //sgwrby(_PTFD,tmp|SDA|SCLK);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 5.a Set clock high (other bits is unchanged) */&amp;nbsp;&amp;nbsp; 73:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //sgwrby(_PTFD,tmp|SDA);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 6.a Set clock low&amp;nbsp; (other bits is unchanged) */&amp;nbsp;&amp;nbsp; 74:&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 75:&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&amp;nbsp;&amp;nbsp; 76:&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp; 77:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //sgwrby(_PTFD,tmp);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 4.b Set data low&amp;nbsp;&amp;nbsp; (other bits is unchanged)*/&amp;nbsp;&amp;nbsp; 78:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // sgwrby(_PTFD,tmp|SCLK);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 5.b Set clock high (other bits is unchanged)*/&amp;nbsp;&amp;nbsp; 79:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // sgwrby(_PTFD,tmp);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 6.b Set clock low&amp;nbsp; (other bits is unchanged)*/&amp;nbsp;&amp;nbsp; 80:&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 81:&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msk &amp;gt;&amp;gt;= 1;&amp;nbsp;&amp;nbsp; 82:&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; 83:&amp;nbsp; //&amp;nbsp;&amp;nbsp; while(msk != 0);&amp;nbsp;&amp;nbsp; 84:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 85:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 7. Set chip select high (SCLK must remain low here) */&amp;nbsp;&amp;nbsp; 86:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //sgwrby(_PTFD,tmp|CS);&amp;nbsp;&amp;nbsp; 87:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 88:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(!adr)&amp;nbsp; 0001 95&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [2]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TSX&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0002 7d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [3]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TST&amp;nbsp;&amp;nbsp; ,X&amp;nbsp; 0003 2602&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [3]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BNE&amp;nbsp;&amp;nbsp; L7 ;abs = 0007&amp;nbsp;&amp;nbsp; 89:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_CD_ClrVal();&amp;nbsp; 0005 1d00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [5]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BCLR&amp;nbsp; 6,_PTFD&amp;nbsp; 0007&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L7:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_SPI_SendChar(dat);&amp;nbsp; 0007 cd0000&amp;nbsp;&amp;nbsp; [6]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JSR&amp;nbsp;&amp;nbsp; LCD_SPI_SendChar&amp;nbsp; 000a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LA:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 91:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(LCD_SPI_GetCharsInTxBuf());&amp;nbsp; 000a cd0000&amp;nbsp;&amp;nbsp; [6]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JSR&amp;nbsp;&amp;nbsp; LCD_SPI_GetCharsInTxBuf&amp;nbsp; 000d 650000&amp;nbsp;&amp;nbsp; [3]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CPHX&amp;nbsp; #0&amp;nbsp; 0010 26f8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [3]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BNE&amp;nbsp;&amp;nbsp; LA ;abs = 000a&amp;nbsp;&amp;nbsp; 92:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LCD_CD_SetVal();&amp;nbsp; 0012 1c00&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [5]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BSET&amp;nbsp; 6,_PTFD&amp;nbsp;&amp;nbsp; 93:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; 0014 8a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [3]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PULH&amp;nbsp;&amp;nbsp;&amp;nbsp; 0015 81&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [6]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTS&amp;nbsp;&amp;nbsp; // I think I see the issue// the first var passed is stored in the X register// so when we make the second function call the adr var is equal to 0x00 so it clrs the X register// but that is actually erasing the original data we are passing.&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;As you can see if it wasn't for the ASM stepping function I would still be spinning my wheels trying to figure out why I am transmiting 0x00 all the time.&amp;nbsp; Now I think I know why but I am unsure of how to best fix it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any ideas?&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:45:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192416#M6948</guid>
      <dc:creator>v_dave</dc:creator>
      <dc:date>2020-10-29T09:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior 6.0 for Microcontrollers &amp; 9S08AW60</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192417#M6949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;I don't really see the issue here. Some notes:

&amp;gt;0002 ad45     [5]             BSR   L49 ;abs = 0049
&lt;/PRE&gt;&lt;DIV&gt;&lt;/DIV&gt;The L49 tells me that this is not directly calling another function but instead this is a local call to a common subexpression. So the first snippet is not directly related to the others.&lt;BR /&gt;I would suggest to disable this optimization with -onf in debugging, then the code gets usually more straight forward.&lt;BR /&gt;&lt;BR /&gt;Also single character arguments are not passed in X, the are passed in A. X is only used with larger arguments (16 bit) or with multiple ones, but your snipper does not show other regs being used.&lt;BR /&gt;&lt;BR /&gt;As tip I would also suggest that you should make sure no implicit parameter declaration happens, those are the usual source for such unexpected parameter passing bugs. Especially it is not legal to&lt;BR /&gt;have implicitly declared functions with char arguments/return types as ANSI expects all types to be at least int after propagation. There are warnings issued for all such cases, make sure you do not see any of those.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:45:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192417#M6949</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2020-10-29T09:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior 6.0 for Microcontrollers &amp; 9S08AW60</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192418#M6950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;OK, I found the header file I was missing and that seemed to correct the issue.&amp;nbsp; Thanks that was one of those things that you stare at and don't see but is obvious to someone else.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I still have a question about how the compiler works.&amp;nbsp; In the C manual (Compiler_HC08.pdf) it does state that the compiler passes parameters in the A &amp;amp; X registers.&amp;nbsp; If the A register is supposed to be for the first parameter how come the compiler was using the X register to pass the parameter?&amp;nbsp; I think I know what your answer will be but it seems to me that this could lead a developer down the wrong path tht the compiler has bug not that they forgot to include a header file.&amp;nbsp; I know read the warnings and I should see it but who actually believes that the warning messages are important?&amp;nbsp;Only the Error&amp;nbsp;messages&amp;nbsp;matter ;o)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Before:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;  116:      ghw_cmd(0x23);          //SET Duty=1/65  0004 ae23     [2]             LDX   #35  0006 ad41     [5]             BSR   L49 ;abs = 0049Here it is loading 0x23 into the X register&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;After I found that header file I was missing:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;  116:      ghw_cmd(0x23);          //SET Duty=1/65  0005 a623     [2]             LDA   #35  0007 cd0000   [6]             JSR   ghw_cmdNow it is loading 0x23 into te A register as expected.&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;Anyways thanks for the help and now I should be ble to move on to the next issue &lt;IMG alt=":smileysurprised:" class="emoticon emoticon-smileysurprised" id="smileysurprised" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-surprised.gif" title="Smiley Surprised" /&gt;)&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:45:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192418#M6950</guid>
      <dc:creator>v_dave</dc:creator>
      <dc:date>2020-10-29T09:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior 6.0 for Microcontrollers &amp; 9S08AW60</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192419#M6951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hello Dave,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I assume that what you observed is because an implicit parameter was assumed to be a (signed) 16-bit&lt;BR /&gt;value, so the LS byte would be passed in X.&amp;nbsp; You will probably find that the ACC is zeroed near the&lt;BR /&gt;beginning of the L49 code section.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I think it is important to investigate the reason for every warning given.&amp;nbsp; It is always possible that it will&lt;BR /&gt;lead to the incorrect code being generated by the compiler.&amp;nbsp; An error&amp;nbsp;would be&amp;nbsp;generated because the&lt;BR /&gt;compiler cannot continue, while a warning&amp;nbsp;would be&amp;nbsp;generated when the compiler can make an&lt;BR /&gt;assumption, and then continue with the compile.&amp;nbsp; The assumption may not be relevant.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by bigmac on &lt;SPAN class="date_text"&gt;2008-02-22&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;06:04 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2008 03:02:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192419#M6951</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-22T03:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior 6.0 for Microcontrollers &amp; 9S08AW60</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192420#M6952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The implicit parameter declaration is a warning only because this is legal in ANSI C.&lt;BR /&gt;The point is, as bigmac mentioned, the type of implicit parameters is deduced from the actually given arguments, and given the ANSI C rules of expressions they end up being at least int. So there is no legal way of an implicit parameter declaration of a function with a char parameter, but the compiler cannot issue an error for this case as he only sees the usage and not the declaration.&lt;BR /&gt;About the actual parameter passing, out of my mind the parameter passing is different for a single 16 bit argument for the HC08 and the S08. As the S08 has improves capabilities for using HX together, the compiler is using H:X if I remember right (really not sure).&lt;BR /&gt;Anyway, in the first pattern the BSR did jump to an internal label, while in the second path the actual function was called, so the two patterns really do not show the same. The first pattern compiled with -OnF would probably show more. Anyway, in C never use implicit parameter declarations, configuring this warning to an error is highly recommended.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2008 04:00:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192420#M6952</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2008-02-22T04:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior 6.0 for Microcontrollers &amp; 9S08AW60</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192421#M6953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;OK I know I need to treat warnings as errors.&amp;nbsp; The only excuse (and its a poor one) I have is this particular warning was buried in a bunch of "return parameter value ignored" (or something like that) warnings.&amp;nbsp; So I scrolled through them very quickly and missed it&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have since forced a full rebuild so that I can get a full listing af all my warnings and I have verified each one to make sure I don't have any issues like this again.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;As for the way the vars were passed, that makes sense ANSI C defaults a var to an int if it is not defined and that is why the regiseters were getting loaded incorrectly.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks again for the help.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2008 05:38:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192421#M6953</guid>
      <dc:creator>v_dave</dc:creator>
      <dc:date>2008-02-22T05:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Codewarrior 6.0 for Microcontrollers &amp; 9S08AW60</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192422#M6954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;As tip. the "return value ignored" message can be seletively disabled, or the code can explicitly not use the return value by casting it to void, e.g.&lt;BR /&gt;(void)strcpy(buffer, "Hello");&lt;BR /&gt;&lt;BR /&gt;Messages can be selectively disabled or moved to an error in the Messages dialog in the Compiler for HC08 preference panel.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2008 13:06:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Codewarrior-6-0-for-Microcontrollers-9S08AW60/m-p/192422#M6954</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2008-02-22T13:06:37Z</dc:date>
    </item>
  </channel>
</rss>

