private int getRegIndex(String regName) {
        if (regName.equals("000")) {
            return 0;
        } else if (regName.equals("001")) {
            return 1;
        } else if (regName.equals("010")) {
            return 2;
        } else if (regName.equals("011")) {
            return 3;
        } else if (regName.equals("100")) {
            return 4;
        } else if (regName.equals("101")) {
            return 5;
        } else if (regName.equals("110")) {
            return 6;
        } else if (regName.equals("111")) {
            return 7;
        } else {
            return 0;
        }
    }