flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Compile time, included file's information? |
Author |
|
cod3b453 19 Mar 2012, 19:48
The %t parameter can be deconstructed into it's time and date components from its seconds value.
EDIT: This is the time but I don't don't know how to get date Code: x = %t time_s = x mod 60 time_m = (x / 60) mod 60 time_h = (x / 3600) mod 24 |
|||
19 Mar 2012, 19:48 |
|
Mike Gonta 19 Mar 2012, 21:42
cod3b453 wrote: The %t parameter can be deconstructed into it's time and date components from its seconds value. http://board.flatassembler.net/topic.php?t=1139 |
|||
19 Mar 2012, 21:42 |
|
cod3b453 19 Mar 2012, 22:31
Thanks for that info Mike Gonta
In particular, this post http://board.flatassembler.net/topic.php?p=8586#8586 shows how to extract the date information correctly. |
|||
19 Mar 2012, 22:31 |
|
smiddy 19 Mar 2012, 23:59
Isn't that just the current time/date?
For instance if I do: Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SmiddyOS File Inclussion ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SmiddyOS: file 'SMIDDYOS.EXE' .End: times 2047 - ($+2047) mod 2048 db 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; VENDOR.TXT File Inclussion ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; VendorTextFile: file 'VENDORS.TXT' .End: ; TIMES 2048-($-VendorTextFile) ; Aligns VENDORS.TXT (a file is aligned after its actual size) times 2047 - ($+2047) mod 2048 db 0 I'd like to include the files information in here: Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Root Directory ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RootDirectory: db .RootDirectoryEnd - RootDirectory ; (0) Length of this directory entry db 0 ; (1) Extended Attribute Record Length (0 ?) dd (RootDirectory - CDROMImageStart) / 2048 ; (2) Location of root directory in Little Endian BED (RootDirectory - CDROMImageStart) / 2048 ; (6) Location of root directory in Big Endian dd .RootDirectoryEnd - RootDirectory ; (10) The size in sectors (Big or Little Endian) BED .RootDirectoryEnd - RootDirectory ; (14) The size in sectors (Big or Little Endian) db 111 ;;; (1 Number of years since 1900 db 12 ;;; (19) Month of the year 1 to 12 db 4 ;;; (20) Day of the month 1 to 31 db 8 ;;; (21) Hour of the day 0 to 23 db 53 ;;; (22) Minute of the hour 0 to 59 db 0 ;;; (23) Second of the minute 0 to 59 db -20 ;;; (24) Offset from GMT in number of 15 minute intervals (CST = -20) db 00000010b ; (25) File Attributes 0b = Existence; 1b = Directory; 2b = Associated File; 3b = Record?; 4b = Protection; 5b - 6b = Reserved; 7b = Multi-Extent db 0 ; (26) File unit size, 0 = not used db 0 ; (27) Interleave Gap 0 = not used dw 1 ; (2 Volume Sequence Number (Big or Little Endian) not used for us so 0 = not used BEW 1 ; (30) Volume Sequence Number (Big or Little Endian) not used for us so 0 = not used db 1 ; (32) Length of file name (next field) db 0 ; (33) file name (next field) .RootDirectoryEnd: RootDirectory2: db .RootDirectoryEnd2 - RootDirectory2 ; Length of this directory entry db 0 ; Extended Attribute Record Length (0 ?) dd (RootDirectory - CDROMImageStart) / 2048 ; Location of root directory in Big or Little Endian BED (RootDirectory - CDROMImageStart) / 2048 dd RootDirectory.RootDirectoryEnd - RootDirectory ; The size in sectors (Big or Little Endian) BED RootDirectory.RootDirectoryEnd - RootDirectory ; The size in sectors (Big or Little Endian) db 111 ;;; Number of years since 1900 db 12 ;;; Month of the year 1 to 12 db 4 ;;; Day of the month 1 to 31 db 8 ;;; Hour of the day 0 to 23 db 53 ;;; Minute of the hour 0 to 59 db 0 ;;; Second of the minute 0 to 59 db -20 ;;; Offset from GMT in number of 15 minute intervals (CST = -20) db 00000010b ; File Attributes 0b = Existence; 1b = Directory; 2b = Associated File; 3b = Record?; 4b = Protection; 5b - 6b = Reserved; 7b = Multi-Extent db 0 ; File unit size, 0 = not used db 0 ; Interleave Gap 0 = not used dw 1 ; Volume Sequence Number (Big or Little Endian) not used for us so 0 = not used BEW 1 ; Volume Sequence Number (Big or Little Endian) not used for us so 0 = not used db 1 ; Length of file name (next field) db 1 ; file name (next field) Identifies Parent Directory .RootDirectoryEnd2: SmiddyOSFile: db .SmiddyOSFileEnd - SmiddyOSFile ; Length of this directory entry db 0 ; Extended Attribute Record Length (0 ?) dd (SmiddyOS - CDROMImageStart) / 2048 ; Location of SmiddyOS in Big or Little Endian BED (SmiddyOS - CDROMImageStart) / 2048 dd SmiddyOS.End - SmiddyOS ; The size in bytes (Big or Little Endian) BED SmiddyOS.End - SmiddyOS ; The size in bytes (Big or Little Endian) db 111 ;;; Number of years since 1900 \ db 10 ;;; Month of the year 1 to 12 \ db 28 ;;; Day of the month 1 to 31 \_ I will need to setup a way to extract the time from the files on the fly db 14 ;;; Hour of the day 0 to 23 / db 54 ;;; Minute of the hour 0 to 59 / db 59 ;;; Second of the minute 0 to 59 db -20 ;;; Offset from GMT in number of 15 minute intervals (CST = -20) db 00000000b ; File Attributes 0b = Existence; 1b = Directory; 2b = Associated File; 3b = Record?; 4b = Protection; 5b - 6b = Reserved; 7b = Multi-Extent db 0 ; File unit size, 0 = not used db 0 ; Interleave Gap 0 = not used dw 1 ; Volume Sequence Number (Big or Little Endian) not used for us so 0 = not used BEW 1 ; Volume Sequence Number (Big or Little Endian) not used for us so 0 = not used db (.NameEnd - .NameStart) ; Length of file name (next field) .NameStart: db "SMIDDYOS.EXE" ; file name (next field) .NameEnd: times ((.NameEnd - .NameStart) and 0) db 0 ; A Zero pads teh end of the entry it seems .SmiddyOSFileEnd: VendorText: db .VendorTextEnd - VendorText ; Length of this directory entry db 0 ; Extended Attribute Record Length (0 ?) dd (VendorTextFile - CDROMImageStart) / 2048 ; Location of VENDOR.TXT in Big or Little Endian BED (VendorTextFile - CDROMImageStart) / 2048 dd VendorTextFile.End - VendorTextFile ; The size in bytes (Big or Little Endian) BED VendorTextFile.End - VendorTextFile ; The size in bytes (Big or Little Endian) db 111 ;;; Number of years since 1900 \ db 10 ;;; Month of the year 1 to 12 \ db 29 ;;; Day of the month 1 to 31 \_ I will need to setup a way to extract the time from the files on the fly db 14 ;;; Hour of the day 0 to 23 / db 55 ;;; Minute of the hour 0 to 59 / db 59 ;;; Second of the minute 0 to 59 db -20 ;;; Offset from GMT in number of 15 minute intervals (CST = -20) db 00000000b ; File Attributes 0b = Existence; 1b = Directory; 2b = Associated File; 3b = Record?; 4b = Protection; 5b - 6b = Reserved; 7b = Multi-Extent db 0 ; File unit size, 0 = not used db 0 ; Interleave Gap 0 = not used dw 1 ; Volume Sequence Number (Big or Little Endian) not used for us so 0 = not used BEW 1 ; Volume Sequence Number (Big or Little Endian) not used for us so 0 = not used db (.NameEnd - .NameStart) ; Length of file name (next field) .NameStart: db "VENDORS.TXT" ; file name (next field) .NameEnd: times ((.NameEnd - .NameStart) and 0) db 0 ; A Zero pads teh end of the entry it seems .VendorTextEnd: ;ZenithDirectory: ; ; db .ZenithDirectoryEnd - ZenithDirectory ; (0) Length of this directory entry ; db 0 ; (1) Extended Attribute Record Length (0 ?) ; dd (ZenithDirectory1 - CDROMImageStart) / 2048 ; (2) Location of Zenith directory in Little Endian ; BED (ZenithDirectory1 - CDROMImageStart) / 2048 ; (6) Location of Zenith directory in Big Endian ; dd .ZenithDirectoryEnd - ZenithDirectory ; (10) The size in sectors (Big or Little Endian) ; BED .ZenithDirectoryEnd - ZenithDirectory ; (14) The size in sectors (Big or Little Endian) ; db 111 ;;; (1 Number of years since 1900 ; db 10 ;;; (19) Month of the year 1 to 12 ; db 26 ;;; (20) Day of the month 1 to 31 ; db 14 ;;; (21) Hour of the day 0 to 23 ; db 53 ;;; (22) Minute of the hour 0 to 59 ; db 59 ;;; (23) Second of the minute 0 to 59 ; db -20 ;;; (24) Offset from GMT in number of 15 minute intervals (CST = -20) ; db 00000010b ; (25) File Attributes 0b = Existence; 1b = Directory; 2b = Associated File; 3b = Record?; 4b = Protection; 5b - 6b = Reserved; 7b = Multi-Extent ; db 0 ; (26) File unit size, 0 = not used ; db 0 ; (27) Interleave Gap 0 = not used ; dw 1 ; (2 Volume Sequence Number (Big or Little Endian) not used for us so 0 = not used ; BEW 1 ; (30) Volume Sequence Number (Big or Little Endian) not used for us so 0 = not used ; db (.NameEnd - .NameStart) ; Length of file name (next field) ;.NameStart: ; db 'ZENITH' ; (33) file name (next field) ;.NameEnd: ; times ((.NameEnd - .NameStart) and 0) db 0 ; A Zero pads teh end of the entry it seems ; ;.ZenithDirectoryEnd: TIMES 2048-($-RootDirectory) DB 0 ; Aligns RootDirectory .End: ...where all the file information is, instead of hard coding it. Does this make sense? Does the %t pull the information on the included files? How specifically do I get it? ie. SMIDDYOSEXEDate = %T.SMIDDYOS.EXE or something? |
|||
19 Mar 2012, 23:59 |
|
cod3b453 20 Mar 2012, 18:00
Apologies I total misunderstood
External file time stamp information is OS specific, so I don't think there is a direct way to do this. [This might be a possible addition to FASM, as it has OS wrapper code for files anyway] However, this kind of task cna be handled by an external script. Sorry I can't be of more help. |
|||
20 Mar 2012, 18:00 |
|
smiddy 20 Mar 2012, 18:18
Nope, that's kewl! The way I've done it in the past was write a C program to get the information fo packaging up a "build" so I may do that very same thing but instead write the CDROM.ASM file out, that creates the *.ISO, which will have that information within it. I was hoping there was a direct what at compile to to gather that information.
|
|||
20 Mar 2012, 18:18 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.