News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Segment attributes cannot change

Started by kkurkiewicz, August 15, 2022, 04:41:45 AM

Previous topic - Next topic

_japheth

Quote from: kkurkiewicz on August 15, 2022, 04:41:45 AM
Could you please explain to me why ml thinks that I'm trying to reopen the segments instead of just opening them, or, if it's normal, when they were opened originally?

AFAICS, noone really answered your question - instead, you had to swallow a lot of propaganda about what's "modern".

Your segment definitions "reopened" the segments because the .model directive at the top of your program defines - under the hood - two segments: _TEXT and _DATA with certain attributes, and those atributes cannot be changed later.
What attributes are actually used depends on the .model that is defined and also to some degree on the cpu directive (.386, .486, .586,...). If you feed masm with the -Fl option, it will generate a listing, where you can see what segment attributes masm has actually used.
Dummheit, gepaart mit Dreistigkeit - eine furchtbare Macht.

hutch--

 :biggrin:

Perhaps you could have answered the question by advising that the sections,

.data?
.../.
.data
.../.
.code

Were the "modern" way to write 32 bit MASM code instead of a diatribe of ancient junk.

TimoVJL

for this masm don't have modern shortcut
.drectve SEGMENT INFO DISCARD
.drectve ENDS
but luckily very low usage, as it don't used for linkable code
May the source be with you

daydreamer

welcome kkurkiewicz  :thumbsup:
check included examples in masm32 package
ichelionz tutorials,search MS online for winapi documentation
any texteditor will do
whatever code style is welcome here,everything from "bare metal code" style to loads of macros style

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding