flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > timestamp directive or "%t" already in |
Author |
|
revolution 19 Feb 2012, 11:38
Why restrict yourself to only one timestamp possibility? And which timestamp format standard would you suggest following anyway?
I would suggest instead that you can use a macro for both of these operations and it would give you the flexibility to implement any of the integer coding standards you require. BTW: I trust you did not forget about %t. |
|||
19 Feb 2012, 11:38 |
|
Tomasz Grysztar 19 Feb 2012, 13:09
DOS386 wrote: FASM already has the conversion routine, it's (strangely) in SYSTEM.INC The [unfinished] official guide to flat assembler internals, section 2.6 wrote: The "make_timestamp" routine should return the valid timestamp in the EAX. Last edited by Tomasz Grysztar on 19 Feb 2012, 13:48; edited 1 time in total |
|||
19 Feb 2012, 13:09 |
|
DOS386 19 Feb 2012, 13:36
Actually "%t" seems to cover most of this issue, except:
* 64-bit timestamps * Other-than-now timestamps ("%t=1980-01-01T00:00:00" ???) > not be strange considering that it is a > documented part of fasm's OS abstraction interface OK ... one could just split the "6-to-1" conversion from "peek-6-from-the-OS", as it would be needed for other-than-now timestamps. AFAIK 32-bit timestamps will die in 2038: Last edited by DOS386 on 19 Feb 2012, 13:38; edited 1 time in total |
|||
19 Feb 2012, 13:36 |
|
revolution 19 Feb 2012, 13:38
There is no reason that %t cannot return a 64-bit value in the future. It might be 32-bit today, but tomorrow ...?
|
|||
19 Feb 2012, 13:38 |
|
DOS386 19 Feb 2012, 13:40
But having the very same "%t" returning 64-bit instead of 32-bit will break things (or would break if anyone used it ...).
|
|||
19 Feb 2012, 13:40 |
|
revolution 19 Feb 2012, 13:42
Why? So far %t has always returned a positive number less than 31-bit. %t can continue to return a positive number after April 2038. Where is the problem?
|
|||
19 Feb 2012, 13:42 |
|
DOS386 19 Feb 2012, 13:46
> Where is the problem?
In C and C+++ compilers. "int" is unknown size (used to be usually 32-bit) and usually signed. Set your clock to 2040 and enjoy various apps crashing |
|||
19 Feb 2012, 13:46 |
|
revolution 19 Feb 2012, 13:47
fasm != C or C+++ [sic], thankfully.
|
|||
19 Feb 2012, 13:47 |
|
Tomasz Grysztar 19 Feb 2012, 13:57
Well, I set my clock to 2050 and assembled:
Code: dq %t |
|||
19 Feb 2012, 13:57 |
|
revolution 28 Feb 2012, 01:42
Bonus points to anyone that implements a macro to do full conversion to and from RFC2550 and a full 64-bit signed %t value.
|
|||
28 Feb 2012, 01:42 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.