www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/17/21:51:18

Message-Id: <s1c6b119.083@MAIL.TAIT.CO.NZ>
Date: Tue, 18 Jun 1996 13:37:43 +1200
From: Bill Currie <bill_currie AT MAIL DOT TAIT DOT CO DOT NZ>
To: djgpp AT delorie DOT com
Subject: Re: Scale by 4 in asm faults?

On 14/6/96  5:18 pm, <moskewicz AT MEM DOT po DOT com> did thus say >>>
> 		movl %%fs:(,%2,4),%%eax 
                    ^^ This is pointing directly to your buffer (%edi) and so you
                       are trying to address buf1*4, which is outside your
                       address space.

What you want (??) is
   movl %%fs:(%2),%%eax

for SIB addressing the format is  offset(basereg,indexreg,scaleval) giving an
effective address of offset+basereg+indexreg*scaleval.  For more info on 386 asm
under gnu, check out the info pages (info as mach i386) as well as brennan's asm
examples (don't know the url's, search the archives on dj's site
(www.delorie.com)).

Hope this helps
Bill


- Raw text -


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