<?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のトピックprintf can't output 8-bit variable</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/printf-can-t-output-8-bit-variable/m-p/1998584#M20251</link>
    <description>&lt;LI-CODE lang="c"&gt;135           printf("%hhu %d\n", byte, 9999);
0xfe89b8:   90270F LD D2,#9999
0xfe89bb:   0402 PSH D2
0xfe89bd:   A4120A LD D0,4618
0xfe89c0:   9E40 TFR D0,D2
0xfe89c2:   0402 PSH D2
0xfe89c4:   98001201 LD X,#4609
0xfe89c8:   0442 PSH X
0xfe89ca:   BBFEF83D JSR 16709693 printf (0xfef83d)&lt;/LI-CODE&gt;&lt;P&gt;byte is defined as an 8-bit variable:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;unsigned char byte;&lt;/LI-CODE&gt;&lt;P&gt;when call printf function, the compiler loads it to D0 (8-bit) register and then transfers to D2 (16-bit) register, then pushes the 16 bits value to stack. But in the printf,&amp;nbsp; it is retrieved as an 8-bit value from stack. Is it a compiler bug?&lt;/P&gt;&lt;P&gt;CodeWarrior for MCU&lt;BR /&gt;Version: 10.7&lt;BR /&gt;Build Id:160721&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2024 06:45:43 GMT</pubDate>
    <dc:creator>fqh</dc:creator>
    <dc:date>2024-11-21T06:45:43Z</dc:date>
    <item>
      <title>printf can't output 8-bit variable</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/printf-can-t-output-8-bit-variable/m-p/1998584#M20251</link>
      <description>&lt;LI-CODE lang="c"&gt;135           printf("%hhu %d\n", byte, 9999);
0xfe89b8:   90270F LD D2,#9999
0xfe89bb:   0402 PSH D2
0xfe89bd:   A4120A LD D0,4618
0xfe89c0:   9E40 TFR D0,D2
0xfe89c2:   0402 PSH D2
0xfe89c4:   98001201 LD X,#4609
0xfe89c8:   0442 PSH X
0xfe89ca:   BBFEF83D JSR 16709693 printf (0xfef83d)&lt;/LI-CODE&gt;&lt;P&gt;byte is defined as an 8-bit variable:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;unsigned char byte;&lt;/LI-CODE&gt;&lt;P&gt;when call printf function, the compiler loads it to D0 (8-bit) register and then transfers to D2 (16-bit) register, then pushes the 16 bits value to stack. But in the printf,&amp;nbsp; it is retrieved as an 8-bit value from stack. Is it a compiler bug?&lt;/P&gt;&lt;P&gt;CodeWarrior for MCU&lt;BR /&gt;Version: 10.7&lt;BR /&gt;Build Id:160721&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2024 06:45:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/printf-can-t-output-8-bit-variable/m-p/1998584#M20251</guid>
      <dc:creator>fqh</dc:creator>
      <dc:date>2024-11-21T06:45:43Z</dc:date>
    </item>
  </channel>
</rss>

