OpenCores
URL https://opencores.org/ocsvn/zipcpu/zipcpu/trunk

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sw/] [zasm/] [twoc.cpp] - Diff between revs 69 and 156

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 69 Rev 156
Line 12... Line 12...
// Creator:     Dan Gisselquist, Ph.D.
// Creator:     Dan Gisselquist, Ph.D.
//              Gisselquist Technology, LLC
//              Gisselquist Technology, LLC
//
//
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//
//
// Copyright (C) 2015, Gisselquist Technology, LLC
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
//
//
// This program is free software (firmware): you can redistribute it and/or
// This program is free software (firmware): you can redistribute it and/or
// modify it under the terms of  the GNU General Public License as published
// modify it under the terms of  the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License, or (at
// by the Free Software Foundation, either version 3 of the License, or (at
// your option) any later version.
// your option) any later version.
Line 48... Line 48...
                r |= (-1l << bits);
                r |= (-1l << bits);
        return r;
        return r;
}
}
 
 
bool    sfits(const long val, const int bits) {
bool    sfits(const long val, const int bits) {
        long    alt = sbits(val, bits);
 
        return (sbits(val, bits) == bits);
        return (sbits(val, bits) == bits);
}
}
 
 
unsigned long   ubits(const long val, const int bits) {
unsigned long   ubits(const long val, const int bits) {
        unsigned long r = val & ((1l<<bits)-1);
        unsigned long r = val & ((1l<<bits)-1);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.