Someone said in a message, to make your own shared data area inside your prog, but how do you do that? The code segment could be used, except its marked as readonly. And it is not mentioned anywhere in the masm32.hlp file on how to make your own segments or modify default values using masm, i know that say; "newseg SEGMENT para public" does work, but does anyone know of the full syntax for the segment operator. Or another method to make a shared segment? Thanks
Posted on 2000-12-10 20:34:00 by ...rugby...
First, create a new segment, like this:
ShareData segment 'data'
        FirstInstance dd TRUE        ; initialize to TRUE
ShareData ends

.code
.if FirstInstance==TRUE         ; I'm the first instance
       mov FirstInstance,FALSE   ; modify the value so the next
                                             ; instance knows it's not the first
.else
      
.endif
Then, in your linker option: link ... /SECTION:ShareData,S /SECTION switch controls the attribute of the section. In our case, we set it to S meaning the section is a shared section.
Posted on 2000-12-10 23:10:00 by Iczelion