delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/01/11/14:41:33

Sender: bcurrie AT tssc DOT co DOT nz
Message-ID: <34B91FA7.341C@tssc.co.nz>
Date: Mon, 12 Jan 1998 08:38:15 +1300
From: Bill Currie <bcurrie AT tssc DOT co DOT nz>
Organization: Telecommunication Systems Support Centre
MIME-Version: 1.0
To: DJ Delorie <dj AT delorie DOT com>
CC: eliz AT is DOT elta DOT co DOT il, andrewc AT rosemail DOT rose DOT hp DOT com,
djgpp-workers AT delorie DOT com
Subject: Re: Stack Alignment
References: <199801111910 DOT OAA25392 AT delorie DOT com>

DJ Delorie wrote:
 
>         movw    %ds, %dx                /* set stack */
>         movw    %dx, %ss
> >>>     andb    $0xf8, %eax             /* align to 8-byte boundary */
>         movl    %eax, %esp


Hey! gas is going to barf on that!!! (operand size mismatch) that should
be either:

andb $0xf8,%al

or

andw $0xfff8,%ax

or

andl $0xfffffff8,%eax


I'm not certain, but I think gas will use the sign extension form if
another register is used.

Bill
-- 
Leave others their otherness

- Raw text -


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