flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
sinsi 22 Oct 2015, 08:35
Doesn't DOS set SS:SP to be PSP:FFFE? Then you are overwriting your stack with bufferB.
|
|||
![]() |
|
Trinitek 22 Oct 2015, 19:54
I vaguely remember reading that a long time ago, now that you mention it, but I'm having a bit of trouble finding documentation that says that.
|
|||
![]() |
|
ACP 22 Oct 2015, 22:12
SS:SP is set according to values in DOS MZ EXE header. Check out Ralf Brown Int List: http://www.ctyme.com/intr/rb-2939.htm
unless you are talking about COM files. |
|||
![]() |
|
Trinitek 22 Oct 2015, 22:17
Oh, sorry. It's a COM file. I should have clarified.
EDIT: Also, I have changed the routine to resize the program's block to a full 64k (0x1000 paragraphs) instead of endOfProgram/16. It appears to have fixed my issue, but I'd still like to see some documentation on the COM's stack location. ![]() |
|||
![]() |
|
sinsi 23 Oct 2015, 00:46
From RBIL, DOS function 4B
Quote:
|
|||
![]() |
|
Trinitek 23 Oct 2015, 00:54
Oh, I didn't even open the link. I was in a rush to get somewhere.
![]() |
|||
![]() |
|
freecrac 25 Oct 2015, 06:31
Hello.
I think one problem is to allocate two seperate memory locations and so we can not know if both buffers are seamless coherent or interrupted. Use only one (larger) allocation for both buffers example with 128 KB. Dirk |
|||
![]() |
|
Trinitek 25 Oct 2015, 08:36
The buffers don't have to be consecutive; they're independent of each other. I hope I understand you correctly.
|
|||
![]() |
|
freecrac 25 Oct 2015, 16:19
Hello
Trinitek wrote: The buffers don't have to be consecutive; they're independent of each other. Ah, ok i see it now. sinsi: Then you are overwriting your stack with bufferB My modification (not tested yet): Code: mov ah, 0x4A ; resize program's memory space to free unused memory mov bx, ds ; DOS allocates the largest block available for COM executables push es mov es, bx mov bx, sp add bx, 0Fh shr bx, 4 add bx, endOfProgram/16 ; 16 bytes per paragraph int 0x21 pop es Dirk |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.