public void highlightCode()
    {

        currentCode = (String) ASCView.getMemoryTable().getValueAt(programCounter, 0);

        ASCView.getMnemonicPane().clearSelection();
        ASCView.getMnemonicPane().setSelectedIndex(tracker);
        
        ASCView.getHexPane().clearSelection();
        ASCView.getHexPane().setSelectedIndex(tracker2);

        

        /**
         * This piece of code makes sure the correct value is highlighted when
         * the instruction uses indexed addressing.
         */
        int numIndex = 0;
        int valueOfIndex = 0;
        try {
            if (Integer.parseInt(currentCode.substring(0, 1), 16) >= 1 && Integer.parseInt(currentCode.substring(0, 1), 16) <= 3) {
                numIndex = Integer.parseInt(currentCode.substring(1, 2), 16);
                if (numIndex == 1) {
                    valueOfIndex = Integer.parseInt(ASCView.getIndex1(), 16);
                } else if (numIndex == 2) {
                    valueOfIndex = Integer.parseInt(ASCView.getIndex2(), 16);
                } else if (numIndex == 3) {
                    valueOfIndex = Integer.parseInt(ASCView.getIndex3(), 16);
                }
            }
        } catch (Exception e) {
        }

        // Makes sure correct code is highlighted when indirect addressing is used.
        int next = 0;
        int location;
        if (currentCode.substring(2).contains("*")) {
            location = Integer.parseInt(currentCode.substring(2, 4), 16);
            next = Integer.parseInt((String) ASCView.getMemoryTable().getValueAt(location, 0), 16) + valueOfIndex;
        } else {
            next = Integer.parseInt(currentCode.substring(2), 16) + valueOfIndex;
        }

        if (next == 0) {
            ASCView.getMemoryTable().clearSelection();
            return;
        }

        ASCView.getMemoryTable().clearSelection();
        ASCView.getMemoryTable().addColumnSelectionInterval(0, 0);
        ASCView.getMemoryTable().addRowSelectionInterval(next, next);
        ASCView.getMemoryTable().scrollRectToVisible(new Rectangle(ASCView.getMemoryTable().getCellRect(next, 0, true)));
    }