delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/15/18:01:00

From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How to write protected mode far call in AT&T style
Date: Thu, 15 Jun 2000 19:02:51 +0100
Organization: Customer of Planet Online
Lines: 34
Message-ID: <39491A4B.C9CAB7AB@phekda.freeserve.co.uk>
References: <39470e99 AT newsgate DOT hknet DOT com> <200006140615 DOT LAA03124 AT midpec DOT com> <394734f0$1 AT newsgate DOT hknet DOT com> <200006141715 DOT WAA01487 AT www DOT midpec DOT com> <3947F612 DOT 784F2FCC AT phekda DOT freeserve DOT co DOT uk> <3948b53b AT newsgate DOT hknet DOT com>
NNTP-Posting-Host: modem-136.lithium.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news6.svr.pol.co.uk 961106117 25753 62.136.2.136 (15 Jun 2000 21:55:17 GMT)
NNTP-Posting-Date: 15 Jun 2000 21:55:17 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.14 i586)
X-Accept-Language: de,fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello.

Alvin Lau wrote:
> According the definition:
> 
> typedef struct {
>   unsigned long  offset32;
>   unsigned short selector;
> } __dpmi_paddr;
> 
> The offset32 is followed by selector.
> But Prashant TR said "lcall $selector,$offset"
> Should be selector first then offset second.
> So, does "lcall *_oldtimer" still correct ?

Please note that my knowledge of assembly is a bit limited. The way I
understand it, the form "lcall _oldtimer" retrieves the selector and
offset from the memory address 'oldtimer'. I think the form "lcall
$selector, $offset" uses registers instead. If you use the __dpmi_paddr
structure, then you have to use the form with 'oldtimer'. As I suggested
in my previous post, you'd be better off using 'lcall _oldtimer' to be
compatible with binutils 2.8.1 & binutils 2.9.5.1 beta.

I think you are confused because of the order. The structure is the way
things are stored in memory. The second form ("lcall $selector, $offset")
is independent of how things are stored, since you're using mnemonics -
for instance, AT&T syntax and Intel syntax have different parameter orders
for some instructions, but the same code will be generated.

HTH, bye,

-- 
Richard Dawe
[ mailto:richdawe AT bigfoot DOT com | http://www.bigfoot.com/~richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019