/* ================================================================================ RPL/2 (R) version 4.1.12 Copyright (C) 1989-2013 Dr. BERTRAND Joël This file is part of RPL/2. RPL/2 is free software; you can redistribute it and/or modify it under the terms of the CeCILL V2 License as published by the french CEA, CNRS and INRIA. RPL/2 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 CeCILL V2 License for more details. You should have received a copy of the CeCILL License along with RPL/2. If not, write to info@cecill.info. ================================================================================ */ #include "rpl-conv.h" /* ================================================================================ Routine renvoyant la longueur courante des entiers binaires ================================================================================ Entrées : structure sur l'état du processus -------------------------------------------------------------------------------- Sorties : longueur -------------------------------------------------------------------------------- Effets de bord : néant ================================================================================ */ unsigned char longueur_entiers_binaires(struct_processus *s_etat_processus) { unsigned char longueur_binaire; unsigned long i; unsigned long j; longueur_binaire = 1; j = 1; for(i = 0; i < 6; i++) { longueur_binaire += (test_cfsf(s_etat_processus, 37 + i) == d_vrai) ? j : 0; j *= 2; } return(longueur_binaire); } /* ================================================================================ Routine renvoyant le masque sur les entiers binaires (longueur à tronquer) ================================================================================ Entrées : structure sur l'état du processus -------------------------------------------------------------------------------- Sorties : masque -------------------------------------------------------------------------------- Effets de bord : néant ================================================================================ */ logical8 masque_entiers_binaires(struct_processus *s_etat_processus) { unsigned char i; unsigned char longueur; logical8 masque; longueur = longueur_entiers_binaires(s_etat_processus); masque = 0; for(i = 0; i < longueur; i++) { masque |= (((logical8) 1) << i); } return(masque); } // vim: ts=4