Board index » delphi » How to convert 16-bit code into 32-bit

How to convert 16-bit code into 32-bit

Hi, everybody:

    Would anybody be pls. tell me how to fix
following code into 32-bit:

     Procedure SortFetchAddr( Ix: Integer; Var Adr: SortPointer);
     Var IxPage : Integer;
                I      : 0..10;
     Begin
         IxPage:= Ix Div SortRecord.B;
         I:= 0;
         While SortRecord.Page[i] <> IxPage Do I:=I+1;
         Adr:=Ptr(Seg(SortRecord.Buf[I]^),
                  Ofs(SortRecord.Buf[I]^)+(Ix Mod
SortRecord.B)*SortRecord.ItemLength);
         End;

  Thank you, very much!!

    Center Liu 11/11/1999

 

Re:How to convert 16-bit code into 32-bit


T232NDT heeft geschreven in bericht <80dck5$...@netnews.hinet.net>...

Quote
>Hi, everybody:

>    Would anybody be pls. tell me how to fix
>following code into 32-bit:

>     Procedure SortFetchAddr( Ix: Integer; Var Adr: SortPointer);
>     Var IxPage : Integer;
>                I      : 0..10;
>     Begin
>         IxPage:= Ix Div SortRecord.B;
>         I:= 0;
>         While SortRecord.Page[i] <> IxPage Do I:=I+1;
>         Adr:=Ptr(Seg(SortRecord.Buf[I]^),
>                  Ofs(SortRecord.Buf[I]^)+(Ix Mod
>SortRecord.B)*SortRecord.ItemLength);
>         End;

The 16-bit Segment:Offset memory model does not exist anymore (sigh)  in
WIN32. Memory is now linear. You need to get rid of the Seg() and Ofs()
calls.

Regards,
Dirk Claessens
-----------------------------------------------------
emails will bounce, unless sent to :
Dirk <DOT> Claessens < AT> Village <DOT> uunet <DOT> be
----------------------------------------------------

Re:How to convert 16-bit code into 32-bit


On Thu, 11 Nov 1999 16:34:54 +0100, "Dirk Claessens"

Quote
<will.bou...@back.com> wrote:
>The 16-bit Segment:Offset memory model does not exist anymore (sigh)  in
>WIN32.

Or rather, the values you establish for segment and offset behave as
pointers into tables containing the segment:offset actually being
used.

Quote
>Memory is now linear.

??? It has always been linear. In a way, it was more linear in the
16-bits world, as actually, in 32-bits, your code may be fragmented in
4k chunks everywhere -even the disk. That's why there are utilities to
defragment the Ram.

Memory is now flat model, which is a different thing. It just means
there is only one segment for both code, data, and stack -as was the
case with DOS .com files in the jurassic era. But a much bigger one!
(4Gb against 64k).

Quote
>You need to get rid of the Seg() and Ofs()
>calls.

Definitely!

Other Threads