Question: How can I use XMS/EMS memory in QuickBasic 
Author Message
 Question: How can I use XMS/EMS memory in QuickBasic

I don't know how to use XMS/EMS memory in QuickBasic,
but I'd like to now.

Can anybody tell me, how to do it??

Thanks



Wed, 07 Jul 1999 03:00:00 GMT  
 Question: How can I use XMS/EMS memory in QuickBasic

|> I don't know how to use XMS/EMS memory in QuickBasic,
|> but I'd like to now.

To use EMS, you must use CALL INTERRUPT to access interrupt &H67.
Through this interrupt you may allocate EMS memory and move it
into and out of the EMS frame segment at D000:0000 or E000:0000.
After the EMS is mapped into the frame segment, you can copy the
data into or out of frame memory and into the data space that QB45
can recognize, below 640K.

To use XMS you need to call the multiplex interrupt to get the
address of the XMS driver. Once you have it, you must use CALL ABSOLUTE
to call the XMS driver directly, or use routines written in external
assembly language to do it, since CALL INTERRUPT won't work with XMS.

The best source of information on EMS and XMS driver interfaces
is Ralf Brown's interrupt list.

There is code already written that you can use, if you don't
want to write it yourself. The ABC packets have some EMS code,
as does WINER.ZIP. Robin Duffy wrote some XMS code, in the
QB NEWS newsletter, QBNWS301.ZIP.

--
Brian McLaughlin, Technical Writer  |"Thanks to the Internet, misinformation
Integrated Measurement Systems, Inc.| now travels faster than ever before!"
Beaverton, OR, USA                  | ---- Standard disclaimer applies ----



Fri, 09 Jul 1999 03:00:00 GMT  
 Question: How can I use XMS/EMS memory in QuickBasic

Quote:


> |> I don't know how to use XMS/EMS memory in QuickBasic,
> |> but I'd like to now.
> To use EMS, you must use CALL INTERRUPT to access interrupt &H67.
> Through this interrupt you may allocate EMS memory and move it
> into and out of the EMS frame segment at D000:0000 or E000:0000.

How do you know Brian that those are not already allocated ?
This is a big mistake.

Quote:
> After the EMS is mapped into the frame segment, you can copy the
> data into or out of frame memory and into the data space that QB45
> can recognize, below 640K.

You can do that directly by allocating lower memory....I do not have a clue
why in heavens name you are willing to swap in extended memory..

Quote:
> To use XMS you need to call the multiplex interrupt to get the
> address of the XMS driver. Once you have it, you must use CALL ABSOLUTE
> to call the XMS driver directly, or use routines written in external
> assembly language to do it, since CALL INTERRUPT won't work with XMS.
> The best source of information on EMS and XMS driver interfaces
> is Ralf Brown's interrupt list.

I am sory, but for EMS and XMS there exist far better sources. Ralph has
more to do, you know. Look for Limem specification at simtel.net for instance

Quote:
> There is code already written that you can use, if you don't
> want to write it yourself. The ABC packets have some EMS code,
> as does WINER.ZIP.

Both EMS codes are buggy and badly commented.

Robin Duffy wrote some XMS code, in the

Quote:
> QB NEWS newsletter, QBNWS301.ZIP.

The classical source for QBASIC is R. Duffy's. However it turnes out to have
some drawbacks. If you had ever looked at it, you would know.

Quote:
> --
> Brian McLaughlin, Technical Writer  |"Thanks to the Internet, misinformation
> Integrated Measurement Systems, Inc.| now travels faster than ever before!"
> Beaverton, OR, USA                  | ---- Standard disclaimer applies ----

Brian, is it delibarataly that your answers are so vague or do you really do not
know what you are talking about ? You give one bad advice( use EMS instead of
lowmem), one bad source pointer( J. Leger's EMs code) one inferior source pointer( R.
Brown), and two not very good source pointers ( R. Duffy and WIner). And all that
without mentioning anything you might know about it all.


Sat, 10 Jul 1999 03:00:00 GMT  
 Question: How can I use XMS/EMS memory in QuickBasic

|> >

|> > |> I don't know how to use XMS/EMS memory in QuickBasic,
|> > |> but I'd like to now.
|>
|> > To use EMS, you must use CALL INTERRUPT to access interrupt &H67.
|> > Through this interrupt you may allocate EMS memory and move it
|> > into and out of the EMS frame segment at D000:0000 or E000:0000.
|>
|> How do you know Brian that those are not already allocated ?
|> This is a big mistake.

The EMS frame segment is allocated at bootup, when the EMS
driver is loaded. If EMS exists on the machine at all, then the frame
segment must be located at either D000:0000 or E000:0000. You can ask
the EMS driver to tell you where the frame segment starts.

|> > After the EMS is mapped into the frame segment, you can copy the
|> > data into or out of frame memory and into the data space that QB45
|> > can recognize, below 640K.
|>
|> You can do that directly by allocating lower memory....I do not have a clue
|> why in heavens name you are willing to swap in extended memory..

The original poster asked how to use XMS/EMS memory, not
how to use lower memory. Also, I was speaking of EMS (expanded memory),
not XMS (extended memory). Next, until the data that is stored in EMS
is moved into the QB data space, by putting it into a variable,
QB cannot do anything much useful with the data.

|> > The best source of information on EMS and XMS driver interfaces
|> > is Ralf Brown's interrupt list.
|>
|> I am sory, but for EMS and XMS there exist far better sources. Ralph has
|> more to do, you know. Look for Limem specification at simtel.net for instance

I have my sources. You have your sources. The information is there.
But, of course, your source has "better" information. Hell, Rick,
the EMS spec hasn't changed for about six years, so what makes them
so much better?

