flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > How to get the corresponding offset of a line?

Author
Thread Post new topic Reply to topic
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 24 Aug 2003, 18:19
Hi Privalov!

I know this have been discussed before, but I just wonder whether you have come up with any solutions or not?? I really look forward to get this feature implemented... Maybe as a part of the command-line? Something like typing "fasm dosdemo.asm dosdemo.com -m" which will for instance make a .map-file with information listed something like this:
line: 00000001 offset: 00000000 size: 2
line: 00000002 offset: 00000002 size: 2
line: 00000003 offset: 00000004 size: 2
line: 00000004 offset: 00000006 size: 3
line: 00000005 offset: 00000009 size: 6
line: 00000006 offset: 0000000F size: 0
line: 00000007 offset: 00000010 size: 1
etc.

What do you think?

So long! Take care!!

Tommy
Post 24 Aug 2003, 18:19
View user's profile Send private message Visit poster's website Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 24 Aug 2003, 18:26
I mean something like this (implemented with macros and NOT very practical/handy to use Crying or Very sad)...

Well, so long! Cool

Tommy


Description: Demonstration
Download
Filename: offsets.asm
Filesize: 762 Bytes
Downloaded: 950 Time(s)

Post 24 Aug 2003, 18:26
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 24 Aug 2003, 20:29
As I have written somewhere else, the changes I've made to the fasm's core in the 1.48 release now allow this. My intention was to make it for the source-level debugger that was planned to be included in the FASMW interface since its first release (that's why it's still not even 1.0). But it can also be used for the purpose you're talking about, I was thinking even about the listing feature (third - optional - file name in the command line). I'll try to make soon some demonstration how to modify interface to make use of that new core's feature (but if I implement the listing, I'll probably make it the part of formatter module).
Post 24 Aug 2003, 20:29
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 25 Aug 2003, 06:41
What a good news: the source level debugger !!
Post 25 Aug 2003, 06:41
View user's profile Send private message Yahoo Messenger Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 25 Aug 2003, 07:44
Good news Privalov! Wink I look forward to your demonstration!
Source-level debugger would be like a dream came true Wink

Tommy
Post 25 Aug 2003, 07:44
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 27 Aug 2003, 19:31
Here's the first experimental version of fasm with the new listing engine. There is a new include file in the source directory - listing.inc, and it contains procedures that should create listing from the given line numbers and file offsets (you can specify the file name for the listing file as a third parameter in the command line), but with FASMW interface version these routines will be replaced with ones that will generate the appriopriate data structure for the source-level debugger.

Attachment is now obsolete, so has been removed.


Last edited by Tomasz Grysztar on 30 Aug 2003, 14:32; edited 1 time in total
Post 27 Aug 2003, 19:31
View user's profile Send private message Visit poster's website Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 28 Aug 2003, 05:33
Good start! Smile I'm gone for some days now, but I'll check it out closer when I return! Wink

So long! Take care!
Keep up the good work! Cool

Regards,
Tommy
Post 28 Aug 2003, 05:33
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 30 Aug 2003, 14:42
I have posted version with finished listing feature in the Main forum, and I've also noticed that it won't be really useful for source-level debugger project, as this listing bases on file offsets, and some data structures (like uninitialized data, or anything defined inside the virtual blocks) have no corresponding data in the output file. For the debugger we will need to have addresses in memory, not in file, and as it's hard to make in general case, we will have to make it for PE formatter only.
Post 30 Aug 2003, 14:42
View user's profile Send private message Visit poster's website Reply with quote
Tommy



Joined: 17 Jun 2003
Posts: 489
Location: Norway
Tommy 01 Sep 2003, 09:45
Both oportunities should be available... Wink (as it is right now, and built-in in the PE formatter)
Post 01 Sep 2003, 09:45
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.