/**************************************************************************/
/*                                                                        */
/*                                 Sources                                */
/*                                from  the                               */
/*                           XSC SOFTWARE PACKAGE                         */
/*                                                                        */
/*                Copyright (c) 1997 University of Karlsruhe              */
/*                     Institute for Appl. Mathematics                    */
/*                                                                        */
/* This program is free software for non-commercial use. For details, see */
/* the file LICENSE.XSC, distributed with this software package.          */
/*                                                                        */
/* This program is distributed WITHOUT ANY WARRANTY. For details, see the */
/* file LICENSE.XSC, distributed with this software package.              */
/*                                                                        */
/**************************************************************************/

/* RCS $Id: b_bms1.c,v 1.2 1997/09/25 16:59:11 ae59 Exp $ */
/*
$Log: b_bms1.c,v $
 * Revision 1.2  1997/09/25  16:59:11  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:21:10  ae59
 * Put under RCS control
 *
 */
/************************************************************************/
/*                                                                      */
/* Descriptive Name : b_bms1.c          Processor : C                   */
/*                                                                      */
/* Subtract 1 digit number from 1 digit number                          */
/*                                                                      */
/* Function value : int       - borrow value                            */
/*                                                                      */
/* Function references : none                                           */
/*                                                                      */
/*      Date            : 1990-07-16                            */
/*      1990-07-16 : LINT_ARGS prototype                        */
/************************************************************************/

#ifndef ALL_IN_ONE
#ifdef AIX
#include "/u/p88c/runtime/o_defs.h"
#else
#include "o_defs.h"
#endif
#define local
#endif

#ifdef LINT_ARGS
local int b_bms1(a_btyp i,a_btyp *r)
#else
local int b_bms1(i,r)

a_btyp i;             /* 1 digit number                               */
a_btyp *r;            /* 1 digit number                               */
#endif
        {
/*----------------------------------------------------------------------*/
        if (i<=*r)
           {
           *r -= i;
           return(0);
           }
#if C_P_2
        *r -= i;
#else
        *r = ( (*r & i & MSB) ? *r-(i^MSB) : (*r^MSB)-i ) ^ MSB;
#endif
        return(1);
        }
