Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #1453

Re: XMS transfer troubles with Turbo C

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail
From "Rod Pemberton" <dont_use_email@xnothavet.cqm>
Newsgroups comp.os.msdos.programmer
Subject Re: XMS transfer troubles with Turbo C
Date Sat, 26 Jul 2014 13:21:23 -0400
Organization Aioe.org NNTP Server
Lines 48
Message-ID <op.xjl7txpp6zenlw@localhost> (permalink)
References <53d13fd3$0$2229$426a74cc@news.free.fr> <lquclc$7j1$1@rumours.uwaterloo.ca> <53d3bc6c$0$2043$426a74cc@news.free.fr>
NNTP-Posting-Host CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1; format=flowed; delsp=yes
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Opera Mail/12.16 (Linux)
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.os.msdos.programmer:1453

Show key headers only | View raw


On Sat, 26 Jul 2014 10:34:20 -0400, Mateusz Viste  
<mateusz.viste@localhost> wrote:

> That's what I did today - I removed my C operations on registers, and  
> replaced them with inline ASM. So far, thing didn't changed, but I am  
> not really sure what such thing mean:
>
>          call    [dword cs:XMSDriver]
>
> Specifically, what's the "cs:" for? XMSDriver is a DWORD that contains  
> the address of an external function.

CS is a code segment override.  It tells the processor to use the code
segment register for the segment (in RM, descriptor in PM).  Normally,
the processor uses the data segment register for the segment for data,
except for a few instructions.  In 16-bit RM, this has to do with the
segment:offset addressing:

   address = segment * 16 + offset

So, if the CS segment and DS segment are both 0 then the then CS:0 and
DS:0 point to the same address.  But, if the CS segment and DS segment
are different, then their addresses would be different.

I suspect that you don't want CS here.  CS is the CS of your code,
not the CS of the XMSDriver.  You want the segment of the XMSDriver
which was returned by Int 2fh, AH=4310h.  It also takes a jump to
set CS.  You can't move a value into CS like you can with DS, ES,
FS, GS.

If you need to set the segment for the call to the XMSDriver,
you probably want to use a segment register other than CS, and
the appropriate segment register override.

You can use DS temporarily, but I'd suggest ES if it's not in use.
For 386 (or 486?) or later, you can use FS or GS (on processors where
PM is available).

Assuming you've saved the segment and offset from Int 2fh, AH=4310h
like in the XMS 3.0 specification, you'd do something like:

  mov es, [XMSDriver+2]      ; saved segment
  call [dword es:XMSDriver]

You can push and pop es, if needed.


Rod Pemberton

Back to comp.os.msdos.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-24 19:18 +0200
  Re: XMS transfer troubles with Turbo C Johann Klammer <klammerj@NOSPAM.a1.net> - 2014-07-24 22:00 +0200
    Re: XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-25 08:12 +0200
  Re: XMS transfer troubles with Turbo C Ross Ridge <rridge@csclub.uwaterloo.ca> - 2014-07-25 15:54 -0400
    Re: XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-26 16:34 +0200
      Re: XMS transfer troubles with Turbo C "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-07-26 13:21 -0400
        Re: XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-27 09:57 +0200
          Re: XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-27 10:38 +0200
            Re: XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-27 11:01 +0200
              Re: XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-27 11:20 +0200
                Re: XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-27 12:07 +0200
                Re: XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-27 12:41 +0200
                Re: XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-27 15:46 +0200
                Re: XMS transfer troubles with Turbo C Johann Klammer <klammerj@NOSPAM.a1.net> - 2014-07-27 16:39 +0200
                Re: XMS transfer troubles with Turbo C Mateusz Viste <mateusz.viste@localhost> - 2014-07-27 20:09 +0200
          Re: XMS transfer troubles with Turbo C "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-07-27 12:32 -0400
            Re: XMS transfer troubles when AWEUTIL is loaded (exception 0D) Mateusz Viste <mateusz.viste@localhost> - 2014-07-27 20:23 +0200
      Re: XMS transfer troubles with Turbo C Ross Ridge <rridge@csclub.uwaterloo.ca> - 2014-07-27 12:25 -0400
        Re: XMS transfer troubles when AWEUTIL is loaded (exception 0D) Mateusz Viste <mateusz.viste@localhost> - 2014-07-27 20:05 +0200
          Re: XMS transfer troubles when AWEUTIL is loaded (exception 0D) "Alexei A. Frounze" <alexfrunews@gmail.com> - 2014-07-28 22:13 -0700
            Re: XMS transfer troubles when AWEUTIL is loaded (exception 0D) rugxulo@gmail.com - 2014-07-29 15:08 -0700
              Re: XMS transfer troubles when AWEUTIL is loaded (exception 0D) Mateusz Viste <mateusz.viste@localhost> - 2014-07-30 08:25 +0200
  Re: XMS transfer troubles Mateusz Viste <mateusz.viste@localhost> - 2014-07-28 21:10 +0200

csiph-web