using __DATE__ in avrasm2

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi freaks,

In several assembly programs I need to print the version date. Using AVRASM2, the line

.db __DATE__

expands (today) to

.db "Sep 24 2004"

An extra zero is added to make the number of bytes even.
The date string is "Americal style". In my program, I need "European style",
e.g. "24-09-2004".

Is there an AVRASM option to directly provide the European style string? If not, is there
an algorithm, smart conversion, or other trick (using macro's ?) to convert this string?

Anyone ??

Regards, Ron

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ronm wrote:
Hi freaks,

In several assembly programs I need to print the version date. Using AVRASM2, the line

.db __DATE__

expands (today) to

.db "Sep 24 2004"

An extra zero is added to make the number of bytes even.
The date string is "Americal style". In my program, I need "European style",
e.g. "24-09-2004".

Is there an AVRASM option to directly provide the European style string? If not, is there
an algorithm, smart conversion, or other trick (using macro's ?) to convert this string?

Anyone ??


There is presently no way to affect the __DATE__ macro's format in the assembler.

There are lots of different ways to format dates throughout the world, not just "Eurpean" and "American" (AFAIK, several different formats are used even in Europe, and I haven't the slightest idea how they format dates in countries like Japan or China :) )

The only reasonably accepted international standard I know about is the so-called "ISO format", YYYY-MM-DD, that would perhaps be the natural choice for date format in a product that is used worldwide, but it's not what you asked for...

I might consider introducing some option allowing users to specify the date format using the flexible syntax used by the strftime(3) C library function, if this is a feature many users will find useful.

Roland Kruse
Atmel AVR Tools

Please don't report bugs in private forum messages.
--
Roland Kruse
Atmel AVR Tools

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As long as we're talking MS Windows there is a setting in the control panel for the preferred format of dates (and times). IMHO this setting should be used if the feature ever comes alive...

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kruse wrote:

There are lots of different ways to format dates throughout the world, not just "Eurpean" and "American" (AFAIK, several different formats are used even in Europe, and I haven't the slightest idea how they format dates in countries like Japan or China :) )

I think Japan uses the ISO format. But you'll have to check around to make sure.

But since it's an International Standard, I personally prefer the ISO format.