Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to index page
Thread view  Board view
ecm

Homepage E-mail

Düsseldorf, Germany,
09.03.2018, 13:11
 

How to set an .EXE stack segment same as the code segment? (Developers)

During some work on RxCMD, I noticed that the original reference file has exeInitSS = 0 and exeInitSP = 0 too. That means the stack lives at the end of the (64 KiB) first segment of the file. exeMinAlloc doesn't cover this usage, even though it should.

It appears that these settings are the defaults when no stack segment is specified. Using WarpLink, it is the case that both fields as 0 are the default (which also displays a warning).

Now, I wanted to explicitly set the stack as a segment, but I can't seem to get WarpLink to put the stack into the same segment as the code segment. I tried naming a group (as "dgroup") and including both the RXCMD segment and the STACK$$ segment into that, and also tried setting the "class=" of the stack segment to RXCMD (same as the code segments), but alas. In the NASM source text, I need to specify the "stack" attribute to the "segment" instruction, which tells the linker that this is the stack segment.

Anyone got any ideas?

---
l

ecm

Homepage E-mail

Düsseldorf, Germany,
09.03.2018, 14:13

@ ecm
 

How to set an .EXE stack segment same as the code segment?

As a side-effect of making RxDOS 7.22's RxCMD build with NASM's internal (bin) linker, I was able to manually set the exeMinAlloc as required, and I left both exeInitSS and exeInitSP as zero.

---
l

alexfru

USA,
10.03.2018, 06:35

@ ecm
 

How to set an .EXE stack segment same as the code segment?

> Now, I wanted to explicitly set the stack as a segment, but I can't seem to
> get WarpLink to put the stack into the same segment as the code segment. I
> tried naming a group (as "dgroup") and including both the RXCMD segment and
> the STACK$$ segment into that, and also tried setting the "class=" of the
> stack segment to RXCMD (same as the code segments), but alas. In the NASM
> source text, I need to specify the "stack" attribute to the "segment"
> instruction, which tells the linker that this is the stack segment.
>
> Anyone got any ideas?

My compiler's linker supports small-memory .EXEs with up to 64KB code segment and fixed-size 64KB data/stack segment (DS=SS, CS!=SS). The stack size option controls the location of the __start_stack__ symbol giving the heap the remainder of the segment: __start_stack__ - __stop_alldata__.

But if you're comfortable with your NASM-only solution, you probably don't need this.

Back to index page
Thread view  Board view
22049 Postings in 2034 Threads, 396 registered users, 70 users online (0 registered, 70 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum