flat assembler
Message board for the users of flat assembler.

Index > Main > Writing a log file while compiling

Author
Thread Post new topic Reply to topic
SPTH



Joined: 24 Jul 2004
Posts: 91
SPTH 28 Dec 2010, 14:58
Hello,
I would like to write a log-file while compiling, in an non-overwriting way.

Is there a possibility to append some lines to a file (or write it before the actually file?)?
I would prefere to write it before the actually file, like:

log.txt:
Code:
20.12.2010, 18.11:
Parameter 17
Function 2, number 12
    


becomes:
Code:
20.12.2010, 18.31:
Parameter 11
Function 2, number 11
20.12.2010, 18.11:
Parameter 17
Function 2, number 12
    


I have searched for that in the manual, no success.

Is there also a possibility to check whether the file already exists? Because the "file" command fails if the file does not exist (if i want to display the old log.txt content).


Thanks for help!
Andreas
Post 28 Dec 2010, 14:58
View user's profile Send private message Reply with quote
SFeLi



Joined: 03 Nov 2004
Posts: 138
SFeLi 28 Dec 2010, 15:03
Code:
display 'Whatever you want',0x0a    


fasm something.asm >> log.txt
Post 28 Dec 2010, 15:03
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20343
Location: In your JS exploiting you and your system
revolution 28 Dec 2010, 15:05
In the command line version (fasm.exe) you can use the display directive to output code to the terminal. Then just redirect the output to append to a file.
Code:
c:\fasm> fasm MyUberProggy.asm MyUberProggy.exe >>log.txt    
Post 28 Dec 2010, 15:05
View user's profile Send private message Visit poster's website Reply with quote
SPTH



Joined: 24 Jul 2004
Posts: 91
SPTH 29 Dec 2010, 13:31
Thank you!

I always use the FASM GUI (ctrl+f9), so is that possible with the GUI too?
Post 29 Dec 2010, 13:31
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20343
Location: In your JS exploiting you and your system
revolution 29 Dec 2010, 14:22
SPTH wrote:
I always use the FASM GUI (ctrl+f9), so is that possible with the GUI too?
Not that I am aware of. The GUI will print displayed stuff to a dialog window. Use the command line version, it is also in the Win32 download with fasmw.
Post 29 Dec 2010, 14:22
View user's profile Send private message Visit poster's website Reply with quote
SPTH



Joined: 24 Jul 2004
Posts: 91
SPTH 29 Dec 2010, 16:39
Thx revolution for the fast answere.

I finally thought I had a solution:

Code:
format binary as 'log'
db "Function 1"

format binary as 'exe'
code


format binary as 'log'
db "Parameter 2"

format binary as 'exe'
more code    


But that does not work, too - "unexpected instruction"

Do you know any way to make that working? To write to a log file?
Post 29 Dec 2010, 16:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20343
Location: In your JS exploiting you and your system
revolution 29 Dec 2010, 17:36
You can only have one format statement per assembly invocation. You would need to make four separate .asm files and assemble each file individually.
Post 29 Dec 2010, 17:36
View user's profile Send private message Visit poster's website 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.