flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
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.
|
|||
![]() |
|
baldr
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. |
|||
![]() |
|
revolution
baldr: fasm does not support extensions longer than 3 characters.
|
|||
![]() |
|
baldr
revolution,
Are you sure? Win32 command line version compile this OK (I've even checked ".flat assembler" extension). |
|||
![]() |
|
revolution
I keep getting an error when I try it. I will look into what is happening.
|
|||
![]() |
|
revolution
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? |
|||
![]() |
|
cod3b453
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
![]() |
|||
![]() |
|
baldr
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. |
|||
![]() |
|
SFeLi
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. |
|||
![]() |
|
baldr
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 ![]() |
|||
![]() |
|
cod3b453
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 |
|||
![]() |
|
zhak
whoaaa!! this is very very very great!!! thanks a lot, cod3b453 and baldr!
|
|||
![]() |
|
hopcode
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 _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
![]() |
|
zhak
hopcode, the solution discussed in topic 9458 is for PE files. I don't need PE. I build flat binaries.
|
|||
![]() |
|
adroit
Brilliant!!
|
|||
![]() |
|
baldr
hopcode,
%t is the only consistent method of versioning. __________ cod3b453, Where is the hash/bang combo? ![]() |
|||
![]() |
|
rugxulo
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. |
|||
![]() |
|
hopcode
baldr wrote: hopcode, Yes, ![]() ![]() ![]() ...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 ![]() ![]() ![]() ![]() hopcode _________________ ⠓⠕⠏⠉⠕⠙⠑ |
|||
![]() |
|
cod3b453
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. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.