flat assembler
Message board for the users of flat assembler.

flat assembler > Projects and Ideas > File converter template [DONE]

Author
Thread Post new topic Reply to topic
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
Hi!
this is template for fast creating file conversion utilities. Contains needed set to parse commandline, open files, read symbol, write symbol, close files. You need mostly just to insert your processing code between read and write.
designed as template for WinAsm, but not depends to IDE.
package has also tab2spaces converter can be used as example
Enjoy!


Description: line-by-line converter
Download
Filename: FLINCONV.0.1.2.1.zip
Filesize: 6.34 KB
Downloaded: 423 Time(s)

Description: char-by-char converter
Download
Filename: converter.zip
Filesize: 8.32 KB
Downloaded: 390 Time(s)


_________________
UNICODE forever!


Last edited by shoorick on 02 Apr 2007, 09:27; edited 4 times in total
Post 09 Feb 2007, 11:36
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
found few problems:

parsecmdline procedure:
- tab in beginnig of command line not checked
- quoted path should be imho returned without quotes
- you should warn caller that passed command line string will get overwritten
- something like abcd"abcd" is considered as one argument abcd"abcd (without ending quote), and abcd"abcd"1234 becomes two arguments: abcd"abcd and 1234.

so... it's not THAT simple.


combined strings:
- dynamic allocated strings really should have size and buffer size stored and used. More work needed here Wink
Post 09 Feb 2007, 12:41
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
thanks!
- tabs in commandline - never met them, but possible to change
- parser returns not pathes, but parameters divided with spaces
- warning - ok
- lost of end quote: bug, will be fixed
i decided to return aaa"bbb" as separate parameter for case like
/o:"c:\my docs\out.txt"
Post 09 Feb 2007, 13:03
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
-tabs in commandline: i already forgot Smile check well, there is this code:
Code:
    cmp al,9
    jne .not_tab
    mov al,20h
.not_tab:    
    
to treat tabs as spaces - does not it help?
=======
at the beginning!! understand!! - will be fixed - it is because first time i decided do not check for tabs in commandline, but then decided to check, but forgot to do thia in all places. thanks!
=======
fixed uploaded


Last edited by shoorick on 09 Feb 2007, 13:50; edited 2 times in total
Post 09 Feb 2007, 13:19
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
vid! have you tested it at all or you just figured it all out?

you can see below how i tried your situation on non-changed template (just messagebox inserted)

what about dinamic strings - it is known to me Wink you can use printf instead, or, say, fasmlib - it is my template - anybody can change it to make own more accustomed


Description:
Filesize: 1.22 KB
Viewed: 6046 Time(s)

input.gif


Description:
Filesize: 2.89 KB
Viewed: 6047 Time(s)

result.gif



_________________
UNICODE forever!
Post 09 Feb 2007, 13:35
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
Quote:
vid! have you tested it at all or you just figured it all out?

you can see below how i tried your situation on non-changed template (just messagebox inserted)

just figured. interesting, from the sources i would swear parameter gets cut behind second doublequote in argument.

Quote:
what about dinamic strings - it is known to me you can use printf instead, or, say, fasmlib - it is my template - anybody can change it to make own more accustomed
My personal opinion just is that in dynamic string, current and max length is a MUST-HAVE.
Post 09 Feb 2007, 13:56
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
1.you possibly missguided with "search_end" lablel ^) - it is not end of search, it is search of end of the parameter Wink
2.in dynamic string, current and max length is a MUST-HAVE >
you right. but combstr macros is not universal solution. it is fast solution for cases when you do know what you do. although these macros do not check end of buffer, they can be mixed with checking code when you unsure - edi has current position in buffer, top of stack - pointer to first byte beyound end of buffer, [esp]-edi - free space left. look at cs_test example in shoolib - it is used there.
i've been thinking about checking macros - the matter is free time, possible in future Wink
Post 09 Feb 2007, 14:15
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
Updated: rebuilded stage of commandline parsing to make it more handy. If it is not clear, but you are satisfied with two parameters you do not need to touch it at all.

Enjoy!
Post 10 Feb 2007, 07:14
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
another added on first page - line-by-line converter. here is example to it: assember comments remover. usage:
Code:
decoment mysource.asm new.asm    


Description:
Download
Filename: decoment.0.0.1.1.zip
Filesize: 8.75 KB
Downloaded: 351 Time(s)


_________________
UNICODE forever!
Post 02 Apr 2007, 09:31
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-2019, Tomasz Grysztar.

Powered by rwasa.