Board index » delphi » DS, ES, FS, GS Registers in TP7.0 *HELP*

DS, ES, FS, GS Registers in TP7.0 *HELP*

Hi!!!

I have a problem. I have some problems with drawing bitmaps on the screen
in VGA 13h (it is too slow). Because this procedure is written in
assembler, I posted it in comp.lang.asm.x86. I got some answers, but all
of them requires more segment registers than ES. (DS, FS, GS). Is there
any way of using this registers in Pascal (the documentation says I cannot
change DS, and it is doing like it does not know FS and GS at all - I was
playing with TP6.0, can it work on TP7.0) ?????

Thanx a lot      Vaclav Pribik

 

Re:DS, ES, FS, GS Registers in TP7.0 *HELP*


In article <emorse-0704961005530...@p8.boulder-2.dialup.csn.net> emo...@csn.net (Vaclav Pribik) writes:

Quote
>Hi!!!
>I have a problem. I have some problems with drawing bitmaps on the screen
>in VGA 13h (it is too slow).

13h slow?  If it's slow, it's probably the code.  13h is straightforward and
easy to use.  How slow is too slow, anyway?

Quote
>Because this procedure is written in
>assembler, I posted it in comp.lang.asm.x86.

I haven't been following c.l.a.x86 lately, so I didn't notice it.  Perhaps
you could post it here, if you haven't already (haven't checked for it yet).

Quote
>I got some answers, but all
>of them requires more segment registers than ES.

Typically, you should just need ES and DS, to specify the write destination
and read source, respectively.

Quote
>(DS, FS, GS).

DS you need.  FS and GS are 386+ segment registers, and not readily
available in TP (286 registers only).

Quote
>Is there
>any way of using this registers in Pascal (the documentation says I cannot
>change DS,

This isn't quite correct.  You can change DS any way you need, as long as
you preserve the original value when you're done with it.  DS holds the
segment (selector in prot. mode) of the program's data segment, and changing
it without any regard is likely to crash the program or, in some cases, the
whole system.  The same applies to the SS (stack segment) and CS (code
segment) registers.

The method I use for coding an assembler block that needs to use DS looks
like:

procedure my_asm_proc; assembler;

asm
  {some code might go here}
  push  ds
  {DS-dependent code goes here}
@Done:
  pop   ds
  {other clean-up code goes here}
end;

If there's a conditional that needs to leave the procedure, I just add "Jxx
@Done" (whatever jump is appropriate), and it goes to the cleanup part and
restores DS and whatever else it needs to do.

Quote
>and it is doing like it does not know FS and GS at all - I was
>playing with TP6.0, can it work on TP7.0) ?????

Not easily, since TP is a 286-level native compiler at best.  It can be done
with inlining or db/dw codes.

Quote
>Thanx a lot      Vaclav Pribik

--
Scott F. Earnest           | We now return you to our regularly scheduled
sc...@whiplash.res.cmu.edu | chaos and mayhem. . . .

Re:DS, ES, FS, GS Registers in TP7.0 *HELP*


In article <emorse-0704961005530...@p8.boulder-2.dialup.csn.net> emo...@csn.net (Vaclav Pribik) writes:

Quote
>Path: nic.wi.leidenuniv.nl!highway.leidenuniv.nl!surfnet.nl!swsbe6.switch.ch!swidir.switch.ch!in2p3.fr!univ-lyon1.fr!jussieu.fr!math.ohio-state.edu!cs.utexas.edu!swrinde!gatech!newsfeed.internetmci.com!csn!news-1.csn.net!news-2.csn.net!p8.boulder-2.dialu>Path: nic.wi.leidenuniv.nl!highway.leidenuniv.nl!surfnet.nl!swsbe6.switch.ch!swidir.switch.ch!in2p3.fr!univ-lyon1.fr!jussieu.fr!math.ohio-state.edu!cs.utexas.edu!swrinde!gatech!newsfeed.internetmci.com!csn!news-1.csn.net!news-2.csn.net!p8.boulder-2.dialu>.csn.net!user
>From: emo...@csn.net (Vaclav Pribik)
>Newsgroups: comp.lang.pascal.borland
>Subject: DS, ES, FS, GS Registers in TP7.0 *HELP*
>Date: Sun, 07 Apr 1996 10:05:53 -0700
>Organization: HAF
>Lines: 12
>Message-ID: <emorse-0704961005530...@p8.boulder-2.dialup.csn.net>
>NNTP-Posting-Host: 199.117.100.8
>Hi!!!

>I have a problem. I have some problems with drawing bitmaps on the screen
>in VGA 13h (it is too slow). Because this procedure is written in
>assembler, I posted it in comp.lang.asm.x86. I got some answers, but all
>of them requires more segment registers than ES. (DS, FS, GS). Is there
>any way of using this registers in Pascal (the documentation says I cannot
>change DS, and it is doing like it does not know FS and GS at all - I was
>playing with TP6.0, can it work on TP7.0) ?????

Hi,
you can use DS, but you'll have to push it first:

begin
  asm
    push ds
    ...   {your code}
    pop ds
  end;
end;

Hope this helps..

Quote
>Thanx a lot      Vaclav Pribik

you're welcome :)

Alcyone

Other Threads