flat assembler
Message board for the users of flat assembler.

Index > Main > how 2 assign a time stamp as the var value when compiling?

Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 24 Jul 2008, 08:48
Hi!
Is it possible to assign a time stamp as the var value during compilation?
the idea is the following: fasm generates BIOS Param Block for FAT file system. I want to assign timestamp to BS_VolID (dword) variable so it will be different each time the source code is compiled. How can I do this?
Thanks a lot!
Post 24 Jul 2008, 08:48
View user's profile Send private message Reply with quote
SFeLi



Joined: 03 Nov 2004
Posts: 138
SFeLi 24 Jul 2008, 11:33
Code:
dd %t    
?
Post 24 Jul 2008, 11:33
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 24 Jul 2008, 20:53
thanks, SFeLi. But I figured out that this doesn't work in my case. It seems that standard time/date stamp (used in PE headers, for example) and time/date format used by FAT are not the same. For example,
a file was created on 24.07.08 20:36 GMT (plus/minus some seconds, it's not critical).
%t command outputs 4888E7B6 time/date stamp
but date and time of last write in FAT Directory Entry is written as 38F8BC83h.
These values not even close to each other...

*went to do some research on the subj.... maybe i'd be able to write some macro that will convert one timestamp to another (bad for me that I'm absolute zero in macro writing:( )
Post 24 Jul 2008, 20:53
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 25 Jul 2008, 07:03
F838 is MS-DOS date for 7/24/2008
11100 = 28 (1980 + 28 = 2008)
0111 = 7
11000 = 24

83BC is MS-DOS time for 11:36:06 PM
10111 = 23
100100 = 36
00011 = 3 (6 / 2 = 3)

----

B6E78848 is ANSI C "time_t" for 7/24/2008 10:36:06 PM
Post 25 Jul 2008, 07:03
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 25 Jul 2008, 10:24
TRUE! i already know both time/date formats. Now I'm trying to convert one to another. anyway, thanks )
Post 25 Jul 2008, 10:24
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.