#
# gccopt rules to convert gcc assembler output to real mode
#
# Copyright (C) 2003-2007 Gero Kuhlmann <gero@gkminix.han.de>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: rules.stack,v 1.6 2007/01/06 18:31:20 gkminix Exp $
#
#####################################################################
#
# Adjust stack frame
#
.type	?1,@function
=
.type	?1,@function	/*?=[2]O O=2 */


pushl	%ebp
=
pushw	%bp		/*?=[4]O O=4 */

movl	%esp,%ebp
=
movw	%sp,%bp

popl	%ebp
=
popw	%bp


?s?[,|	]9?(|4|)0(%ebp)?e
=
?9?(?0-?O)/*?0*/(%bp)

?s?[,|	]9?(|4|)0(%ebp,?e
=
?9?(?0-?O)/*?0*/(%ebp,

?s?[,|	]9?(||-4)0(%ebp)?e
=
?9?0(%bp)


?s?[,|	]9?(|4|)0(?1%esp?2)?e
=
?9?(?0-?O)/*?0*/(?1%esp?2)


?[add|sub]0l	$?1,%esp
=
?0w	$?1,%sp

leal	?0(%bp),%esp
=
leaw	?0(%bp),%sp


