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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sw/] [zasm/] [zparser.cpp] - Diff between revs 2 and 8

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 2 Rev 8
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
//
// Filename:    zparser.cpp
// Filename:    zparser.cpp
//
//
// Project:     Zip CPU -- a small, lightweight, RISC CPU core
// Project:     Zip CPU -- a small, lightweight, RISC CPU core
//
//
// Purpose:     
// Purpose:     
//
//
// Creator:     Dan Gisselquist, Ph.D.
// Creator:     Dan Gisselquist, Ph.D.
//              Gisselquist Tecnology, LLC
//              Gisselquist Tecnology, LLC
//
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (C) 2015, Gisselquist Technology, LLC
// Copyright (C) 2015, 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.
//
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
// for more details.
//
//
// You should have received a copy of the GNU General Public License along
// You should have received a copy of the GNU General Public License along
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
// target there if the PDF file isn't present.)  If not, see
// target there if the PDF file isn't present.)  If not, see
// <http://www.gnu.org/licenses/> for a copy.
// <http://www.gnu.org/licenses/> for a copy.
//
//
// License:     GPL, v3, as defined and found on www.gnu.org,
// License:     GPL, v3, as defined and found on www.gnu.org,
//              http://www.gnu.org/licenses/gpl.html
//              http://www.gnu.org/licenses/gpl.html
//
//
//
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
 
 
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <ctype.h>
#include <ctype.h>
#include <strings.h>
#include <strings.h>
 
 
#include "zparser.h"
#include "zparser.h"
#include "zopcodes.h"
#include "zopcodes.h"
 
 
typedef ZPARSER::ZIPI ZIPI;     // A Zip Instruction (i.e. uint32)
typedef ZPARSER::ZIPI ZIPI;     // A Zip Instruction (i.e. uint32)
 
 
bool    ZPARSER::iscomment(const char *line) const {
bool    ZPARSER::iscomment(const char *line) const {
        const   char    *sp = line;
        const   char    *sp = line;
        do {
        do {
                if (*sp == '\0')
                if (*sp == '\0')
                        return true;
                        return true;
                else if (*sp == ';')
                else if (*sp == ';')
                        return true;
                        return true;
                else if (*sp == '#')
                else if (*sp == '#')
                        return true;
                        return true;
                else if (*sp == '\n')
                else if (*sp == '\n')
                        return true;
                        return true;
                else if (*sp == '\r')
                else if (*sp == '\r')
                        return true;
                        return true;
                else if ((*sp == '/')&&(sp[1] == '/'))
                else if ((*sp == '/')&&(sp[1] == '/'))
                        return true;
                        return true;
                else if (!isspace(*sp))
                else if (!isspace(*sp))
                        return false;
                        return false;
        } while(*sp++);
        } while(*sp++);
 
 
        return true;
        return true;
}
}
 
 
bool    ZPARSER::islabel(const char *line) const {
bool    ZPARSER::islabel(const char *line) const {
        const   char *sp = line;
        const   char *sp = line;
        if (isspace(*line))
        if (isspace(*line))
                return false;
                return false;
        if (!isalpha(*line))
        if (!isalpha(*line))
                return  false;
                return  false;
        while((isalpha(*sp))||(isdigit(*sp))||(*sp=='_'))
        while((isalpha(*sp))||(isdigit(*sp))||(*sp=='_'))
                sp++;
                sp++;
        if (*sp != ':')
        if (*sp != ':')
                return false;
                return false;
        sp++;
        sp++;
        return iscomment(sp);
        return iscomment(sp);
}
}
 
 
bool    ZPARSER::parse_op(const char *line, ZPARSER::ZIPA pc,
bool    ZPARSER::parse_op(const char *line, ZPARSER::ZIPA pc,
                ZPARSER::ZIPI &ins, const unsigned lineno) const {
                ZPARSER::ZIPI &ins, const unsigned lineno) const {
        const char      *sp = line;
        const char      *sp = line;
        char    cpy[128], *cp = cpy, *point, *dollar, *plus, *comma,
        char    cpy[128], *cp = cpy, *point, *dollar, *plus, *comma,
                        *opc, *opb;
                        *opc, *opb;
        ZPARSER::ZIPREG ra = ZPARSER::ZIP_Rnone, rb = ZPARSER::ZIP_Rnone;
        ZPARSER::ZIPREG ra = ZPARSER::ZIP_Rnone, rb = ZPARSER::ZIP_Rnone;
        ZIPCOND cnd = ZIPC_ALWAYS;
        ZIPCOND cnd = ZIPC_ALWAYS;
        ZIPIMM  imm = 0;
        ZIPIMM  imm = 0;
        bool    valid = true;
        bool    valid = true;
 
 
        if (!isspace(*sp))
        if (!isspace(*sp))
                return false;
                return false;
 
 
        while(isspace(*sp))
        while(isspace(*sp))
                sp++;
                sp++;
        // Remove comments from our local copy
        // Remove comments from our local copy
        for(unsigned int i=0; i<sizeof(cpy); i++) {
        for(unsigned int i=0; i<sizeof(cpy); i++) {
                if (*sp == '\0')
                if (*sp == '\0')
                        break;
                        break;
                else if (*sp == ';')
                else if (*sp == ';')
                        break;
                        break;
                else if (*sp == '#')
                else if (*sp == '#')
                        break;
                        break;
                else if (*sp == '\n')
                else if (*sp == '\n')
                        break;
                        break;
                else if (*sp == '\r')
                else if (*sp == '\r')
                        break;
                        break;
                else if ((*sp == '/')&&(sp[1] == '/'))
                else if ((*sp == '/')&&(sp[1] == '/'))
                        break;
                        break;
                *cp++ = *sp++;
                *cp++ = *sp++;
        } if (cp-cpy >= (int)sizeof(cpy))
        } if (cp-cpy >= (int)sizeof(cpy))
                return false;
                return false;
        *cp = '\0';
        *cp = '\0';
        point = strchr(cpy, '.');
        point = strchr(cpy, '.');
        comma = strchr(cpy, ',');
        comma = strchr(cpy, ',');
        plus  = strchr(cpy, '+');
        plus  = strchr(cpy, '+');
        dollar= strchr(cpy, '$');
        dollar= strchr(cpy, '$');
        // paren = strchr(cpy, '(');
        // paren = strchr(cpy, '(');
        if (point)  *point++  = '\0';
        if (point)  *point++  = '\0';
        if (comma)  *comma++  = '\0';
        if (comma)  *comma++  = '\0';
        if (plus)   *plus++   = '\0';
        if (plus)   *plus++   = '\0';
        if (dollar) *dollar++ = '\0';
        if (dollar) *dollar++ = '\0';
        // if (paren)  *paren++  = '\0';
        // if (paren)  *paren++  = '\0';
        cp = cpy;
        cp = cpy;
        while(isalpha(*cp))
        while(isalpha(*cp))
                cp++;
                cp++;
        opc = cpy;
        opc = cpy;
        if ((*cp == '\0')&&(point == NULL))
        if ((*cp == '\0')&&(point == NULL))
                cp[1] = '\0';
                cp[1] = '\0';
        *cp = '\0';
        *cp = '\0';
 
 
        if ((point)&&(strncasecmp("DAT",point,3)!=0)) {
        if ((point)&&(strncasecmp("DAT",point,3)!=0)) {
                cp = point;
                cp = point;
                while(isalpha(*cp))
                while(isalpha(*cp))
                        cp++;
                        cp++;
                if (*cp == '\0')
                if (*cp == '\0')
                        cp[1] = '\0';
                        cp[1] = '\0';
                *cp = '\0';
                *cp = '\0';
 
 
                for(int i=1; i<8; i++) {
                for(int i=1; i<8; i++) {
                        if (strcasecmp(&zop_ccstr[i][1], point)==0) {
                        if (strcasecmp(&zop_ccstr[i][1], point)==0) {
                                cnd = (ZIPCOND)i;
                                cnd = (ZIPCOND)i;
                                break;
                                break;
                        }
                        }
                } if (cnd == ZIPC_ALWAYS) {
                } if (cnd == ZIPC_ALWAYS) {
                        printf("ERR: Unrecognized condition, %s\n", point);
                        printf("ERR: Unrecognized condition, %s\n", point);
                        valid = false;
                        valid = false;
                }
                }
        }
        }
 
 
        cp++;
        cp++;
        while(isspace(*cp))
        while(isspace(*cp))
                cp++;
                cp++;
        opb = cp;
        opb = cp;
 
 
        if (dollar) {
        if (dollar) {
                // Figure out the base
                // Figure out the base
                {
                {
                        char *ip = dollar, mxd = 0;
                        char *ip = dollar, mxd = 0;
                        if ((*ip == '0')&&(toupper(ip[1])=='X'))
                        if ((*ip == '0')&&(toupper(ip[1])=='X'))
                                imm = strtoul(dollar, NULL, 16);
                                imm = strtoul(dollar, NULL, 16);
                        else {
                        else {
                                bool neg = false;
                                bool neg = false;
                                if (*ip == '-') {
                                if (*ip == '-') {
                                        neg = true;
                                        neg = true;
                                        ip++;
                                        ip++;
                                        dollar++;
                                        dollar++;
                                }
                                }
                                while(isdigit(*ip)||((toupper(*ip)>='A')&&(toupper(*ip)<='F'))) {
                                while(isdigit(*ip)||((toupper(*ip)>='A')&&(toupper(*ip)<='F'))) {
                                        if (isalpha(*ip))
                                        if (isalpha(*ip))
                                                mxd = (*ip-'a')+10;
                                                mxd = (*ip-'a')+10;
                                        else
                                        else
                                                mxd = (*ip-'0');
                                                mxd = (*ip-'0');
                                        ip++;
                                        ip++;
                                }
                                }
 
 
                                if ((mxd <= 1)&&(*ip=='d'))
                                if ((mxd <= 1)&&(*ip=='d'))
                                        imm = strtoul(dollar, NULL, 2);
                                        imm = strtoul(dollar, NULL, 2);
                                else if ((mxd <= 7)&&((*dollar == '0')||(toupper(*ip)=='O')))
                                else if ((mxd <= 7)&&((*dollar == '0')||(toupper(*ip)=='O')))
                                        imm = strtoul(dollar, NULL, 8);
                                        imm = strtoul(dollar, NULL, 8);
                                else if ((mxd <= 15)&&(toupper(*ip)=='H'))
                                else if ((mxd <= 15)&&(toupper(*ip)=='H'))
                                        imm = strtoul(dollar, NULL, 16);
                                        imm = strtoul(dollar, NULL, 16);
                                else if ((toupper(*ip)=='D')||(*ip == '+')||(isspace(*ip))||(*ip == '(')||(*ip == '\0'))
                                else if ((toupper(*ip)=='D')||(*ip == '+')||(isspace(*ip))||(*ip == '(')||(*ip == '\0'))
                                        imm = atoi(dollar);
                                        imm = atoi(dollar);
                                else {
                                else {
                                        printf("Cannot parse immediate, %s\n", dollar);
                                        printf("Cannot parse immediate, %s\n", dollar);
                                        printf("Assuming you meant %d\n", atoi(dollar));
                                        printf("Assuming you meant %d\n", atoi(dollar));
                                        imm = atoi(dollar);
                                        imm = atoi(dollar);
                                }
                                }
 
 
                                if (neg)
                                if (neg)
                                        imm = -imm;
                                        imm = -imm;
                        }
                        }
                }
                }
                opb = dollar;
                opb = dollar;
                if (plus)
                if (plus)
                        opb = plus;
                        opb = plus;
        } else
        } else
                imm = 0;
                imm = 0;
        if (*opb) for(int i=31; i>=0; i--) {
        if (*opb) for(int i=31; i>=0; i--) {
                // printf("Checking for match: \'%s\' to %s", opb, zop_regstr[i]);
                // printf("Checking for match: \'%s\' to %s", opb, zop_regstr[i]);
                if (NULL != strcasestr(opb, zop_regstr[i])) {
                if (NULL != strcasestr(opb, zop_regstr[i])) {
                        // printf(" --- Match\n");
                        // printf(" --- Match\n");
                        rb = (ZIPREG)i;
                        rb = (ZIPREG)i;
                        break;
                        break;
                } // else printf(" -- nope\n");
                } // else printf(" -- nope\n");
        } if (comma) for(int i=31; i>=0; i--) {
        } if (comma) for(int i=31; i>=0; i--) {
                // printf("Checking for match: ,%s to %s", comma, zop_regstr[i]);
                // printf("Checking for match: ,%s to %s", comma, zop_regstr[i]);
                if (NULL != strcasestr(comma, zop_regstr[i])) {
                if (NULL != strcasestr(comma, zop_regstr[i])) {
                        ra = (ZIPREG)i;
                        ra = (ZIPREG)i;
                        // printf(" --- Match\n");
                        // printf(" --- Match\n");
                        break;
                        break;
                } // else printf(" -- nope\n");
                } // else printf(" -- nope\n");
        }
        }
 
 
        if (strcasecmp("MOV",opc)!=0) {
        if (strcasecmp("MOV",opc)!=0) {
                // Only move instructions can reference user regs
                // Only move instructions can reference user regs
                if ((ra != ZIP_Rnone)&&(ra >= ZIP_uR0))
                if ((ra != ZIP_Rnone)&&(ra >= ZIP_uR0))
                        valid = false;
                        valid = false;
                if ((rb != ZIP_Rnone)&&(rb >= ZIP_uR0))
                if ((rb != ZIP_Rnone)&&(rb >= ZIP_uR0))
                        valid = false;
                        valid = false;
                if (!valid)
                if (!valid)
                        printf("ERR: Only Mov can specify user regs\n");
                        printf("ERR: Only Mov can specify user regs\n");
        }
        }
 
 
        if ((!*opc)&&(strncasecmp("DAT",point,3)==0)) {
        if ((!*opc)&&(strncasecmp("DAT",point,3)==0)) {
                ins = strtoul(opb, NULL, 0);
                ins = strtoul(opb, NULL, 0);
                valid = true;
                valid = true;
        } else if (strcasecmp("CMP",opc)==0) {
        } else if (strcasecmp("CMP",opc)==0) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_cmp(cnd, imm, rb, ra);
                        ins = op_cmp(cnd, imm, rb, ra);
                else    ins = op_cmp(cnd, imm, ra);
                else    ins = op_cmp(cnd, imm, ra);
        } else if (strcasecmp("TST",opc)==0) {
        } else if (strcasecmp("TST",opc)==0) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_tst(cnd, imm, rb, ra);
                        ins = op_tst(cnd, imm, rb, ra);
                else if (!dollar)
                else if (!dollar)
                        ins = op_tst(cnd, ra);
                        ins = op_tst(cnd, ra);
                else
                else
                        ins = op_tst(cnd, imm, ra);
                        ins = op_tst(cnd, imm, ra);
        } else if (strcasecmp("MOV",opc)==0) {
        } else if (strcasecmp("MOV",opc)==0) {
                if ((rb != ZIP_Rnone)&&(ra != ZIP_Rnone))
                if ((rb != ZIP_Rnone)&&(ra != ZIP_Rnone))
                        ins = op_mov(cnd, imm, rb, ra);
                        ins = op_mov(cnd, imm, rb, ra);
                else    { printf("ERR MOV, ra = %d, rb = %d, imm = %d, cnd = %d\nLine was: %s", (int)ra, (int)rb, (int)imm, (int)cnd, line); valid = false; }
                else    { printf("ERR MOV, ra = %d, rb = %d, imm = %d, cnd = %d\nLine was: %s", (int)ra, (int)rb, (int)imm, (int)cnd, line); valid = false; }
        } else if (strcasecmp("LDI",opc)==0) {
        } else if (strcasecmp("LDI",opc)==0) {
                if ((rb == ZIP_Rnone)&&(cnd == ZIPC_ALWAYS))
                if ((rb == ZIP_Rnone)&&(cnd == ZIPC_ALWAYS))
                        ins = op_ldi(imm, ra);
                        ins = op_ldi(imm, ra);
                else    valid = false;
                else    valid = false;
        } else if (strcasecmp("trap",opc)==0) {
        } else if (strcasecmp("trap",opc)==0) {
                if ((rb == ZIP_Rnone)&&(rb == ZIP_Rnone))
                if ((rb == ZIP_Rnone)&&(rb == ZIP_Rnone))
                        ins = op_trap(cnd, imm);
                        ins = op_trap(cnd, imm);
                else
                else
                        valid = false;
                        valid = false;
        } else if (strcasecmp("CLR",opc)==0) {
        } else if (strcasecmp("CLR",opc)==0) {
                if ((ra == ZIP_Rnone)&&(!dollar)&&(cnd == ZIPC_ALWAYS))
                if ((ra == ZIP_Rnone)&&(!dollar)&&(cnd == ZIPC_ALWAYS))
                        ins = op_clr(rb);       // Good
                        ins = op_clr(rb);       // Good
                else    valid = false;
                else    valid = false;
        } else if ((strcasecmp("NOOP",opc)==0)||(strcasecmp("NOP",opc)==0)) {
        } else if ((strcasecmp("NOOP",opc)==0)||(strcasecmp("NOP",opc)==0)) {
                if ((rb == ZIP_Rnone)&&(ra == ZIP_Rnone)&&(!dollar)&&(cnd == ZIPC_ALWAYS))
                if ((rb == ZIP_Rnone)&&(ra == ZIP_Rnone)&&(!dollar)&&(cnd == ZIPC_ALWAYS))
                        ins = op_noop();
                        ins = op_noop();
                else    { printf("ERR: NOP, ra=%d, rb=%d, dollar = %s\n",
                else    { printf("ERR: NOP, ra=%d, rb=%d, dollar = %s\n",
                                (int)ra, (int)rb, (dollar)?"true":"false"); valid = false; }
                                (int)ra, (int)rb, (dollar)?"true":"false"); valid = false; }
        } else if ((strcasecmp("BREAK",opc)==0)||(strcasecmp("BRK",opc)==0)) {
        } else if ((strcasecmp("BREAK",opc)==0)||(strcasecmp("BRK",opc)==0)) {
                if ((rb == ZIP_Rnone)&&(ra == ZIP_Rnone)&&(!dollar)&&(cnd == ZIPC_ALWAYS))
                if ((rb == ZIP_Rnone)&&(ra == ZIP_Rnone)&&(!dollar)&&(cnd == ZIPC_ALWAYS))
                        ins = op_break();
                        ins = op_break();
                else    { printf("ERR: BRK, ra=%d, rb=%d, dollar = %s\n",
                else    { printf("ERR: BRK, ra=%d, rb=%d, dollar = %s\n",
                                (int)ra, (int)rb, (dollar)?"true":"false"); valid = false; }
                                (int)ra, (int)rb, (dollar)?"true":"false"); valid = false; }
        } else if ((strcasecmp("LDIHI",opc)==0)||(strcasecmp("LODIHI",opc)==0)) {
        } else if ((strcasecmp("LDIHI",opc)==0)||(strcasecmp("LODIHI",opc)==0)) {
                if ((dollar)&&(ra != ZIP_Rnone))
                if ((dollar)&&(ra != ZIP_Rnone))
                        ins = op_ldihi(cnd, imm, ra);
                        ins = op_ldihi(cnd, imm, ra);
                else    valid = false;
                else    valid = false;
        } else if ((strcasecmp("LDILO",opc)==0)||(strcasecmp("LODILO",opc)==0)){
        } else if ((strcasecmp("LDILO",opc)==0)||(strcasecmp("LODILO",opc)==0)){
                if ((dollar)&&(ra != ZIP_Rnone))
                if ((dollar)&&(ra != ZIP_Rnone))
                        ins = op_ldilo(cnd, imm, ra);
                        ins = op_ldilo(cnd, imm, ra);
                else    valid = false;
                else    valid = false;
        } else if ((strcasecmp("LOD",opc)==0)||(strcasecmp("LOAD",opc)==0)) {
        } else if ((strcasecmp("LOD",opc)==0)||(strcasecmp("LOAD",opc)==0)) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_lod(cnd,imm,rb,ra);
                        ins = op_lod(cnd,imm,rb,ra);
                else    ins = op_lod(cnd,imm,ra);
                else    ins = op_lod(cnd,imm,ra);
        } else if ((strcasecmp("STO",opc)==0)||(strcasecmp("STOR",opc)==0)) {
        } else if ((strcasecmp("STO",opc)==0)||(strcasecmp("STOR",opc)==0)) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_sto(cnd,rb,imm,ra);
                        ins = op_sto(cnd,rb,imm,ra);
                else    ins = op_sto(cnd,rb,imm);
                else    ins = op_sto(cnd,rb,imm);
        } else if (strcasecmp("SUB",opc)==0) {
        } else if (strcasecmp("SUB",opc)==0) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_sub(cnd,imm,rb,ra);
                        ins = op_sub(cnd,imm,rb,ra);
                else    ins = op_sub(cnd,imm,ra);
                else    ins = op_sub(cnd,imm,ra);
        } else if (strcasecmp("AND",opc)==0) {
        } else if (strcasecmp("AND",opc)==0) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_and(cnd,imm,rb,ra);
                        ins = op_and(cnd,imm,rb,ra);
                else    ins = op_and(cnd,imm,ra);
                else    ins = op_and(cnd,imm,ra);
        } else if (strcasecmp("ADD",opc)==0) {
        } else if (strcasecmp("ADD",opc)==0) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_add(cnd,imm,rb,ra);
                        ins = op_add(cnd,imm,rb,ra);
                else    ins = op_add(cnd,imm,ra);
                else    ins = op_add(cnd,imm,ra);
        } else if (strcasecmp("OR",opc)==0) {
        } else if (strcasecmp("OR",opc)==0) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_or(cnd,imm,rb,ra);
                        ins = op_or(cnd,imm,rb,ra);
                else    ins = op_or(cnd,imm,ra);
                else    ins = op_or(cnd,imm,ra);
        } else if (strcasecmp("XOR",opc)==0) {
        } else if (strcasecmp("XOR",opc)==0) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_xor(cnd,imm,rb,ra);
                        ins = op_xor(cnd,imm,rb,ra);
                else    ins = op_xor(cnd,imm,ra);
                else    ins = op_xor(cnd,imm,ra);
        } else if ((strcasecmp("LSL",opc)==0)||(strcasecmp("ASL",opc)==0)) {
        } else if ((strcasecmp("LSL",opc)==0)||(strcasecmp("ASL",opc)==0)) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_lsl(cnd,imm,rb,ra);
                        ins = op_lsl(cnd,imm,rb,ra);
                else    ins = op_lsl(cnd,imm,ra);
                else    ins = op_lsl(cnd,imm,ra);
        } else if (strcasecmp("ASR",opc)==0) {
        } else if (strcasecmp("ASR",opc)==0) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_asr(cnd,imm,rb,ra);
                        ins = op_asr(cnd,imm,rb,ra);
                else    ins = op_asr(cnd,imm,ra);
                else    ins = op_asr(cnd,imm,ra);
        } else if (strcasecmp("LSR",opc)==0) {
        } else if (strcasecmp("LSR",opc)==0) {
                if (rb != ZIP_Rnone)
                if (rb != ZIP_Rnone)
                        ins = op_lsr(cnd,imm,rb,ra);
                        ins = op_lsr(cnd,imm,rb,ra);
                else    ins = op_lsr(cnd,imm,ra);
                else    ins = op_lsr(cnd,imm,ra);
        } else if (strcasecmp("BR",opc)==0) {
        } else if (strcasecmp("BR",opc)==0) {
                if ((dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone))
                if ((dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone))
                        valid = false;
                        valid = false;
                else ins = op_bra(cnd, imm);
                else ins = op_bra(cnd, imm);
        } else if (strcasecmp("BRA",opc)==0) {
        } else if (strcasecmp("BRA",opc)==0) {
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                        valid = false;
                        valid = false;
                else ins = op_bra(imm);
                else ins = op_bra(imm);
        } else if (strcasecmp("BRZ",opc)==0) {
        } else if (strcasecmp("BRZ",opc)==0) {
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                        valid = false;
                        valid = false;
                else ins = op_brz(imm);
                else ins = op_brz(imm);
        } else if ((strcasecmp("BRNZ",opc)==0)||(strcasecmp("BNZ",opc)==0)) {
        } else if ((strcasecmp("BRNZ",opc)==0)||(strcasecmp("BNZ",opc)==0)) {
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                        valid = false;
                        valid = false;
                else ins = op_bnz(imm);
                else ins = op_bnz(imm);
        } else if ((strcasecmp("BRGE",opc)==0)||(strcasecmp("BGE",opc)==0)) {
        } else if ((strcasecmp("BRGE",opc)==0)||(strcasecmp("BGE",opc)==0)) {
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                        valid = false;
                        valid = false;
                else ins = op_bge(imm);
                else ins = op_bge(imm);
        } else if ((strcasecmp("BRGT",opc)==0)||(strcasecmp("BGT",opc)==0)) {
        } else if ((strcasecmp("BRGT",opc)==0)||(strcasecmp("BGT",opc)==0)) {
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                        valid = false;
                        valid = false;
                else ins = op_bgt(imm);
                else ins = op_bgt(imm);
        } else if (strcasecmp("BRZ",opc)==0) {
        } else if (strcasecmp("BRZ",opc)==0) {
        } else if ((strcasecmp("BRLT",opc)==0)||(strcasecmp("BLT",opc)==0)) {
        } else if ((strcasecmp("BRLT",opc)==0)||(strcasecmp("BLT",opc)==0)) {
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                        valid = false;
                        valid = false;
                else ins = op_blt(imm);
                else ins = op_blt(imm);
        } else if ((strcasecmp("BRC",opc)==0)||(strcasecmp("BC",opc)==0)) {
        } else if ((strcasecmp("BRC",opc)==0)||(strcasecmp("BC",opc)==0)) {
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                        valid = false;
                        valid = false;
                else ins = op_brc(imm);
                else ins = op_brc(imm);
        } else if ((strcasecmp("BRV",opc)==0)||(strcasecmp("BV",opc)==0)) {
        } else if ((strcasecmp("BRV",opc)==0)||(strcasecmp("BV",opc)==0)) {
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                if ((!dollar)||(ra != ZIP_Rnone)||(rb != ZIP_Rnone)||(cnd != ZIPC_ALWAYS))
                        valid = false;
                        valid = false;
                else ins = op_brv(imm);
                else ins = op_brv(imm);
        } else if (strcasecmp("CLRF",opc)==0) {
        } else if (strcasecmp("CLRF",opc)==0) {
                if ((ra == ZIP_Rnone)&&(!dollar)&&(imm==0))
                if ((ra == ZIP_Rnone)&&(!dollar)&&(imm==0))
                        ins = op_clrf(cnd, rb);
                        ins = op_clrf(cnd, rb);
                else    valid = false;
                else    valid = false;
        } else if((strcasecmp("HALT",opc)==0)||(strcasecmp("WAIT",opc)==0)) {
        } else if((strcasecmp("HALT",opc)==0)||(strcasecmp("WAIT",opc)==0)) {
                if ((rb == ZIP_Rnone)&&(ra==ZIP_Rnone)&&(!comma)&&(!dollar))
                if ((rb == ZIP_Rnone)&&(ra==ZIP_Rnone)&&(!comma)&&(!dollar))
                        ins = op_halt(cnd);
                        ins = op_halt(cnd);
                else    valid = false;
                else    valid = false;
        } else if (strcasecmp("BUSY",opc)==0) {
        } else if (strcasecmp("BUSY",opc)==0) {
                if ((rb == ZIP_Rnone)&&(ra==ZIP_Rnone)&&(!comma)&&(!dollar))
                if ((rb == ZIP_Rnone)&&(ra==ZIP_Rnone)&&(!comma)&&(!dollar))
                        ins = op_busy(cnd);
                        ins = op_busy(cnd);
                else    valid = false;
                else    valid = false;
        } else if (strcasecmp("RTU",opc)==0) {
        } else if (strcasecmp("RTU",opc)==0) {
                if ((rb == ZIP_Rnone)&&(ra==ZIP_Rnone)&&(imm==0)&&(!comma)&&(!dollar))
                if ((rb == ZIP_Rnone)&&(ra==ZIP_Rnone)&&(imm==0)&&(!comma)&&(!dollar))
                        ins = op_rtu(cnd);
                        ins = op_rtu(cnd);
                else    { printf("ERRR,RTU, ra=%d,rb=%d,imm=%08x,comma=%s,dollar=%s\n",
                else    { printf("ERRR,RTU, ra=%d,rb=%d,imm=%08x,comma=%s,dollar=%s\n",
                                (int)ra, (int)rb, imm, (comma)?"true":"false",
                                (int)ra, (int)rb, imm, (comma)?"true":"false",
                                (dollar)?"true":"false");
                                (dollar)?"true":"false");
                        valid = false;
                        valid = false;
                }
                }
        } else if (strcasecmp("JMP",opc)==0) {
        } else if (strcasecmp("JMP",opc)==0) {
                if ((rb != ZIP_Rnone)&&(!comma))
                if ((rb != ZIP_Rnone)&&(!comma))
                        ins = op_not(cnd, rb);
                        ins = op_not(cnd, rb);
                else    valid = false;
                else    valid = false;
        } else if (strcasecmp("NOT",opc)==0) {
        } else if (strcasecmp("NOT",opc)==0) {
                if ((rb != ZIP_Rnone)&&(ra==ZIP_Rnone)&&(!comma)&&(!dollar))
                if ((rb != ZIP_Rnone)&&(ra==ZIP_Rnone)&&(!comma)&&(!dollar))
                        ins = op_not(cnd, rb);
                        ins = op_not(cnd, rb);
                else    valid = false;
                else    valid = false;
        } else  valid = false;
        } else  valid = false;
 
 
        return valid;
        return valid;
}
}
 
 
bool    ZPARSER::parse(const char *line, ZPARSER::ZIPA &pc, ZPARSER::ZIPI &instruction, const unsigned int lineno) {
bool    ZPARSER::parse(const char *line, ZPARSER::ZIPA &pc, ZPARSER::ZIPI &instruction, const unsigned int lineno) {
        bool    v = parse_op(line, pc, instruction, lineno);
        bool    v = parse_op(line, pc, instruction, lineno);
        pc = pc + 1;
        pc = pc + 1;
        return v;
        return v;
}
}
 
 
#define IMMOP(OP,CND,IMM,A) (((OP&0x0f)<<28)|((A&0x0f)<<24)|((CND&0x07)<<21) \
#define IMMOP(OP,CND,IMM,A) (((OP&0x0f)<<28)|((A&0x0f)<<24)|((CND&0x07)<<21) \
                        | (IMM & 0x0fffff))
                        | (IMM & 0x0fffff))
 
 
