push_and_pop.py revision 5426:0bdcc60ccc45
112391Sjason@lowepower.com# Copyright (c) 2007-2008 The Hewlett-Packard Development Company 212391Sjason@lowepower.com# All rights reserved. 312391Sjason@lowepower.com# 412391Sjason@lowepower.com# Redistribution and use of this software in source and binary forms, 512391Sjason@lowepower.com# with or without modification, are permitted provided that the 612391Sjason@lowepower.com# following conditions are met: 712391Sjason@lowepower.com# 812391Sjason@lowepower.com# The software must be used only for Non-Commercial Use which means any 912391Sjason@lowepower.com# use which is NOT directed to receiving any direct monetary 1012391Sjason@lowepower.com# compensation for, or commercial advantage from such use. Illustrative 1112391Sjason@lowepower.com# examples of non-commercial use are academic research, personal study, 1212391Sjason@lowepower.com# teaching, education and corporate research & development. 1312391Sjason@lowepower.com# Illustrative examples of commercial use are distributing products for 1412391Sjason@lowepower.com# commercial advantage and providing services using the software for 1512391Sjason@lowepower.com# commercial advantage. 1612391Sjason@lowepower.com# 1712391Sjason@lowepower.com# If you wish to use this software or functionality therein that may be 1812391Sjason@lowepower.com# covered by patents for commercial use, please contact: 1912391Sjason@lowepower.com# Director of Intellectual Property Licensing 2012391Sjason@lowepower.com# Office of Strategy and Technology 2112391Sjason@lowepower.com# Hewlett-Packard Company 2212391Sjason@lowepower.com# 1501 Page Mill Road 2312391Sjason@lowepower.com# Palo Alto, California 94304 2412391Sjason@lowepower.com# 2512391Sjason@lowepower.com# Redistributions of source code must retain the above copyright notice, 2612391Sjason@lowepower.com# this list of conditions and the following disclaimer. Redistributions 2712391Sjason@lowepower.com# in binary form must reproduce the above copyright notice, this list of 2812391Sjason@lowepower.com# conditions and the following disclaimer in the documentation and/or 2912391Sjason@lowepower.com# other materials provided with the distribution. Neither the name of 3012391Sjason@lowepower.com# the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 3112391Sjason@lowepower.com# contributors may be used to endorse or promote products derived from 3212391Sjason@lowepower.com# this software without specific prior written permission. No right of 3312391Sjason@lowepower.com# sublicense is granted herewith. Derivatives of the software and 3412391Sjason@lowepower.com# output created using the software may be prepared, but only for 3512391Sjason@lowepower.com# Non-Commercial Uses. Derivatives of the software may be shared with 3612391Sjason@lowepower.com# others provided: (i) the others agree to abide by the list of 3712391Sjason@lowepower.com# conditions herein which includes the Non-Commercial Use restrictions; 3812391Sjason@lowepower.com# and (ii) such Derivatives of the software include the above copyright 3912391Sjason@lowepower.com# notice to acknowledge the contribution from this software where 4012391Sjason@lowepower.com# applicable, this list of conditions and the disclaimer below. 4112391Sjason@lowepower.com# 4212391Sjason@lowepower.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 4312391Sjason@lowepower.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 4412391Sjason@lowepower.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 4512391Sjason@lowepower.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 4612391Sjason@lowepower.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 4712391Sjason@lowepower.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 4812391Sjason@lowepower.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 4912391Sjason@lowepower.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 5012391Sjason@lowepower.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 5112391Sjason@lowepower.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 5212391Sjason@lowepower.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5312391Sjason@lowepower.com# 5412391Sjason@lowepower.com# Authors: Gabe Black 5512391Sjason@lowepower.com 5612391Sjason@lowepower.commicrocode = ''' 5712391Sjason@lowepower.comdef macroop PUSHF { 5812391Sjason@lowepower.com .adjust_env oszIn64Override 5912391Sjason@lowepower.com 6012391Sjason@lowepower.com rflags t1 6112391Sjason@lowepower.com stupd t1, ss, [1, t0, rsp], "-env.dataSize" 6212391Sjason@lowepower.com}; 6312391Sjason@lowepower.com 6412391Sjason@lowepower.comdef macroop POPF { 6512391Sjason@lowepower.com .adjust_env oszIn64Override 6612391Sjason@lowepower.com 6712391Sjason@lowepower.com ld t1, ss, [1, t0, rsp] 6812391Sjason@lowepower.com addi rsp, rsp, dsz 6912391Sjason@lowepower.com wrflags t1, t0 7012391Sjason@lowepower.com}; 7112391Sjason@lowepower.com''' 7212391Sjason@lowepower.com