Board index » delphi » TMT and SEG()

TMT and SEG()

The SEG procedure always return 0 in TMT-pascal.
(Why do they have the procedure there???)
I need to know at which segment and oppset a pointer i placed.
(In BP seg(mypointer^) and off(mypointer^))

What should I do??

 

Re:TMT and SEG()


In article <3458A96F.F770D...@online.no>, John Iver Berg <iv...@online.no> writes:

Quote
> The SEG procedure always return 0 in TMT-pascal.
> (Why do they have the procedure there???)
> I need to know at which segment and oppset a pointer i placed.
> (In BP seg(mypointer^) and off(mypointer^))

> What should I do??

The Seg function is for backwards compatibility only.

In TMT Pascal, there are no segments, it is a 32-bit protected mode compiler, all
pointers are just flat pointers.

The whole concept of segment/offset pairs is a kludge because intel wanted 20-bit
addressing on the original 8086, despite it only having 16-bit registers. So they
use two 16-bit numbers, shifted one of them left 4 bits and add them.

In 32-bit protected mode, segments are meaningless.

--
class Robert extends Person {
        String getName() { return "Robert Brady"; }
        String getEmail() { return "rwb...@ecs.soton.ac.uNITEDkINGDOM"; }
        String getURL() { return "http://www.ecs.soton.ac.uk/~rwb197/"; }

Quote
}

Re:TMT and SEG()


Quote
Robert Brady wrote:
> In article <3458A96F.F770D...@online.no>, John Iver Berg
> <iv...@online.no> writes:
> > The SEG procedure always return 0 in TMT-pascal.
> > (Why do they have the procedure there???)
> > I need to know at which segment and oppset a pointer i placed.
> > (In BP seg(mypointer^) and off(mypointer^))

> > What should I do??

> The Seg function is for backwards compatibility only.

> In TMT Pascal, there are no segments, it is a 32-bit protected mode
> compiler, all
> pointers are just flat pointers.

> The whole concept of segment/offset pairs is a kludge because intel
> wanted 20-bit
> addressing on the original 8086, despite it only having 16-bit
> registers. So they
> use two 16-bit numbers, shifted one of them left 4 bits and add them.

> In 32-bit protected mode, segments are meaningless.

Ok. But is there a way to find out where in the flat memort the pointer
is placed?
When you access VGA you use mem[$a0000+offset] which is one number and
not two like mem[$a000:offset].
Is there a way to find out where the pointer starts in this memory?

John Iver Berg

Re:TMT and SEG()


In article: <63ag3f$...@wapping.ecs.soton.ac.uk>  

Quote
rwb...@ecs.soton.ac.uNITEDkINGDOM (Robert Brady) writes:

>The whole concept of segment/offset pairs is a kludge because intel wanted
>20-bitm addressing on the original 8086, despite it only having 16-bit
>registers. So they use two 16-bit numbers, shifted one of them left 4 bits and
>add them.

Agreed.

Quote

>In 32-bit protected mode, segments are meaningless.

Segments are fairly meaningless in 32-bit FLAT mode only. Note that what is
called "32-bit" 80386+ addressing is really 48-bit addressing because the
segment (or selector to be more accurate in when talking about protected mode)
registers are still alive and kicking, and still being used when the CPU
generates any effective address.

-- Jay

 --------------------------------------------------------------------------
| Jason Burgon - author of Graphic Vision, TV-Like GUI for 256 Colour SVGA |
| g...@jayman.demon.co.uk   ftp://SimTel/msdos/turbopas/gv4svga1.zip         |
| ***NEW VERSION OF GV AVAILABLE FROM*** -> http://www.jayman.demon.co.uk  |
 --------------------------------------------------------------------------

Re:TMT and SEG()


On Fri, 31 Oct 1997 23:21:34 +0100, John Iver Berg <iv...@online.no>
wrote:

Quote

>Ok. But is there a way to find out where in the flat memort the pointer
>is placed?
>When you access VGA you use mem[$a0000+offset] which is one number and
>not two like mem[$a000:offset].
>Is there a way to find out where the pointer starts in this memory?

You already did! The flat memory starts at physical offset 00000000,
therefore:  real-mode $a000:offset is the same as $a0000+offset in
protected mode flat memory model.

        Roman Gruber (grub...@kapsch.net)

Other Threads