Author Topic: Segment attributes cannot change  (Read 746 times)

_japheth

  • Member
  • **
  • Posts: 89
Re: Segment attributes cannot change
« Reply #15 on: August 15, 2022, 02:35:49 PM »
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.
The road to hell is paved with good intentions.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 9816
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Segment attributes cannot change
« Reply #16 on: August 15, 2022, 03:00:21 PM »
 :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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

TimoVJL

  • Member
  • *****
  • Posts: 1141
Re: Segment attributes cannot change
« Reply #17 on: August 15, 2022, 03:26:53 PM »
for this masm don't have modern shortcut
Code: [Select]
.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

  • Member
  • *****
  • Posts: 2102
  • my kind of REAL10 Blonde
Re: Segment attributes cannot change
« Reply #18 on: August 15, 2022, 05:57:00 PM »
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
 
assembly is for everyone thanks to IKEA(hex tool)
everyone can make Java at home
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."

jj2007

  • Member
  • *****
  • Posts: 13029
  • Assembler is fun ;-)
    • MasmBasic
Re: Segment attributes cannot change
« Reply #19 on: August 15, 2022, 07:26:59 PM »