flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Macroinstructions > enum directive for fasmg

Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 489
Location: Belarus

enum directive for fasmg


Code:

macro ENUM? name
  local enumitems
  enumitems equ
  macro end?.enum?!
    purge ?end?.enum?
  end macro
  macro ?! line&
    match =end? =enum?line
      match itemsenumitems
        label name
        irp itemitems
          .#item := % - 1
        end irp
      end match
      line
    else
      enumitems equ enumitems line
    end match
  end macro
end macro




Usage example:


Code:

enum COLORS
  BlackBlueGreen, \
  AquaRed,
  Purple,
  Yellow,
  White
end enum

db COLORS.White


Post 17 Jan 2018, 21:19
View user's profile Send private message 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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2017, Tomasz Grysztar.