Turbo Pascal space for data structure 
Author Message
 Turbo Pascal space for data structure

Hello!

How is it possible to use extended memory, for your data structure?

I have a big data structure realised with pointers that
need more than 600k of space.

Is it possible to use extended memory (up to 8, 16 M RAM)?

Thanks
------------------------------------------------------------------
Andrej Mrvar,    Assistant, Faculty of Social Sciences, Ljubljana
==================================================================


http://www.*-*-*.com/ ~fdmrvar/andrej.html
------------------------------------------------------------------



Wed, 18 Jun 1902 08:00:00 GMT  
 Turbo Pascal space for data structure

Quote:

>How is it possible to use extended memory, for your data structure?
>I have a big data structure realised with pointers that
>need more than 600k of space.
>Is it possible to use extended memory (up to 8, 16 M RAM)?

Yes, you can.  In fact, depending on exactly what version/language you are
running, dynamic memory allocation generally uses this space.  What you cannot
do is to get 600K (easily) in one chunk at one time.

Yes, you can use Huge and hope... but if you can possibly wing it, set up some
kind of a data-structure, e.g. a tree, and esp. in delphi where you can set it
up as a class with an array-type "read" and "write" method so it *looks* like
an array.  Otherwise set up a simple function to locate and a procedure to
store the desired value.

Basically, even though it looks funny and feels odd to write this way, you're
going to get much better performance because Windows is *not* terribly
friendly toward huge-memory uses, and the x86 in 16-bit mode is generally
unfriendly toward large things.  You're putting the puppy through a lot more
hoops than you would if the memory did not have to be contiguous.



Wed, 18 Jun 1902 08:00:00 GMT  
 Turbo Pascal space for data structure

Quote:

>Hello!
>How is it possible to use extended memory, for your data structure?
>I have a big data structure realised with pointers that
>need more than 600k of space.
>Is it possible to use extended memory (up to 8, 16 M RAM)?

  Yes, you can.
  I am tried to write a XMS TPU for turbo Pascal 7.0(5.5).
  All program can use xms when you insert "use xmstpu" in your rogram.

  Anyone can mail to me to get the source and example.  


 The function is :

  {   FUNCTION    PARAM   RETURN      TEXT

    INITXMS      -      BOOLEAN    TRUE : INIT OK!   |w??/??|\
    XMSFREE      -      WORD       TOTAL XMS K Bytes ??|^ XMS ` K ??
    XMSFREECONT  -      WORD       MAX CONT. K Bytes ??|^3j3s? K ??

    ALOCXMS             WORD       HANDLE NO FFFF=ERR
??|^HANDLE?1?X,FFFF???~
                WORD               NEED K Bytes       ?YDK ??

    RETURNXMS           BOOLEAN    TURE=RETURN OK!   |^O?D?a???
                WORD               HANDLE NO.        ?-naoHANDLE
?1?X

    MOVETOXMS           BOOLEAN    MOVE TO XMS TRUE=MOVE OK!
hXMS|\_
                WORD               FROM SEGMENT
                WORD               FROM OFFSET
                WORD               TO HANDLE NO
                LONGINT            MOVE LENGTH  (Bytes)     h2?aoa??
Bytes
                LONGINT            MOVE TO HANDLE OFFSET
hHANDLEao_?l|?m
    MOVEFROMXMS         BOOLEAN    MOVE FROM XMS TRUE=MOVE OK!
h?XMS|\
_
                WORD               TO SEGMENT
                WORD               TO OFFSET
                WORD               FROM HANDLE NO
                LONGINT            MOVE LENGTH  (Bytes)    h2?aoa??
Bytes
                LONGINT            MOVE FROM HANDLE OFFSET
qHANDLEao_?l|?mh

Quote:
}

INTERFACE
FUNCTION INITXMS:BOOLEAN;         { TRUE: INSTALL OK! }
FUNCTION XMSFREE:WORD;            { RETURN xxxxK Byte
??|^XMS K??   }
FUNCTION XMSFREECONT:WORD;        { RETURN xxxxK CONTINUED
??|^3s? K??  }
FUNCTION ALOCXMS(SIZE:WORD):WORD;  { RETURN =HANDLE NO=$FFFF==> ERROR
Quote:
}

FUNCTION RETURNXMS(HANDLE:WORD):BOOLEAN;  { RETURN OK OR NOT }
FUNCTION MOVETOXMS(PS,PO,PH:WORD;PL,POFS:LONGINT):BOOLEAN;
             { SEGMENT,OFFSET,HANDLE,LENGTH, TO OFFSET }




Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Define data structure for graph (abstract data structures)

2. TASM data structures to Pascal data types

3. NEED PASCAL DATA STRUCTURES

4. tpu55a.zip Inside Turbo Pascal 5.5 TPU units structure, W.Peavy

5. "Structured Programming in Turbo Pascal"

6. Turbo Pascal 7.0 *.THP file structure

7. file2inc.zip Binary data to INC file maker for Turbo Pascal

8. Need early Turbo Pascal data type details

9. Converting Turbo Pascal binary data files with C++

 

 
Powered by phpBB® Forum Software