#define DBLREGOP(OP,CND,IMM,B,A) (((OP&0x0f)<<28)|((A&0x0f)<<24)        \
#define DBLREGOP(OP,CND,IMM,B,A) (((OP&0x0f)<<28)|((A&0x0f)<<24)        \
                        |((CND&0x07)<<21)|(1<<20)|((B&0x0f)<<16)         \
                        |((CND&0x07)<<21)|(1<<20)|((B&0x0f)<<16)         \
                        | (IMM & 0x0ffff))
                        | (IMM & 0x0ffff))
 
 
ZIPI    ZPARSER::op_cmp(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_cmp(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0x0, cnd, imm, b, a);
        return DBLREGOP(0x0, cnd, imm, b, a);
}
}
 
 
ZIPI    ZPARSER::op_cmp(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
ZIPI    ZPARSER::op_cmp(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0x0, cnd, imm, a);
        return IMMOP(0x0, cnd, imm, a);
}
}
 
 
 
 
ZIPI    ZPARSER::op_tst(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_tst(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0x1, cnd, imm, b, a);
        return DBLREGOP(0x1, cnd, imm, b, a);
} ZIPI  ZPARSER::op_tst(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_tst(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0x1, cnd, imm, a);
        return IMMOP(0x1, cnd, imm, a);
}
}
 
 
ZIPI    ZPARSER::op_mov(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_mov(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        ZIPI    in;
        ZIPI    in;
        in = (0x02 << 28)|((a&0x0f)<<24)|((cnd&0x07)<<21);
        in = (0x02 << 28)|((a&0x0f)<<24)|((cnd&0x07)<<21);
        in |= (a&0x10)<<16;
        in |= (a&0x10)<<16;
        in |= (b&0x0f)<<16;
        in |= (b&0x0f)<<16;
        in |= (b&0x10)<<11;
        in |= (b&0x10)<<11;
        in |= imm & 0x07fff;
        in |= imm & 0x07fff;
        return in;
        return in;
}
}
 
 
 
 
ZIPI    ZPARSER::op_ldi(ZIPIMM imm, ZIPREG a) const {
ZIPI    ZPARSER::op_ldi(ZIPIMM imm, ZIPREG a) const {
        ZIPI    in;
        ZIPI    in;
        in = ((0x03)<<28) | ((a&0x0f)<<24) | (imm & ((1<<24)-1));
        in = ((0x03)<<28) | ((a&0x0f)<<24) | (imm & ((1<<24)-1));
        return in;
        return in;
}
}
 
 
ZIPI    ZPARSER::op_trap(ZIPCOND cnd, ZIPIMM imm) const {
ZIPI    ZPARSER::op_trap(ZIPCOND cnd, ZIPIMM imm) const {
        ZIPI    in;
        ZIPI    in;
        in  = ((0x4f)<<24)|((cnd&0x07)<<21)|(1<<20)|((0x0e)<<16);
        in  = ((0x4f)<<24)|((cnd&0x07)<<21)|(1<<20)|((0x0e)<<16);
        in |= (imm & 0x0ffff);
        in |= (imm & 0x0ffff);
        return in;
        return in;
}
}
 
 
ZIPI    ZPARSER::op_noop(void) const {
ZIPI    ZPARSER::op_noop(void) const {
        return 0x4e000000;
        return 0x4e000000;
}
}
ZIPI    ZPARSER::op_break(void) const {
ZIPI    ZPARSER::op_break(void) const {
        return 0x4e000001;
        return 0x4e000001;
}
}
 
 
ZIPI    ZPARSER::op_ldihi(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
ZIPI    ZPARSER::op_ldihi(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        ZIPI    in;
        ZIPI    in;
        in  = ((0x4f)<<24)|((cnd&0x07)<<21)|(1<<20)|((a&0x0f)<<16);
        in  = ((0x4f)<<24)|((cnd&0x07)<<21)|(1<<20)|((a&0x0f)<<16);
        in |= (imm & 0x0ffff);
        in |= (imm & 0x0ffff);
        return in;
        return in;
}
}
ZIPI    ZPARSER::op_ldilo(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
ZIPI    ZPARSER::op_ldilo(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        ZIPI    in;
        ZIPI    in;
        in  = ((0x4f)<<24)|((cnd&0x07)<<21)|(0<<20)|((a&0x0f)<<16);
        in  = ((0x4f)<<24)|((cnd&0x07)<<21)|(0<<20)|((a&0x0f)<<16);
        in |= (imm & 0x0ffff);
        in |= (imm & 0x0ffff);
        return in;
        return in;
}
}
 
 
ZIPI    ZPARSER::op_lod(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_mpy(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0x6, cnd, imm, b, a);
        return DBLREGOP(0x4, cnd, imm, b, a);
 
} ZIPI  ZPARSER::op_mpy(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
 
        return IMMOP(0x4, cnd, imm, a);
 
}
 
 
 
