delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/06/20/07:20:51

From: amh15 AT cus DOT cam DOT ac DOT uk (Alan Hart)
Subject: That assembler bug?
To: djgpp AT sun DOT soe DOT clarkson DOT edu (GNU C++)
Date: Mon, 20 Jun 1994 11:29:23 +0100 (BST)

I can now be more precise about the (dis)assembler bug I mentioned before. It 
actually appears to be a 'feature' of gcc (gas?) as follows:

movw %%dx,foo(%%esi,%%ecx,$4) generates a move to [esi+ecx+foo], while
movw %%dx,foo(%%esi,%%ecx,4) generates a move to [esi+ecx*4+foo].

In other words, using a dollar sign before the scale factor causes it to be 
ignored. Note that using '%0' instead of the scale factor i.e.:

movw %%dx,foo(%%esi,%%ecx,%0)

with %0 defined to be an "i" (if I remember correctly) generates the former
case, which is not what I want at all.

(1) Is there any way to get an adjustable scale factor using the '%0' 
notation? Maybe this should be an "m" rather than an "i".
(2) Is this a bug?

What I previously thought might be a bug in the disassembly in debug32 and 
the full screen debugger was not (the code did indeed contain the wrong 
instruction as explained above).

I'd really appreciate any help with this.

Alan

-------------------------------------------------------------
|        | amh15 AT cus DOT cam DOT ac DOT uk --- Work Tel: +44 223 337493 |
|  Alan  | Fax: +44 223 337706 --- Home Tel: +44 223 515460 |
|  Hart  | Microelectronics Research Centre, Cavendish Lab, |
|        | Madingley Road, Cambridge, ENGLAND. CB3 0HE      |
-------------------------------------------------------------

- Raw text -


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