<?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>Classic/Legacy CodeWarriorのトピックRe: __DATE__ and __TIME__ in assembly</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180198#M4100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello SVC2&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Note that the pragma and ENTRIES command Ludin is speaking about is valid if you are building code on HC08 or HC12 MCU.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This cannot be used for other microcontrollers.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Aug 2008 18:50:30 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2008-08-26T18:50:30Z</dc:date>
    <item>
      <title>__DATE__ and __TIME__ in assembly</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180192#M4094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is there a way to insert date and time in an assembly code (equivalent to __DATE__ and __TIME__ in C).&lt;/P&gt;&lt;P&gt;Woul like to have something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt; .global _aDate .global _aTime&amp;nbsp;&amp;nbsp;&amp;nbsp; .data _aDate: .long __DATE__&amp;nbsp; ; assembler MACRO_aTime: .long __TIME__&amp;nbsp; ; assembler MACRO .end&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;S&amp;nbsp;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:29:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180192#M4094</guid>
      <dc:creator>SVC2</dc:creator>
      <dc:date>2020-10-29T09:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: __DATE__ and __TIME__ in assembly</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180193#M4095</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;Please do not do cross posting.&lt;/DIV&gt;&lt;DIV&gt;As explained in thread&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;thread.id=5160" target="_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;thread.id=5160&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Macro-assembler language does not support predefined symbols like an ANSI C or C++ compiler does.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Which assembler are you using? CodeWarrior?&lt;/DIV&gt;&lt;DIV&gt;There is no __DATE__ macro to retrieve assembling date in the CodeWarrior macro assembler.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2008 15:21:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180193#M4095</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2008-08-18T15:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: __DATE__ and __TIME__ in assembly</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180194#M4096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Sorry about the cross posting. I didn't know which forum was best suited to my query.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am using CodeWarrior Assembler.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;S.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2008 20:02:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180194#M4096</guid>
      <dc:creator>SVC2</dc:creator>
      <dc:date>2008-08-18T20:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: __DATE__ and __TIME__ in assembly</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180195#M4097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;This is from one CW project of mine and should work:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;/* h file */
#ifndef _LINKING_DAY_H
#define _LINKING_DAY_H

#pragma CONST_SEG MY_DATE

extern const char LinkingDay[];
extern const char LinkingTime[];

#pragma CONST_SEG DEFAULT

#endif /* _LINKING_DAY_H */&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;/* c file */
#include &amp;lt; time.h&amp;gt;
#include "LinkingDay.h"


#pragma CONST_SEG MY_DATE

const char LinkingDay[] = __DATE__;
const char LinkingTime[] = __TIME__;

#pragma CONST_SEG DEFAULT&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt; ; asm file
xref LinkingDay
xref LinkingTime&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:29:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180195#M4097</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2020-10-29T09:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: __DATE__ and __TIME__ in assembly</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180196#M4098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks for the hint.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I tried the code and was wondering what the pragmas are for? My compiler (CW7.0) is complaining:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;Warning : illegal #pragmadate&amp;amp;Time.h line 20   #pragma CONST_SEG MY_DATE &lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Also, xref is an&amp;nbsp;Undefined macro or opcode. Instead I tried:&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;DATE   .long _LinkingDayTIME:   .long _LinkingTime&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;which compiled.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Now how do I interpret the result? The code is converting an array of 11 character (_LinkingDay) or 8 characters (_LinkingTime) to a long.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is this what I was supposed to do or I missed something?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Simon&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:30:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180196#M4098</guid>
      <dc:creator>SVC2</dc:creator>
      <dc:date>2020-10-29T09:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: __DATE__ and __TIME__ in assembly</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180197#M4099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The pragma is there to allocate the variables at a specific location in memory (Code.&lt;BR /&gt;You need to have that segment in the .prm file of your CW project in order to get it working.&lt;BR /&gt;&lt;BR /&gt;Still, if you couldn't xref them, you could always access that address to get the strings. If the compiler doesn't realize that the variables are used and optimize them away, you can add the variable names in the .prm file under ENTRIES:&lt;BR /&gt;&lt;BR /&gt;ENTRIES&lt;BR /&gt;LinkingDay&lt;BR /&gt;LinkingTime&lt;BR /&gt;END&lt;BR /&gt;&lt;BR /&gt;Whatever you do with the strings in assembler is up to you. They will have the format "Aug 28 2008" and "09:00:00" respectively.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 15:36:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180197#M4099</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2008-08-26T15:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: __DATE__ and __TIME__ in assembly</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180198#M4100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello SVC2&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Note that the pragma and ENTRIES command Ludin is speaking about is valid if you are building code on HC08 or HC12 MCU.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This cannot be used for other microcontrollers.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2008 18:50:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/DATE-and-TIME-in-assembly/m-p/180198#M4100</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2008-08-26T18:50:30Z</dc:date>
    </item>
  </channel>
</rss>

