flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Integrated BSS section macro?

Author
Thread Post new topic Reply to topic
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 26 Sep 2010, 20:07
I want to integrate data and bss sections.
Maybe one of the macro guru can help?
This is my idea...
Code:
macro dd [_n] {
  common
  if _n eq ?
    ;store in uninitialized data area
  else if _n eq 0
    ;store in uninitialized data area
  else
    ;store in initialized data area
  end if
}

section '.data' data readable writeable

;initialized data area

BSS_START:

;uninitialized data area

BSS_SIZE = $ - BSS_START
    

Is it even possible without FASM source mods?

_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 26 Sep 2010, 20:07
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 26 Sep 2010, 21:08
bitshifter,

You may find this useful. Redefine dx/rx to collect uninitialized items, then use that list in last such macro invocation to define them.
Post 26 Sep 2010, 21:08
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


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.