www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/13/13:58:31

Date: Wed, 13 May 1998 12:07:32 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Dark Angel <mop45440 AT mail DOT telepac DOT pt>
cc: djgpp AT delorie DOT com
Subject: Re: _farpokeb Function
In-Reply-To: <01bd7e00$9a643480$cafd41c2@default>
Message-ID: <Pine.SUN.3.91.980513120701.26082R-100000@is>
MIME-Version: 1.0

On 13 May 1998, Dark Angel wrote:

> -What is the fs register?

FS is one of the segment registers which is usually free to be used by
the application.

> -Why move the selector to fs?

How else would you access a memory region which is outside the limits
of the DS selector?  You need to load the selector for the
conventional memory into some register.  FS is free and has the least
side effects, so it is used.

> -What is this? .byte 0x64?

The opcode for the FS: segment override, which inline assembly doesn't
support directly.

> "movb %b1, (%k2)")	-what is the address of %k2?

k2 is argument 2 with the k constraint (you only need the constraints
when you write inline assembly).

> What is the correspondent instruction in AT&T asm for "include" of intel
> (to include an external file)?.

You can use #include as in C, just call your files foo.S (with a
capital S) when you submit them to GCC.  GCC will then know to pass
them through a pre-processor before the assembly.

Or you can use the .include directive.

> Yet, another question:
> When i get the selector with _dpmi_segment_to_descriptor(0xa000) is it
> always the same or it can change? can i get it once, and then use the value
> as a constant?

It's constant, it doesn't even change if you make that call many
times: calling `__dpmi_segment_to_descriptor' with the same argument
always yields the same selector.  This is clearly described in the
DPMI spec, which you should read.

> Wait, i got another one!
> How do i declare a global variable in AT&T asm?

Maybe you should stop asking too many questions before you read the
available docs ;-).  All of the above are explained in the Gas docs
(type "info as" from the DOS prompt) and in the DPMI spec (whose URL
is included in the DJGPP FAQ list).  Please try to make some effort to
find the info yourself before you ask them here.

- Raw text -


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