delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/12/09/06:28:18

Date: Tue, 9 Dec 1997 13:27:57 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
cc: DJ Delorie <dj AT delorie DOT com>, Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Subject: Stack alignment
Message-ID: <Pine.SUN.3.91.971209132623.7213Q-100000@is>
MIME-Version: 1.0

Charles suggested to make sure in the startup code that the stack is 
aligned on a 4-byte boundary.  Here's the necessary patch:

*** src/libc/crt0/crt0.S~0	Sun Oct  6 02:19:30 1996
--- src/libc/crt0/crt0.S	Tue Dec  9 09:10:10 1997
***************
*** 263,268 ****
--- 263,269 ----
  	je	no_memory
  	movl	%eax, ___djgpp_stack_limit	/* Bottom of stack */
  	addl	__stklen, %eax
+ 	andb	$0xfc, %al		/* make it 4-byte aligned */
  	movw	%ds, %dx		/* set stack */
  	movw	%dx, %ss
  	movl	%eax, %esp

- Raw text -


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