|> > There is code already written that you can use, if you don't
|> > want to write it yourself. The ABC packets have some EMS code,
|> > as does WINER.ZIP.
|>
|> Both EMS codes are buggy and badly commented.

I would be interested to know what bugs you found in the WINER.ZIP
code. But even if there are bugs, how is it that you are helping
anyone or anything by just asserting they are there, and nothing
more?

|> Robin Duffy wrote some XMS code, in the
|> > QB NEWS newsletter, QBNWS301.ZIP.
|>
|> The classical source for QBASIC is R. Duffy's. However it turnes out to have
|> some drawbacks. If you had ever looked at it, you would know.

The code has drawbacks!  And you, in your godlike eminence, have
found them. I congratulate you. But, how does that help the original
poster answer his question?

Here's how I see it. Robin Duffy was generous enough to do a good piece of work,
and then donate it to the public domain. As a result, many programmers can look
at the code, use it and learn from it. So it has "drawbacks". So what?
QuickBASIC has drawbacks, too.

|> Brian, is it delibarataly that your answers are so vague or do you really do not
|> know what you are talking about?

Are these my only two choices? I hope not. <grin>

|> You give one bad advice( use EMS instead of lowmem),

How can you be so{*filter*}sure that lowmem is the correct solution,
when the original post didn't even mention a problem? The poster only
said he didn't know how to use XMS/EMS and wanted to know. Are you
suggesting he use lowmem to learn how to use EMS/XMS???

|> one bad source pointer( J. Leger's EMs code) one inferior source pointer( R.
|> Brown), and two not very good source pointers ( R. Duffy and WIner).
|> And all that without mentioning anything you might know about it all.

You accuse me of giving inferior source pointers. Of course, you aren't
providing any source pointers at all, which doesn't prevent you from
feeling pretty smug and superior, so far as I can see. What gives?

Then you accuse me of withholding what I know. If you have a specific
question you'd like me to answer, I will do my best. Which is probably
better than you deserve.

Now, what was it you were trying to accomplish by posting this?
Just to let me know your low opinion of me? You could do that by email.

--
Brian McLaughlin, Technical Writer  |"Thanks to the Internet, misinformation
Integrated Measurement Systems, Inc.| now travels faster than ever before!"
Beaverton, OR, USA                  | ---- Standard disclaimer applies ----



Mon, 12 Jul 1999 03:00:00 GMT  
 Question: How can I use XMS/EMS memory in QuickBasic

Brian,

Perhaps more then you deserve..Ahum, but I will
assume for a moment that you know what you are talking
about as far as Duffy's classical code is concerned.

Duffy's work is great, and if you see him be sure to
thank him for it. However a few things might be mentioned:

1)Array2XMS(fromseg%,fromoff%,Handle%,nrbytes&)
a) Could have been just (bas%(),handle%,nrbytes&)
b) TEST AX,1
   JZ iseven
   DEC AX
might be replaced by :
AX AND &HFFFE
(saving at least two but sometimes 4 cycles)

c)XMS1array(handle%,toseg%,tooffset%,nrbytes&)
Same as above

d)Xgetelement(handle%,variable%,elelen%,elenum%)
same as above and:
=Trouble is that when i have a string of 1 mb in XMS then
elenum% will not help me much. I have to do some
extrapolation using elelen% and trim the string afterwards
and,
=Another trouble is that this procedure does not work at all
for variable strings...

e)Same holds for setelement.

Furthermore, I have made a choice to use only one handle
for all XMS use and hardcode it into the XMS functions
after checking it. That way you minimize the functions
to use, the variables to pass and the errors that can
occur with multiple passing the handle. If you need another
swap you can just put it behind the other one into XMS space.
The errorfunctions that Duffy made I included inside
my XMS functions. At last but not least I made it possible
to swap variable length strings.

The results:
INITXMS(nrKBs%,moveB2XMS,moveB2bas,moveW2XMS$,moveW2BAS$,getelement$,setelement$,deallocate$)
moveB2XMS$ needs passing of nrbytes&,swap$,XMSoffset
moveB2BAS$ needs passing of nrbytes&,swap$,XMSoffset
moveW2XMS$ needs passing of nrbytes&,src%(),XMSoffset
moveW2BAS$ needs passing of nrbytes&,dest%(),XMSoffset
getelement$ needs passing of bas%, elementnr& <assumes int arrays>
setelement$ needs passing of bas%, elementnr& <assumes int arrays>
All of which are returning errors if appropriate.

So I reduced the functions, the variables and the codelength.
Of course it is only fair to say that so far I did not translated
the functions to be suitable for TYPES, LONGS or fixed strings,
since for one thing I do not use that much and for another they are
fairly easy adjustments from integerarray's.

And another thing: I am fairly sure that someone like Daniel H. could
do the same to this functions as I did to Duffy's making them still
better, hell maybe even you can do it......, if you are willing to
take the time to learn from it( learning<>copying!!!!!)

Rick
(Who has only 1/2 half year of programming experience: and you Brian ?)



Mon, 12 Jul 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How does one go about Using EMS, or XMS memory in QuickBASIC, of VBDOS

2. How can I access EMS or XMS memory?

3. How can I access EMS or XMS memory?

4. Memory copy to EMS/XMS

5. Cool EMS/XMS routines

6. EMS/XMS string saving problem.

7. EMS and XMS

8. EMS or XMS libraries for QB4.5

9. Please help with EMS, XMS in VBDOS

10. How can I use XMS in QuickBasic?

11. Using Extended/Expanded memory under QuickBasic

12. QuickBasic Memory Question (follow-up)

 

 
Powered by phpBB® Forum Software