flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
sinsi
Doesn't DOS set SS:SP to be PSP:FFFE? Then you are overwriting your stack with bufferB.
|
|||
![]() |
|
Trinitek
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
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
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
From RBIL, DOS function 4B
Quote:
|
|||
![]() |
|
Trinitek
Oh, I didn't even open the link. I was in a rush to get somewhere.
![]() |
|||
![]() |
|
freecrac
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
The buffers don't have to be consecutive; they're independent of each other. I hope I understand you correctly.
|
|||
![]() |
|
freecrac
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.