flat assembler
Message board for the users of flat assembler.
Index
> Main > How to generate incremented build version |
Author |
|
revolution 27 Mar 2010, 01:14
You can use the %t variable to get a unique value at compile time. That way you can distinguish between builds and you can even know the time that it was built.
|
|||
27 Mar 2010, 01:14 |
|
baldr 27 Mar 2010, 01:19
zhak,
Code: BUILD equ 1 format binary as "fasm" file "self_inc.fasm" load build byte from 10 store byte build+1 at 10 find "BUILD equ" <self_inc.fasm >build.finc (or grep) command can be used to extract equ directive (to be included in your source). Alternatively, you can use awk to modify your source before compilation (and commit changes if it was successful). You can parse previously compiled PE and use its build+1 (from VERSIONINFO resource, for example) too. |
|||
27 Mar 2010, 01:19 |
|
revolution 27 Mar 2010, 01:24
baldr: fasm does not support extensions longer than 3 characters.
|
|||
27 Mar 2010, 01:24 |
|
baldr 27 Mar 2010, 01:42
revolution,
Are you sure? Win32 command line version compile this OK (I've even checked ".flat assembler" extension). |
|||
27 Mar 2010, 01:42 |
|
revolution 27 Mar 2010, 01:49
I keep getting an error when I try it. I will look into what is happening.
|
|||
27 Mar 2010, 01:49 |
|
revolution 27 Mar 2010, 01:58
Oh, I had a read only file with the same name. Yeah you are right, it works fine as long as the file can be written.
BTW: I wonder what happens on a DOS system? Does the OS truncate everything to 3 character extensions? |
|||
27 Mar 2010, 01:58 |
|
cod3b453 27 Mar 2010, 10:04
Although it compiles, BUILD won't increment when it reaches "\", I'm also not sure what values after 9 will be - I still like the idea, might have a go later
|
|||
27 Mar 2010, 10:04 |
|
baldr 27 Mar 2010, 13:38
cod3b453,
I didn't say that it is reliable/complete solution (insert empty line after equ and it will compile fine until \xFF). It is just a quick'n'dirty implementation of an idea. |
|||
27 Mar 2010, 13:38 |
|
SFeLi 27 Mar 2010, 20:22
There was something strange at http://board.flatassembler.net/topic.php?t=5204
Add a little PE parsing to it and it would work. Maybe. |
|||
27 Mar 2010, 20:22 |
|
baldr 27 Mar 2010, 21:18
SFeLi,
Unfortunately, that approach will work only if ver macro is invoked at fixed RVA (thus you can't move the invocation around the source after first build is built ). PE parsing and VERSIONINFO resource seems more reliable. |
|||
27 Mar 2010, 21:18 |
|
cod3b453 28 Mar 2010, 15:55
OK, taking baldr's idea I got this:
build.ash Code: BUILD equ 00000000000000000000000000000001b build.asm Code: format binary as "ash" file "build.ash" b = 0 rept 32 i:0 { load bb byte from (10+i) b = (b shl 1) or ((bb - '0') and 0x00000001) } b = b + 1 rept 32 i:0 { if b and (1 shl (31 - i)) store byte '1' at (10+i) else store byte '0' at (10+i) end if } test.asm Code:
include 'build.ash'
dd BUILD To increment BUILD you compile build.asm which overwrites build.ash and then include build.ash into the files where you want BUILD and compile them. This allows you to have a multi-platform build file too e.g. Code: ; build.bat (chmod 07xx for UNIX) with fasm(.exe) in PATH fasm build.asm fasm test.asm |
|||
28 Mar 2010, 15:55 |
|
zhak 28 Mar 2010, 16:34
whoaaa!! this is very very very great!!! thanks a lot, cod3b453 and baldr!
|
|||
28 Mar 2010, 16:34 |
|
hopcode 28 Mar 2010, 16:45
revolution wrote: You can use the %t variable to get a unique value at compile time... Other macro-toy-methods should not be trusted. for the sake of completeness, http://board.flatassembler.net/topic.php?t=9458 (it improves cability to "commend" this phpBB board search button) Cheers, hopcode _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
28 Mar 2010, 16:45 |
|
zhak 28 Mar 2010, 17:33
hopcode, the solution discussed in topic 9458 is for PE files. I don't need PE. I build flat binaries.
|
|||
28 Mar 2010, 17:33 |
|
adroit 28 Mar 2010, 17:51
Brilliant!!
|
|||
28 Mar 2010, 17:51 |
|
baldr 28 Mar 2010, 17:54
hopcode,
%t is the only consistent method of versioning. __________ cod3b453, Where is the hash/bang combo? |
|||
28 Mar 2010, 17:54 |
|
rugxulo 28 Mar 2010, 18:09
revolution wrote: Oh, I had a read only file with the same name. Yeah you are right, it works fine as long as the file can be written. FASM for DOS supports LFNs if available. Otherwise it should truncate to 8.3. |
|||
28 Mar 2010, 18:09 |
|
hopcode 28 Mar 2010, 22:10
baldr wrote: hopcode, Yes, i said it because the too much verbal and too much brief 2nd post was perhaps marked as unbelievable and consequently skipped ...but the blog doesnt evaluates to ETERNAL_CONST if i miss to quote the source: zhak wrote: I don't need PE.I build flat binaries. Code:
Ohh mein Gott, you need a flattery bin !!!! How would you do that !?!
Good that you asked about it! zhak again wrote: Hi guys If you hadnt asked about it, how would have been the mortal being and the black fly aware of the flat apartment you asked? Also, confirmed: under a general written english improvements, and the board will remain over centuries the same version, lack of commuication follows...in blocks...blog..bl..a,bl..a VVV peace, unity,love and having fun VVV hopcode _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
28 Mar 2010, 22:10 |
|
cod3b453 29 Mar 2010, 13:05
zhak wrote: whoaaa!! this is very very very great!!! thanks a lot, cod3b453 and baldr! baldr wrote: Where is the hash/bang combo? It breaks Windows compatibility, was just to show that you could use the same build and source files on both platforms - which for me is very useful because I develop on both. |
|||
29 Mar 2010, 13:05 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.