TIP: Click on subject to list as thread! ANSI
echo: public_domain
to: Paul Edwards
from: rowan crowe
date: 1995-06-04 23:47:08
subject: MSQ bug.

Answering msg from Paul Edwards to rowan crowe,
on Thursday June 01 1995 at 19:08

 rc>> I thought you didn't know shit about ASM, Paul? ;-)

 PE> I know enough to be able to call DOS interrupts.  I don't know
 PE> very much about the segments though.

    Okay. ;-)

 rc>> Depending on how Watcom allocates memory, it could be as
 rc>> simple as asking DOS to allocate 1Mb, and noting the amount of
 rc>> free memory it returns when the call fails, or it could require
 rc>> intimate knowledge of how Watcom's memory manager handles memory
 rc>> under the Large model.

 rc>> This assumes you're talking about the DOS version, of
 rc>> course.....

 PE> Yes I am.  Is that what you would suggest, allocate 1MB?  What is
 PE> the DOS interrupt you are referring to?  BFN.  Paul.

    Don't hold much hope for this, but try it anyway:

mov  ah, 48h         ; DOS allocate memory subfunction
mov  bx, 0ffffh      ; Allocate 65535 paragraphs (1Mb)
int  21h             ; Do it

    Since it's impossible to allocate 1Mb of memory, the call will fail. BX
now contains the *actual* number of free paragraphs, so multiply this by 16
and you've got bytes free.

    If Watcom uses its own far memory manager, then it will probably have
grabbed all free DOS memory; the above will therefore return 0.

---
* Origin: Jelly-Bean software development. (3:635/727.1)
SEEN-BY: 50/99 632/348 998 633/371 634/384 635/502 503 513 544 727 638/100
SEEN-BY: 640/230 690/718 711/401 410 430 807 808 809 933 934 713/888 800/1
SEEN-BY: 7877/2809
@PATH: 635/727 632/348 635/503 50/99 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.