ZIPI    ZPARSER::op_rol(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
 
        return DBLREGOP(0x5, cnd, imm, b, a);
 
} ZIPI  ZPARSER::op_rol(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
 
        return IMMOP(0x5, cnd, imm, a);
}
}
 
 
ZIPI    ZPARSER::op_lod(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
ZIPI    ZPARSER::op_lod(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
 
        return DBLREGOP(0x6, cnd, imm, b, a);
 
} ZIPI  ZPARSER::op_lod(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0x6, cnd, imm, a);
        return IMMOP(0x6, cnd, imm, a);
}
}
 
 
 
 
ZIPI    ZPARSER::op_sto(ZIPCOND cnd, ZIPREG v, ZIPIMM imm, ZIPREG b) const {
ZIPI    ZPARSER::op_sto(ZIPCOND cnd, ZIPREG v, ZIPIMM imm, ZIPREG b) const {
        return DBLREGOP(0x7, cnd, imm, b, v);
        return DBLREGOP(0x7, cnd, imm, b, v);
} ZIPI  ZPARSER::op_sto(ZIPCOND cnd, ZIPREG v, ZIPIMM imm) const {
} ZIPI  ZPARSER::op_sto(ZIPCOND cnd, ZIPREG v, ZIPIMM imm) const {
        return IMMOP(0x7, cnd, imm, v);
        return IMMOP(0x7, cnd, imm, v);
}
}
 
 
 
 
ZIPI    ZPARSER::op_sub(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_sub(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0x8, cnd, imm, b, a);
        return DBLREGOP(0x8, cnd, imm, b, a);
} ZIPI  ZPARSER::op_sub(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_sub(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0x8, cnd, imm, a);
        return IMMOP(0x8, cnd, imm, a);
}
}
 
 
 
 
ZIPI    ZPARSER::op_and(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_and(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0x9, cnd, imm, b, a);
        return DBLREGOP(0x9, cnd, imm, b, a);
} ZIPI  ZPARSER::op_and(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_and(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0x9, cnd, imm, a);
        return IMMOP(0x9, cnd, imm, a);
}
}
 
 
 
 
ZIPI    ZPARSER::op_add(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_add(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0xa, cnd, imm, b, a);
        return DBLREGOP(0xa, cnd, imm, b, a);
} ZIPI  ZPARSER::op_add(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_add(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0xa, cnd, imm, a);
        return IMMOP(0xa, cnd, imm, a);
}
}
 
 
 
 
ZIPI    ZPARSER::op_or(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_or(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0xb, cnd, imm, b, a);
        return DBLREGOP(0xb, cnd, imm, b, a);
} ZIPI  ZPARSER::op_or(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_or(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0xb, cnd, imm, a);
        return IMMOP(0xb, cnd, imm, a);
}
}
 
 
ZIPI    ZPARSER::op_xor(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_xor(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0xc, cnd, imm, b, a);
        return DBLREGOP(0xc, cnd, imm, b, a);
} ZIPI  ZPARSER::op_xor(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_xor(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0xc, cnd, imm, a);
        return IMMOP(0xc, cnd, imm, a);
}
}
 
 
ZIPI    ZPARSER::op_lsl(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_lsl(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0xd, cnd, imm, b, a);
        return DBLREGOP(0xd, cnd, imm, b, a);
} ZIPI  ZPARSER::op_lsl(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_lsl(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0xd, cnd, imm, a);
        return IMMOP(0xd, cnd, imm, a);
}
}
 
 
ZIPI    ZPARSER::op_asr(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_asr(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0xe, cnd, imm, b, a);
        return DBLREGOP(0xe, cnd, imm, b, a);
} ZIPI  ZPARSER::op_asr(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_asr(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0xe, cnd, imm, a);
        return IMMOP(0xe, cnd, imm, a);
}
}
 
 
ZIPI    ZPARSER::op_lsr(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
ZIPI    ZPARSER::op_lsr(ZIPCOND cnd, ZIPIMM imm, ZIPREG b, ZIPREG a) const {
        return DBLREGOP(0xf, cnd, imm, b, a);
        return DBLREGOP(0xf, cnd, imm, b, a);
} ZIPI  ZPARSER::op_lsr(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
} ZIPI  ZPARSER::op_lsr(ZIPCOND cnd, ZIPIMM imm, ZIPREG a) const {
        return IMMOP(0xf, cnd, imm, a);
        return IMMOP(0xf, cnd, imm, a);
}
}
 
 
 
 

powered by: WebSVN 2.1.0

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