[fpc-pascal]Debuging in Freepascal

Thomas Schatzl tom_at_work at yline.com
Wed Sep 27 13:50:35 CEST 2000

Subject: Re: [fpc-pascal]Debuging in Freepascal

At 19:31 26/09/00 +0200, you wrote:
>>Subject: Re: [fpc-pascal]Debuging in Freepascal
>>>Pierre Muller schrieb:
>>>> What version of Free Pascal are you using ??
>>>The author of this async unit uses objects for the communication so i
>>>know whether the unit is still working with other switches.
>>>Is there another way to use this selector without crashes ?
>>You could try to store the cs register into ds and es since with go32v2 cs
>>ds = es. So little code like
>>movw %cs, %ax
>>movw %ax, %ds
>>movw %ax, %es
>Are you sure this works ?
>  cs and ds selector have the same base address
>(the base address is the offset added to the address to get
>a linear address) but the permission are different !
>  I think that normally you are not allowed to write with the cs selector !

It doesn't depend on the use of the cs segment register but on the
descriptor's access rights.

But you're right that it won't work - because my assumption is simply wrong,
I've checked it.

I was trapped by remembering to have done some fpc program which
self-modifies its' code - but I didn't remember that the code change was
done via ds not cs.... :(

Well, the v2prt0_ds_alias or the use of the dsegalias()-function should


More information about the fpc-pascal mailing list