flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > concatenating some...

Author
Thread Post new topic Reply to topic
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld 27 Jun 2004, 21:54
I've modified macros from FASM docs to look like:
Code:
macro define_table name,n1,n2 {
 label name
 repeat (n2-n1+1)
  d1 = '0' + (n1+%) shr 4 and $0F
  d2 = '0' + (n1+%) and $0F
  if (d1 > '9')
   d1 = d1 + 'A'-'9'-1
  end if
  if (d2 > '9')
   d2 = d2 + 'A'-'9'-1
  end if
  dd lbl_#d1#d2
 end repeat
}    

and wanted to declare jump tables with it using:
Code:
define_table jt_name,0,255    

expecting to get table:
Code:
jt_name:
 dd lbl_00
 dd lbl_01
 ...
 dd lbl_FE
 dd lbl_FF    

tell me what i've missed 'cause it's not working
or maybe it's not possible to realize such macros?
Post 27 Jun 2004, 21:54
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 28 Jun 2004, 00:09
don't think its possible, i tried something like this already without any luck
you can use 'fix', but then you would to type out 00 to FF manually

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 28 Jun 2004, 00:09
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 29 Jun 2004, 15:27
label names are resolved at parsing stage, which is before assembly satge (when values of d1 and d2 are calculated). And "#" is handled at preprocessing stage, even before parsing so it really isn't possible.
Post 29 Jun 2004, 15:27
View user's profile Send private message Visit poster's website AIM Address MSN Messenger 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.