flat assembler
Message board for the users of flat assembler.

Index > Main > display of numbers, filenames and line numbers

Author
Thread Post new topic Reply to topic
lazer1



Joined: 24 Jan 2006
Posts: 185
lazer1 03 Apr 2011, 16:24
with fasm's display directive everything is regarded as a string and its tricky to echo numbers.

I think there needs to be a directive to echo numbers, its a bit severe for users to have to hack the echo of numbers

also there needs to be a way to echo filename and line_number of the display command, eg with C there are 2 inbuilt symbols __FILE__ and __LINE__

perhaps if these could be implemented for fasm,

envisioned usage example is:

Code:

macro int xyz*
  {
  display 'int used with argument '
  display_hexadecimal xyz
  display 'in file ', __FILE__, 'line number ', __LINE__, 0ah
  int xyz
  }

    


this macro will intercept any uses of the int asm instruction and
will echo which file, line number and the argument of int Razz
Post 03 Apr 2011, 16:24
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 03 Apr 2011, 16:26
what's the need for this?
Post 03 Apr 2011, 16:26
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 03 Apr 2011, 16:33
There are already some threads around here that have patches to use %L to give the current line number (as a number, not a string). The filename would be a little bit trickier (it is a string) but is probably also doable.
Post 03 Apr 2011, 16:33
View user's profile Send private message Visit poster's website Reply with quote
lazer1



Joined: 24 Jan 2006
Posts: 185
lazer1 05 Apr 2011, 11:15
edfed wrote:
what's the need for this?


the need is to catch risky constructs,

eg I wanted to use single stepping, but int switches off

single stepping,

thus I needed to locate where int was used,

I need fasm to display the file and line number and the

interrupt vector.

but I dont want to know about usages which arent referenced,

eg commented out etc which word search would locate.






its quite basic functionality, and should be built in,

furthermore it should be quite straightforward to implement

within fasm. implementing it in macros is highly inefficient


look at C's printf, that has strings, characters, ints, hexadecimal etc

YOU tell me whats the need for all that in C Laughing


printf( "arguments %s, %x used in file %s line %d\n",
string_variable, number_variable, __FILE__, __LINE__ ) ;

where C is a bit limited is echoing things at compile time

the way fasm display is used.

when I use this stuff with C I have to catch the problems at run time,

with fasm I can catch such things at compile time which is more useful.
Post 05 Apr 2011, 11:15
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 05 Apr 2011, 12:58
FreshLib have advanced "disp" macro that displays numbers as well as strings.
You can find the source and documentation here.
Check the reference.
Post 05 Apr 2011, 12:58
View user's profile Send private message Visit poster's website ICQ Number 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.