<?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>S12 / MagniV MicrocontrollersのトピックRe: HCS12 Disassembler doesn't show constant variable</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-Disassembler-doesn-t-show-constant-variable/m-p/178904#M6415</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I was able to see the rodata (constant)&amp;nbsp;in the file generated by the "decoder".&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Thanks for the answer.&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Aug 2008 10:53:05 GMT</pubDate>
    <dc:creator>ssinfod</dc:creator>
    <dc:date>2008-08-13T10:53:05Z</dc:date>
    <item>
      <title>HCS12 Disassembler doesn't show constant variable</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-Disassembler-doesn-t-show-constant-variable/m-p/178902#M6413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi, I am currently working with a 9S12DP512 MCU.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have the following code in 'C' and I want to see how the assembler is generating the assembly code for the constant variables. (array, struct, etc...)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&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;#include &amp;lt;hidef.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* common defines and macros */#include &amp;lt;mc9s12dp512.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* derivative information */#pragma LINK_INFO DERIVATIVE "mc9s12dp512"const char array[] = {32,32,32,32,32,32,32,32,32,32,32,33,33,33,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,37,37,37,38,38,39,39,40,40,41,41,42,42,43,44,44,45,46,47,48,49,50,51,52,53,54,56,57,59,60,62,64,66,68,70,73,76,79,82,85,89,94};int val = 0;void mp_dummy(int in_param){&amp;nbsp;&amp;nbsp;&amp;nbsp; val = array[in_param];}void main(void) {&amp;nbsp; /* put your own code here */&amp;nbsp; EnableInterrupts;&amp;nbsp; mp_dummy(1);&amp;nbsp;&amp;nbsp;&amp;nbsp; for(;;) {} /* wait forever */}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;When I use the disassembler, I don't see any "DC.x" declaration for the const array ? Where is it ?&amp;nbsp;Is there an option&amp;nbsp;to display the generated assembly code for the constant ?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&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;ANSI-C/cC++ Compiler for HC12 V-5.0.24 Build 4047, Feb 17 2004&amp;nbsp;&amp;nbsp;&amp;nbsp; 1:&amp;nbsp; #include &amp;lt;hidef.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* common defines and macros */&amp;nbsp;&amp;nbsp;&amp;nbsp; 2:&amp;nbsp; #include &amp;lt;mc9s12dp512.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* derivative information */&amp;nbsp;&amp;nbsp;&amp;nbsp; 3:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5:&amp;nbsp; #pragma LINK_INFO DERIVATIVE "mc9s12dp512"&amp;nbsp;&amp;nbsp;&amp;nbsp; 6:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7:&amp;nbsp; const char array[] = {32,32,32,32,32,32,32,32,32,32,32,33,33,33,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,37,37,37,38,38,39,39,40,40,41,41,42,42,43,44,44,45,46,47,48,49,50,51,52,53,54,56,57,59,60,62,64,66,68,70,73,76,79,82,85,89,94};&amp;nbsp;&amp;nbsp;&amp;nbsp; 8:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9:&amp;nbsp; int val = 0;&amp;nbsp;&amp;nbsp; 10:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11:&amp;nbsp; void mp_dummy(int in_param)&amp;nbsp;&amp;nbsp; 12:&amp;nbsp; {Function: mp_dummySource&amp;nbsp; : C:\Example\Sources\main.cOptions : -D_HCS12 -D__NO_FLOAT__ -Env"GENPATH=C:\Example;C:\Example\bin;C:\Example\prm;C:\Example\cmd;C:\Example\Sources;C:\CodeWarrior CW12_V3.1\lib\HC12c\lib;C:\CodeWarrior CW12_V3.1\lib\HC12c\src;C:\CodeWarrior CW12_V3.1\lib\HC12c\include" -Env"LIBPATH=C:\CodeWarrior CW12_V3.1\lib\HC12c\include" -Env"OBJPATH=C:\Example\bin" -Env"TEXTPATH=C:\Example\bin" -Lasm="C:\Example\Example-Disassemble_Data\Simulator\ObjectCode\main.c.lst" -Mb -ObjN="C:\Example\Example-Disassemble_Data\Simulator\ObjectCode\main.c.o" -WmsgSd1106&amp;nbsp; 0000 3b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PSHD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val = array[in_param];&amp;nbsp; 0001 e681&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDAB&amp;nbsp; 1,SP&amp;nbsp; 0003 ce0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDX&amp;nbsp;&amp;nbsp; #array&amp;nbsp; 0006 a6e5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDAA&amp;nbsp; B,X&amp;nbsp; 0008 b705&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEX&amp;nbsp;&amp;nbsp; A,X&amp;nbsp; 000a 7e0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STX&amp;nbsp;&amp;nbsp; val&amp;nbsp;&amp;nbsp; 14:&amp;nbsp; }&amp;nbsp; 000d 3a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PULD&amp;nbsp;&amp;nbsp;&amp;nbsp; 000e 0a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16:&amp;nbsp; void main(void)&amp;nbsp;&amp;nbsp;&amp;nbsp; 17:&amp;nbsp; {Function: mainSource&amp;nbsp; : C:\Example\Sources\main.cOptions : -D_HCS12 -D__NO_FLOAT__ -Env"GENPATH=C:\Documents and Settings\phd\Local Settings\Application Data\Example-Disassemble;C:\Example\bin;C:\Example\prm;C:\Example\cmd;C:\Example\Sources;C:\CodeWarrior CW12_V3.1\lib\HC12c\lib;C:\CodeWarrior CW12_V3.1\lib\HC12c\src;C:\CodeWarrior CW12_V3.1\lib\HC12c\include" -Env"LIBPATH=C:\CodeWarrior CW12_V3.1\lib\HC12c\include" -Env"OBJPATH=C:\Example\bin" -Env"TEXTPATH=C:\Example\bin" -Lasm="C:\Example\Example-Disassemble_Data\Simulator\ObjectCode\main.c.lst" -Mb -ObjN="C:\Example\Example-Disassemble_Data\Simulator\ObjectCode\main.c.o" -WmsgSd1106&amp;nbsp;&amp;nbsp; 18:&amp;nbsp;&amp;nbsp;&amp;nbsp; /* put your own code here */&amp;nbsp;&amp;nbsp; 19:&amp;nbsp;&amp;nbsp;&amp;nbsp; EnableInterrupts;&amp;nbsp; 0000 10ef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLI&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20:&amp;nbsp;&amp;nbsp;&amp;nbsp; mp_dummy(1);&amp;nbsp; 0002 c601&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDAB&amp;nbsp; #1&amp;nbsp; 0004 87&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLRA&amp;nbsp;&amp;nbsp;&amp;nbsp; 0005 4a000000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL&amp;nbsp; mp_dummy,PAGE(mp_dummy)&amp;nbsp;&amp;nbsp; 21:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22:&amp;nbsp;&amp;nbsp;&amp;nbsp; for(;;) {} /* wait forever */&amp;nbsp; 0009 20fe&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BRA&amp;nbsp;&amp;nbsp; *+0 ;abs = 0009&amp;nbsp;&amp;nbsp; 23:&amp;nbsp; }&amp;nbsp;&amp;nbsp; 24: &lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;As you see, there is no ASM code for the "const char array[]" variable. The same thing happen for more complex data type.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any idea ?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:27:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-Disassembler-doesn-t-show-constant-variable/m-p/178902#M6413</guid>
      <dc:creator>ssinfod</dc:creator>
      <dc:date>2020-10-29T09:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: HCS12 Disassembler doesn't show constant variable</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-Disassembler-doesn-t-show-constant-variable/m-p/178903#M6414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The compiler is not generating assembly code at all, it directly issues object files.&lt;BR /&gt;&lt;BR /&gt;The default disassembly file as shown in the OP is the compiler generated listing file, its only purpose is to be read by humans,&lt;BR /&gt;it does today only show the code and not constants as you noted.&lt;BR /&gt;&lt;BR /&gt;You can check the constants in the debugger, or you can disassemble the object files.&lt;BR /&gt;To disassemble object files, enable the corresponding check box in the compiler preferences&lt;BR /&gt;(something like "use the decoder to generate the disassembly listing").&lt;BR /&gt;In addition you probably have to enable dumping of the ELF sections in the Importer for HC12 settings too,&lt;BR /&gt;as by default the decoder also only shows the disassembled code and does not display the plain section content.&lt;BR /&gt;(That's some option in the importer, don't know what it is by heart,I'm usually using "-e -ed -d" but that dumps too much,&lt;BR /&gt;that also issues the debug information internals)&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, 08 Aug 2008 05:03:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-Disassembler-doesn-t-show-constant-variable/m-p/178903#M6414</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2008-08-08T05:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: HCS12 Disassembler doesn't show constant variable</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-Disassembler-doesn-t-show-constant-variable/m-p/178904#M6415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I was able to see the rodata (constant)&amp;nbsp;in the file generated by the "decoder".&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Thanks for the answer.&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2008 10:53:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-Disassembler-doesn-t-show-constant-variable/m-p/178904#M6415</guid>
      <dc:creator>ssinfod</dc:creator>
      <dc:date>2008-08-13T10:53:05Z</dc:date>
    </item>
  </channel>
</rss>

