Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: "lou smith" <9813152 AT fharga DOT sun DOT ac DOT za>, djgpp AT delorie DOT com Date: Wed, 15 Apr 1998 17:46:14 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: farnspoke/peek and the ".byte 0x64" thingy In-reply-to: <28AB7905E4C@fharga.sun.ac.za> Precedence: bulk "lou smith" <9813152 AT fharga DOT sun DOT ac DOT za> wrote: > why does _farnspoke / peek need the ".byte 0x64" segment override > (note : farNSpoke/peek ) Because: 1) You are using other selector different than DS (the instructions involved have DS as default), so you must specify what register to use, that's what 0x64 does. 2) For that you can use a syntax like this: FS: movl .... or similar (mov FS:... in TASM), but this mechanism is broken in some GAS versions so the 0x64 is used. > someone replied to some of my previous questions (i.e. "is it > neccesary for EVERY memory access instruction to be preceded by a > segment override ") Only if you don't want to use the default. > and told me that memory access instructions dont > need to be preceded by a segment override - he told me that > farnspoke/peek ,for example, dont precede every memory access with a > "byte 0x64" Ah? > BUT when i looked in "farptr.h" i saw that it does !!?!?! Of course. > could someone please explain to me what segment overriding is all > about -- because quite clearly i'm extremely confused. I can see, is just a way to use other of the selector registers avoiding to reload DS (or the default register for the instruction) . 386 processors adds 2 selector registers (FS and GS) to the one (ES) in 8086 for general purpose. CS is for the code and SS for the stack. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://set-soft.home.ml.org/ or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013