--- gddd/ddd/ddd.C	2013-05-17 19:55:05.000000000 +0200
+++ gddd/ddd/ddd.C	2013-05-31 18:31:52.456084222 +0200
@@ -415,10 +415,12 @@
 #if defined(IF_XM)
 // Preferences
 static void make_preferences (Widget parent);
+static void make_regspref(Widget parent);
 static void dddPopupPreferencesCB (Widget, XtPointer, XtPointer);
 #else
 // Preferences
 static void make_preferences (GUI::Widget *parent);
+static void make_regspref(GUI::Widget *parent);
 static void dddPopupPreferencesCB (void);
 #endif
 
@@ -1689,10 +1691,141 @@
     MMEnd
 };
 
+//buttons for the register window
 #if defined(IF_XM)
+
+static Widget xmmDsply_w[9];
+static Widget RegDisable_w[16];
+static Widget xRegDisable_w[8];
+static Widget mmDsply_w[6];
+
+static MMDesc register1_menu [] = 
+{
+	{"None",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(0)},0,&xmmDsply_w[0],0,0},
+	{"Float",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(1)},0,&xmmDsply_w[1],0,0},
+	{"Double",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(2)},0,&xmmDsply_w[2],0,0},
+	{"8 Bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(3)},0,&xmmDsply_w[3],0,0},
+	{"16 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(4)},0,&xmmDsply_w[4],0,0},
+	{"32 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(5)},0,&xmmDsply_w[5],0,0},
+	{"64 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(6)},0,&xmmDsply_w[6],0,0},
+	{"128 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(7)},0,&xmmDsply_w[7],0,0},
+	{"256 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(8)},0,&xmmDsply_w[8],0,0},
+ 	MMEnd
+};
+
+static MMDesc disableReg1_menu [] = 
+{
+	{"ax",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(15)},0,&RegDisable_w[0],0,0},
+	{"bx",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(16)},0,&RegDisable_w[1],0,0},
+	{"cx",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(17)},0,&RegDisable_w[2],0,0},
+	{"dx",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(18)},0,&RegDisable_w[3],0,0},
+	{"si",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(19)},0,&RegDisable_w[4],0,0},
+	{"di",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(20)},0,&RegDisable_w[5],0,0},
+	{"bp",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(21)},0,&RegDisable_w[6],0,0},
+	{"sp",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(22)},0,&RegDisable_w[7],0,0},
+	{"r8",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(23)},0,&RegDisable_w[8],0,0},
+	{"r9",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(24)},0,&RegDisable_w[9],0,0},
+	{"r10",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(25)},0,&RegDisable_w[10],0,0},
+	{"r11",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(26)},0,&RegDisable_w[11],0,0},
+	{"r12",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(27)},0,&RegDisable_w[12],0,0},
+	{"r13",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(28)},0,&RegDisable_w[13],0,0},
+	{"r14",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(29)},0,&RegDisable_w[14],0,0},
+	{"r15",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(30)},0,&RegDisable_w[15],0,0},
+ 	MMEnd
+};
+
+static MMDesc xdisableReg1_menu [] = 
+{
+	{"ip",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(31)},0,&xRegDisable_w[0],0,0},
+	{"flags",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(32)},0,&xRegDisable_w[1],0,0},
+	{"cs",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(33)},0,&xRegDisable_w[2],0,0},
+	{"ss",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(34)},0,&xRegDisable_w[3],0,0},
+	{"ds",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(35)},0,&xRegDisable_w[4],0,0},
+	{"es",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(36)},0,&xRegDisable_w[5],0,0},
+	{"fs",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(37)},0,&xRegDisable_w[6],0,0},
+	{"gs",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(38)},0,&xRegDisable_w[7],0,0},
+ 	MMEnd
+};
+
+static MMDesc register3_menu[] = 
+{
+	{"None",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(9)},0,&mmDsply_w[0],0,0},
+	{"FP Reg",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(10)}, 0,&mmDsply_w[1],0,0},
+	{"8 Bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(11)}, 0,&mmDsply_w[2],0,0},
+	{"16 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(12)},0,&mmDsply_w[3],0,0},
+	{"32 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(13)},0,&mmDsply_w[4],0,0},
+	{"64 bit",MMToggle,{dddToggleRegisterButtonsCB,XtPointer(14)},0,&mmDsply_w[5],0,0},
+   MMEnd
+};
+
 static Widget value_tips_w;
 static Widget value_docs_w;
 #else
+
+static GUI::RadioButton *xmmDsply_w[9];
+static GUI::RadioButton *RegDisable_w[16];
+static GUI::RadioButton *xRegDisable_w[8];
+static GUI::RadioButton *mmDsply_w[6];
+
+static MMDesc register1_menu [] = 
+{
+	GENTRYL("None", N_("None"),MMRadio,BIND(dddToggleRegisterButtonsCB,0), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),0),0,&xmmDsply_w[0]),
+	GENTRYL("Float", N_("Float"),MMRadio,BIND(dddToggleRegisterButtonsCB,1),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),1),0,&xmmDsply_w[1]),
+	GENTRYL("Double", N_("Double"),MMRadio,BIND(dddToggleRegisterButtonsCB,2),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),2),0,&xmmDsply_w[2]),
+	GENTRYL("8 Bit", N_("8 Bit"),MMRadio,BIND(dddToggleRegisterButtonsCB,3),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),3),0,&xmmDsply_w[3]),
+	GENTRYL("16 Bit", N_("16 Bit"),MMRadio,BIND(dddToggleRegisterButtonsCB,4),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),4),0,&xmmDsply_w[4]),
+	GENTRYL("32 Bit", N_("32 Bit"),MMRadio,BIND(dddToggleRegisterButtonsCB,5),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),5),0,&xmmDsply_w[5]),
+	GENTRYL("64 Bit", N_("64 Bit"),MMRadio,BIND(dddToggleRegisterButtonsCB,6),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),6),0,&xmmDsply_w[6]),
+	GENTRYL("128 Bit", N_("128 Bit"),MMRadio,BIND(dddToggleRegisterButtonsCB,7),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),7),0,&xmmDsply_w[7]),
+	GENTRYL("256 Bit", N_("256 Bit"),MMRadio,BIND(dddToggleRegisterButtonsCB,8),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),8),0,&xmmDsply_w[8]),
+ 	MMEnd
+};
+
+static MMDesc register3_menu[] = 
+{
+	GENTRYL("None", N_("None"),MMRadio,BIND(dddToggleRegisterButtonsCB,9), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),9),0,&mmDsply_w[0]),
+	GENTRYL("FP Reg", N_("FP Reg"),MMRadio,BIND(dddToggleRegisterButtonsCB,10),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),10),0,&mmDsply_w[1]),
+	GENTRYL("8 Bit", N_("8 Bit"),MMRadio,BIND(dddToggleRegisterButtonsCB,11),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),11),0,&mmDsply_w[2]),
+	GENTRYL("16 Bit", N_("16 Bit"),MMRadio,BIND(dddToggleRegisterButtonsCB,12),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),12),0,&mmDsply_w[3]),
+	GENTRYL("32 Bit", N_("32 Bit"),MMRadio,BIND(dddToggleRegisterButtonsCB,13),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),13),0,&mmDsply_w[4]),
+	GENTRYL("64 Bit", N_("64 Bit"),MMRadio,BIND(dddToggleRegisterButtonsCB,14),sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),14),0,&mmDsply_w[5]),
+   MMEnd
+};
+
+static MMDesc disableReg1_menu [] = 
+{
+	GENTRYL("ax", N_("ax"),MMToggle,BIND(dddToggleRegisterButtonsCB,15), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),15),0,&RegDisable_w[0]),
+	GENTRYL("bx", N_("bx"),MMToggle,BIND(dddToggleRegisterButtonsCB,16), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),16),0,&RegDisable_w[1]),
+	GENTRYL("cx", N_("cx"),MMToggle,BIND(dddToggleRegisterButtonsCB,17), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),17),0,&RegDisable_w[2]),
+	GENTRYL("dx", N_("dx"),MMToggle,BIND(dddToggleRegisterButtonsCB,18), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),18),0,&RegDisable_w[3]),
+	GENTRYL("si", N_("si"),MMToggle,BIND(dddToggleRegisterButtonsCB,19), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),19),0,&RegDisable_w[4]),
+	GENTRYL("di", N_("di"),MMToggle,BIND(dddToggleRegisterButtonsCB,20), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),20),0,&RegDisable_w[5]),
+	GENTRYL("bp", N_("bp"),MMToggle,BIND(dddToggleRegisterButtonsCB,21), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),21),0,&RegDisable_w[6]),
+	GENTRYL("sp", N_("sp"),MMToggle,BIND(dddToggleRegisterButtonsCB,22), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),22),0,&RegDisable_w[7]),
+	GENTRYL("r8", N_("r8"),MMToggle,BIND(dddToggleRegisterButtonsCB,23), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),23),0,&RegDisable_w[8]),
+	GENTRYL("r9", N_("r9"),MMToggle,BIND(dddToggleRegisterButtonsCB,24), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),24),0,&RegDisable_w[9]),
+	GENTRYL("r10", N_("r10"),MMToggle,BIND(dddToggleRegisterButtonsCB,25), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),25),0,&RegDisable_w[10]),
+	GENTRYL("r11", N_("r11"),MMToggle,BIND(dddToggleRegisterButtonsCB,26), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),26),0,&RegDisable_w[11]),
+	GENTRYL("r12", N_("r12"),MMToggle,BIND(dddToggleRegisterButtonsCB,27), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),27),0,&RegDisable_w[12]),
+ 	MMEnd
+};
+
+static MMDesc xdisableReg1_menu [] = 
+{
+	GENTRYL("r13", N_("r13"),MMToggle,BIND(dddToggleRegisterButtonsCB,28), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),28),0,&RegDisable_w[13]),
+	GENTRYL("r14", N_("r14"),MMToggle,BIND(dddToggleRegisterButtonsCB,29), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),29),0,&RegDisable_w[14]),
+	GENTRYL("r15", N_("r15"),MMToggle,BIND(dddToggleRegisterButtonsCB,30), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),30),0,&RegDisable_w[15]),
+	GENTRYL("ip", N_("ip"),MMToggle,BIND(dddToggleRegisterButtonsCB,31), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),31),0,&xRegDisable_w[0]),
+	GENTRYL("flags", N_("flags"),MMToggle,BIND(dddToggleRegisterButtonsCB,32), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),32),0,&xRegDisable_w[1]),
+	GENTRYL("cs", N_("cs"),MMToggle,BIND(dddToggleRegisterButtonsCB,33), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),33),0,&xRegDisable_w[2]),
+	GENTRYL("ss", N_("ss"),MMToggle,BIND(dddToggleRegisterButtonsCB,34), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),34),0,&xRegDisable_w[3]),
+	GENTRYL("ds", N_("ds"),MMToggle,BIND(dddToggleRegisterButtonsCB,35), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),35),0,&xRegDisable_w[4]),
+	GENTRYL("es", N_("es"),MMToggle,BIND(dddToggleRegisterButtonsCB,36), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),36),0,&xRegDisable_w[5]),
+	GENTRYL("fs", N_("fs"),MMToggle,BIND(dddToggleRegisterButtonsCB,37), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),37),0,&xRegDisable_w[6]),
+	GENTRYL("gs", N_("gs"),MMToggle,BIND(dddToggleRegisterButtonsCB,38), sigc::bind(sigc::retype(sigc::ptr_fun(dddToggleRegisterButtonsCB)),38),0,&xRegDisable_w[7]),
+ 	MMEnd
+};
+
 static GUI::CheckButton *value_tips_w;
 static GUI::CheckButton *value_docs_w;
 #endif
@@ -1799,9 +1932,40 @@
 
 // Source preferences
 #if defined(IF_XM)
+
+//pushbuttons for the register window
+static Widget PMMX_w;
+static Widget PXMM_w;
+static MMDesc register_preferenes_menu[] = 
+{
+   { "ALL MMX",MMPush,{dddToggleFPMMXButton,0},0,&PMMX_w,0,0},
+	{"MMX",MMRadioPanel,MMNoCB,register3_menu,0,0,0},
+   { "ALL XMM",MMPush,{dddToggleXMMButton,0},0,&PXMM_w,0,0},
+	{"XMM",MMRadioPanel,MMNoCB,register1_menu,0,0,0},
+	MMSep,
+	{"MASK",MMButtonPanel,MMNoCB,disableReg1_menu,0,0,0},
+	{"XMASK",MMButtonPanel,MMNoCB,xdisableReg1_menu,0,0,0},
+	MMEnd
+};
+
 static Widget set_display_glyphs_w;
 static Widget set_display_text_w;
 #else
+static GUI::Button *PMMX_w;
+static GUI::Button *PXMM_w;
+
+static MMDesc register_preferenes_menu[] = 
+{
+   GENTRYL("ALL MMX", N_("ALL MMX"),MMPush,BIND(dddToggleFPMMXButton),sigc::retype(sigc::ptr_fun(dddToggleFPMMXButton)),0,&PMMX_w),
+   GENTRYL("MMX", N_("MMX"), MMRadioPanel,MMNoCB, MDUMMY,register3_menu, 0),
+   GENTRYL("ALL XMM", N_("ALL XMM"),MMPush,BIND(dddToggleXMMButton),sigc::retype(sigc::ptr_fun(dddToggleXMMButton)),0,&PXMM_w),
+   GENTRYL("XMM", N_("XMM"), MMRadioPanel,MMNoCB, MDUMMY,register1_menu, 0),
+	MMSep,
+   GENTRYL("MASK", N_("Mask"),MMButtonPanel,MMNoCB, MDUMMY,disableReg1_menu, 0),
+   GENTRYL("XMASK", N_("   "),MMButtonPanel,MMNoCB, MDUMMY,xdisableReg1_menu, 0),
+	MMEnd
+};
+
 static GUI::RadioButton *set_display_glyphs_w;
 static GUI::RadioButton *set_display_text_w;
 #endif
@@ -3844,7 +4008,74 @@
     source_view = new SourceView(source_view_parent);
     source_view->set_max_glyphs(app_data.max_glyphs);
     source_view->cache_glyph_images = app_data.cache_glyph_images;
+//-----------------------------------------------------------------------------
+// For new register display
+//-----------------------------------------------------------------------------
+
+	source_view->ProgramArch = -1;
+	source_view->RegsSaved = false;
+	source_view->xmregp = 0;
+	source_view->LastClicked = -1;
+	source_view->XmmSet = 0;
+	source_view->mmSet = 0;
+	strcpy(source_view->vfdblStr,"def vfdbl\ninf reg\n");
+	strcpy(source_view->fltStr,"ec \\nst0*\nou $st0\nec \\nst1*\nou $st1\nec \\nst2*\nou $st2\nec \\nst3*\nou $st3\nec \\nst4*\nou $st4\nec \\nst5*\nou $st5\nec \\nst6*\nou $st6\nec \\nst7*\nou $st7\n");
+	strcpy(source_view->fltstat,"ec \\nfctrl*\nou/x $fctrl\nec \\nfstat*\nou/x $fstat\nec \\nftag*\nou/x $ftag\nec \\nfiseg*\nou/x $fiseg\nec \\nfioff*\nou/x $fioff\nec \\nfoseg*\nou/x $foseg\nec \\nfooff*\nou/x $fooff\nec \\nfop*\nou/x $fop\n");
+	strcpy(source_view->mmx8x,"ec \\nmm0*\nou $mm0.v8_int8\n");
+	strcpy(source_view->mmx16x,"ec \\nmm0*\nou $mm0.v4_int16\n");
+	strcpy(source_view->mmx32x,"ec \\nmm0*\nou $mm0.v2_int32\n");
+	strcpy(source_view->mmx64x,"ec \\nmm0*\nou $mm0.uint64\n");
+	strcpy(source_view->xmmfloat,"ec \\nxmm0*\nou $xmm0.v4_float\n");
+	strcpy(source_view->xmmfloat10,"ec \\nxmm10*\nou $xmm10.v4_float\n");
+	strcpy(source_view->xmmdouble,"ec \\nxmm0*\nou $xmm0.v2_double\n");
+	strcpy(source_view->xmmdouble10,"ec \\nxmm10*\nou $xmm10.v2_double\n");
+	strcpy(source_view->xmmint8,"ec \\nxmm0*\nou $xmm0.v16_int8\n");
+	strcpy(source_view->xmmint810,"ec \\nxmm10*\nou $xmm10.v16_int8\n");
+	strcpy(source_view->xmmint16,"ec \\nxmm0*\nou $xmm0.v8_int16\n");
+	strcpy(source_view->xmmint1610,"ec \\nxmm10*\nou $xmm10.v8_int16\n");
+	strcpy(source_view->xmmint32,"ec \\nxmm0*\nou $xmm0.v4_int32\n");
+	strcpy(source_view->xmmint3210,"ec \\nxmm10*\nou $xmm10.v4_int32\n");
+	strcpy(source_view->xmmint64,"ec \\nxmm0*\nou $xmm0.v2_int64\n");
+	strcpy(source_view->xmmint6410,"ec \\nxmm10*\nou $xmm10.v2_int64\n");
+	strcpy(source_view->xmmint128,"ec \\nxmm0*\nou $xmm0.uint128\n");
+	strcpy(source_view->xmmint12810,"ec \\nxmm10*\nou $xmm10.uint128\n");
+	strcpy(source_view->endit,"end\n");
+	strcpy(source_view->mxcsr,"ec \\nmxcsr*\nou $mxcsr\n");
+	source_view->regStrPt[0] = source_view->xmmfloat;
+	source_view->regStrPt[1] = source_view->xmmdouble;
+	source_view->regStrPt[2] = source_view->xmmint8;
+	source_view->regStrPt[3] = source_view->xmmint16;
+	source_view->regStrPt[4] = source_view->xmmint32;
+	source_view->regStrPt[5] = source_view->xmmint64;
+	source_view->regStrPt[6] = source_view->xmmint128;
+	source_view->regStrPt[7] = source_view->xmmfloat10;
+	source_view->regStrPt[8] = source_view->xmmdouble10;
+	source_view->regStrPt[9] = source_view->xmmint810;
+	source_view->regStrPt[10] = source_view->xmmint1610;
+	source_view->regStrPt[11] = source_view->xmmint3210;
+	source_view->regStrPt[12] = source_view->xmmint6410;
+	source_view->regStrPt[13] = source_view->xmmint12810;
+	source_view->regStrPt[14] = source_view->mmx8x;
+	source_view->regStrPt[15] = source_view->mmx16x;
+	source_view->regStrPt[16] = source_view->mmx32x;
+	source_view->regStrPt[17] = source_view->mmx64x;
 
+	for(i = 0;i < 8;i++)
+	{
+		source_view->mmregs[i] = -1;
+		source_view->saved_mmregs[i] = -1;
+	}
+	for(i = 0;i < 16;i++)
+	{
+		source_view->saved_xmregs[i] = -1;
+		source_view->xmregs[i] = -1;
+	}
+	for(i = 0;i < 24;i++)
+	{
+		source_view->saved_Masked[i] = 0;
+		source_view->Masked[i] = 0;
+	}
+    
     if (app_data.separate_source_window)
     {
 	// More values for main window
@@ -4104,6 +4335,9 @@
 
     // Create preference panels
     make_preferences(paned_work_w);
+	//setup the register dialog
+	if(gdb->type() == GDB)
+		make_regspref(source_view->box);
 
     // Save option states
     save_option_state();
@@ -4197,6 +4431,14 @@
 	    msg = msg.after('\n');
 	}
     }
+	if(gdb->type() == GDB)
+	{
+      Command c("def vfdbl\ninf reg\nec \\nst0*\nou $st0\nec \\nst1*\nou $st1\nec \\nst2*\nou $st2\nec \\nst3*\nou $st3\nec \\nst4*\nou $st4\nec \\nst5*\nou $st5\nec \\nst6*\nou $st6\nec \\nst7*\nou $st7\nend\n");
+      c.echo = false;
+      c.prompt = false;
+      c.verbose = false;
+      gdb_command(c);
+	}
     return DDD_CONTINUE;
 }
 #else
@@ -4793,6 +5035,69 @@
     }
     source_view = new SourceView(source_view_parent);
 
+	source_view->ProgramArch = -1;
+	source_view->RegsSaved = false;
+	source_view->xmregp = 0;
+	source_view->LastClicked = -1;
+	source_view->XmmSet = 0;
+	source_view->mmSet = 0;
+	strcpy(source_view->vfdblStr,"def vfdbl\ninf reg\n");
+	strcpy(source_view->fltStr,"ec \\nst0*\nou $st0\nec \\nst1*\nou $st1\nec \\nst2*\nou $st2\nec \\nst3*\nou $st3\nec \\nst4*\nou $st4\nec \\nst5*\nou $st5\nec \\nst6*\nou $st6\nec \\nst7*\nou $st7\n");
+	strcpy(source_view->fltstat,"ec \\nfctrl*\nou/x $fctrl\nec \\nfstat*\nou/x $fstat\nec \\nftag*\nou/x $ftag\nec \\nfiseg*\nou/x $fiseg\nec \\nfioff*\nou/x $fioff\nec \\nfoseg*\nou/x $foseg\nec \\nfooff*\nou/x $fooff\nec \\nfop*\nou/x $fop\n");
+	strcpy(source_view->mmx8x,"ec \\nmm0*\nou $mm0.v8_int8\n");
+	strcpy(source_view->mmx16x,"ec \\nmm0*\nou $mm0.v4_int16\n");
+	strcpy(source_view->mmx32x,"ec \\nmm0*\nou $mm0.v2_int32\n");
+	strcpy(source_view->mmx64x,"ec \\nmm0*\nou $mm0.uint64\n");
+	strcpy(source_view->xmmfloat,"ec \\nxmm0*\nou $xmm0.v4_float\n");
+	strcpy(source_view->xmmfloat10,"ec \\nxmm10*\nou $xmm10.v4_float\n");
+	strcpy(source_view->xmmdouble,"ec \\nxmm0*\nou $xmm0.v2_double\n");
+	strcpy(source_view->xmmdouble10,"ec \\nxmm10*\nou $xmm10.v2_double\n");
+	strcpy(source_view->xmmint8,"ec \\nxmm0*\nou $xmm0.v16_int8\n");
+	strcpy(source_view->xmmint810,"ec \\nxmm10*\nou $xmm10.v16_int8\n");
+	strcpy(source_view->xmmint16,"ec \\nxmm0*\nou $xmm0.v8_int16\n");
+	strcpy(source_view->xmmint1610,"ec \\nxmm10*\nou $xmm10.v8_int16\n");
+	strcpy(source_view->xmmint32,"ec \\nxmm0*\nou $xmm0.v4_int32\n");
+	strcpy(source_view->xmmint3210,"ec \\nxmm10*\nou $xmm10.v4_int32\n");
+	strcpy(source_view->xmmint64,"ec \\nxmm0*\nou $xmm0.v2_int64\n");
+	strcpy(source_view->xmmint6410,"ec \\nxmm10*\nou $xmm10.v2_int64\n");
+	strcpy(source_view->xmmint128,"ec \\nxmm0*\nou $xmm0.uint128\n");
+	strcpy(source_view->xmmint12810,"ec \\nxmm10*\nou $xmm10.uint128\n");
+	strcpy(source_view->endit,"end\n");
+	strcpy(source_view->mxcsr,"ec \\nmxcsr*\nou $mxcsr\n");
+	source_view->regStrPt[0] = source_view->xmmfloat;
+	source_view->regStrPt[1] = source_view->xmmdouble;
+	source_view->regStrPt[2] = source_view->xmmint8;
+	source_view->regStrPt[3] = source_view->xmmint16;
+	source_view->regStrPt[4] = source_view->xmmint32;
+	source_view->regStrPt[5] = source_view->xmmint64;
+	source_view->regStrPt[6] = source_view->xmmint128;
+	source_view->regStrPt[7] = source_view->xmmfloat10;
+	source_view->regStrPt[8] = source_view->xmmdouble10;
+	source_view->regStrPt[9] = source_view->xmmint810;
+	source_view->regStrPt[10] = source_view->xmmint1610;
+	source_view->regStrPt[11] = source_view->xmmint3210;
+	source_view->regStrPt[12] = source_view->xmmint6410;
+	source_view->regStrPt[13] = source_view->xmmint12810;
+	source_view->regStrPt[14] = source_view->mmx8x;
+	source_view->regStrPt[15] = source_view->mmx16x;
+	source_view->regStrPt[16] = source_view->mmx32x;
+	source_view->regStrPt[17] = source_view->mmx64x;
+
+	for(i = 0;i < 8;i++)
+	{
+		source_view->mmregs[i] = -1;
+		source_view->saved_mmregs[i] = -1;
+	}
+	for(i = 0;i < 16;i++)
+	{
+		source_view->saved_xmregs[i] = -1;
+		source_view->xmregs[i] = -1;
+	}
+	for(i = 0;i < 24;i++)
+	{
+		source_view->saved_Masked[i] = 0;
+		source_view->Masked[i] = 0;
+   }
     std::cerr << "Set values for main window?\n";
 
     // Source toolbar
@@ -4997,6 +5302,8 @@
 
     // Create preference panels
     make_preferences(paned_work_w);
+   if(gdb->type() == GDB)
+      make_regspref(source_view->box);
 
     // Save option states
     save_option_state();
@@ -5076,6 +5383,14 @@
 	    msg = msg.after('\n');
 	}
     }
+ 	if(gdb->type() == GDB)
+	{
+      Command c("def vfdbl\ninf reg\nec \\nst0*\nou $st0\nec \\nst1*\nou $st1\nec \\nst2*\nou $st2\nec \\nst3*\nou $st3\nec \\nst4*\nou $st4\nec \\nst5*\nou $st5\nec \\nst6*\nou $st6\nec \\nst7*\nou $st7\nend\n");
+      c.echo = false;
+      c.prompt = false;
+      c.verbose = false;
+      gdb_command(c);
+	}
     return DDD_CONTINUE;
 }
 #endif
@@ -6345,6 +6660,8 @@
 // Reflect state in option menus
 void update_options()
 {
+	if(gdb->type() == GDB)
+		source_view->refresh_registers_command();
     set_toggle(find_words_only_w, app_data.find_words_only);
     set_toggle(words_only_w, app_data.find_words_only);
 
@@ -6707,7 +7024,9 @@
 {
     if (noupd)
 	return false;
-    set_toggle(find_words_only_w, app_data.find_words_only);
+ 	if(gdb->type() == GDB)
+		source_view->refresh_registers_command();
+   set_toggle(find_words_only_w, app_data.find_words_only);
     set_toggle(words_only_w, app_data.find_words_only);
 
     set_toggle(find_case_sensitive_w, app_data.find_case_sensitive);
@@ -7088,10 +7407,16 @@
 
 #if defined(IF_XM)
 static Widget preferences_dialog;
+static Widget regspref_dialog;
 static Widget reset_preferences_w;
+static Widget reset_regprefs_w = NULL;
+static Widget set_regprefs_w = NULL;
 #else
+static GUI::Dialog *regspref_dialog;
 static GUI::Dialog *preferences_dialog = NULL;
 static GUI::Button *reset_preferences_w = NULL;
+static GUI::Widget *reset_regprefs_w = NULL;
+static GUI::Widget *set_regprefs_w = NULL;
 #endif
 #if !defined(IF_XM)
 static sigc::connection reset_preferences_connection;
@@ -8114,6 +8439,104 @@
 #endif
 
 #if defined(IF_XM)
+
+//setup the dialog button
+void StartupRegisterSettings(int *Mask)
+{
+	manage_and_raise(regspref_dialog);
+	set_sensitive(reset_regprefs_w,true);	//turn on the OK and Cancle buttons
+	set_sensitive(set_regprefs_w,true);
+	int i;
+	if(source_view->ProgramArch == 1)
+	{	//if this is 64 bit mode then set the extra 8 buttons
+		for(i = 8;i < 16;i++)
+		{
+			XtManageChild(RegDisable_w[i]);	//turn on integer register
+			XmToggleButtonSetState(RegDisable_w[i],Mask[i],True);
+		}
+	}
+	else
+	{	//turn off the top 8 integer regs.
+		for(i = 8;i < 16;i++)
+			XtUnmanageChild(RegDisable_w[i]);
+	}
+	for(i = 0;i < 8;i++)
+	{
+		XtManageChild(xRegDisable_w[i]);	//turn on integer register
+		XmToggleButtonSetState(xRegDisable_w[i],Mask[i+16],True);
+	}
+}
+
+void ToggleRegisterButton(int buttonNo,int XmMm)
+{	//toggle the XMM X and MMX X buttons
+	if(XmMm)
+		XmToggleButtonSetState(xmmDsply_w[buttonNo],True,True);
+	else
+		XmToggleButtonSetState(mmDsply_w[buttonNo],True,True);
+}
+
+void EndRegsDialog(void)
+{	//kill the register dialog
+	XtUnmanageChild(regspref_dialog);
+}
+
+static void make_regspref(Widget parent)
+{	//the setup for the register dialog box
+	Arg args[4];
+	int arg;
+
+	regspref_dialog = verify(XmCreatePromptDialog(parent, 
+		XMST("registerpreferences"),args,0));
+	Delay::register_shell(regspref_dialog);
+	XtVaSetValues(regspref_dialog,XmNdefaultButton,Widget(0),XtPointer(0));
+	if (lesstif_version <= 79)
+		XtUnmanageChild(XmSelectionBoxGetChild(regspref_dialog,
+			XmDIALOG_APPLY_BUTTON));
+	// Remove old prompt
+	XtUnmanageChild(XmSelectionBoxGetChild(regspref_dialog,XmDIALOG_TEXT));
+	XtUnmanageChild(XmSelectionBoxGetChild(regspref_dialog,
+		XmDIALOG_SELECTION_LABEL));
+	// Use cancel button to reset settings
+	reset_regprefs_w = XmSelectionBoxGetChild(regspref_dialog,
+		XmDIALOG_CANCEL_BUTTON);
+	XtRemoveAllCallbacks(reset_regprefs_w,XmNactivateCallback);
+	set_sensitive(reset_regprefs_w,false);
+	XtAddCallback(reset_regprefs_w,XmNactivateCallback,
+		ResetRegsPreferencesCB, XtPointer(2));
+	//setup the OK button Callback
+	set_regprefs_w = XmSelectionBoxGetChild(regspref_dialog,
+		 XmDIALOG_OK_BUTTON);
+	XtRemoveAllCallbacks(set_regprefs_w,XmNactivateCallback);
+	set_sensitive(set_regprefs_w,false);
+	XtAddCallback(set_regprefs_w,XmNactivateCallback,
+		SetRegsPreferencesCB, XtPointer(0));
+	XtAddCallback(regspref_dialog,XmNhelpCallback,
+		ImmediateHelpCB,XtPointer(regspref_dialog));
+ 	arg = 0;
+	//setup the register dialog
+	XtSetArg(args[arg],XmNmarginWidth,0); arg++;
+	XtSetArg(args[arg],XmNmarginHeight,0); arg++;
+	XtSetArg(args[arg],XmNborderWidth,0); arg++;
+	Widget box = verify(XmCreateRowColumn(regspref_dialog,XMST("box"),
+		args,arg));
+ 	XtManageChild(box);
+	Widget frame = verify(XmCreateFrame(box,XMST("frame"),args,0));
+	XtManageChild(frame);
+	arg = 0;
+	XtSetArg(args[arg],XmNmarginWidth,0); arg++;
+	XtSetArg(args[arg],XmNmarginHeight,0); arg++;
+	XtSetArg(args[arg],XmNborderWidth,0); arg++;
+	Widget change = verify(XmCreateRowColumn(frame,XMST("change"),args,arg));
+	XtManageChild(change);
+	Dimension max_width  = 0;
+	Dimension max_height = 0;
+	Widget general_button = add_panel(change,box,"",
+		register_preferenes_menu,max_width,max_height,false);
+	XmToggleButtonSetState(xmmDsply_w[0],True,True);
+	XmToggleButtonSetState(mmDsply_w[0],True,True);
+	XtUnmanageChild(general_button);
+}
+
 // Create preferences dialog
 static void make_preferences(Widget parent)
 {
@@ -8207,6 +8630,78 @@
 }
 #else
 // Create preferences dialog
+
+void StartupRegisterSettings(int *Mask)
+{
+	manage_and_raise(regspref_dialog);
+	set_sensitive(reset_regprefs_w,true);	//turn on the OK and Cancle buttons
+	set_sensitive(set_regprefs_w,true);
+	int i;
+   for(i = 0;i < 8;i++)
+      RegDisable_w[i]->set_active((bool)Mask[i]);
+	if(source_view->ProgramArch == 1)
+	{	//if this is 64 bit mode then set the extra 8 buttons
+		for(;i < 16;i++)
+      {
+			RegDisable_w[i]->show();
+         RegDisable_w[i]->set_active((bool)Mask[i]);
+      }
+	}
+	else
+	{	//turn off the top 8 integer regs.
+		for(i = 8;i < 16;i++)
+			RegDisable_w[i]->hide();
+	}
+	for(;i < 24;i++)
+   {
+      xRegDisable_w[i-16]->show();
+      xRegDisable_w[i-16]->set_active((bool)Mask[i]);
+   }
+}
+
+void ToggleRegisterButton(int buttonNo,int XmMm)
+{	//toggle the XMM X and MMX X buttons
+   int i;
+   int j = buttonNo + 1;
+   bool t;
+	if(XmMm)
+   {
+      for(i = 0;i < 9;i++)
+      {
+         t = false;
+         if(i == j)
+            t = true;
+   		xmmDsply_w[i]->set_active(t);
+      }
+   }
+	else
+   {
+      for(i = 0;i < 6;i++)
+      {
+         t = false;
+         if(i == j)
+            t = true;
+   		mmDsply_w[i]->set_active(t);
+      }
+   }
+}
+
+static void make_regspref(GUI::Widget *parent)
+{	//the setup for the register dialog box
+   regspref_dialog = new GUI::Dialog(*find_shell(parent), "Register Settings Dialog");
+   Delay::register_shell(regspref_dialog);
+   GUI::Notebook *reg_settings = new GUI::Notebook(*regspref_dialog, GUI::PACK_SHRINK, "reg_display_change");
+   reg_settings->show();
+   GUI::Button *Obutton = regspref_dialog->add_button("ok", _("OK"));
+   Obutton->signal_clicked().connect(sigc::bind(sigc::ptr_fun(SetRegsPreferencesCB), regspref_dialog));
+   Obutton->show();
+   GUI::Button *Cbutton = regspref_dialog->add_button("cancel", _("Cancel"));
+   Cbutton->signal_clicked().connect(sigc::bind(sigc::ptr_fun(ResetRegsPreferencesCB), regspref_dialog));
+   Cbutton->show();
+   int reg_button = add_panel(reg_settings, "preferences", "Register Display Preferences", register_preferenes_menu,false);
+   reg_settings->set_current_page(reg_button);
+}
+
 static void make_preferences(GUI::Widget *parent)
 {
     preferences_dialog = 
@@ -8553,6 +9048,7 @@
     }
 }
 #else
+
 static
 bool
 BlinkCB(bool *set_p)

--- gddd/ddd/ddd.h	2013-05-17 19:55:05.000000000 +0200
+++ gddd/ddd/ddd.h	2013-05-18 22:17:25.518265850 +0200
@@ -78,6 +78,7 @@
 #if defined(IF_XM)
 // Update option menus
 extern void update_options();
+extern void EndRegsDialog();
 #else
 // Update option menus
 extern void update_options(bool noupd=false);
@@ -158,6 +159,8 @@
 
 // Process ^C key
 extern bool process_emergencies();
+extern void StartupRegisterSettings(int *);
+extern void ToggleRegisterButton(int buttonNo,int XmMm);
 
 #endif // _DDD_ddd_h
 // DON'T ADD ANYTHING BEHIND THIS #endif

--- gddd/ddd/file.C	2013-05-17 19:55:05.000000000 +0200
+++ gddd/ddd/file.C	2013-05-17 19:18:37.962314595 +0200
@@ -2240,9 +2240,8 @@
 }
 #else
 // OK pressed in `Lookup Source'
-static void lookupSourceDone(GUI::ListView *sources)
+static void lookupSourceDone(GUI::ListView *sources,GUI::Dialog *dlg)
 {
-
     set_status("");
 
     string source = get_item(sources);
@@ -2261,8 +2260,11 @@
 	    source = all_sources[pos];
 	}
     }
-
-    std::cerr << "Unmanage this?\n";
+    if (!source.empty())
+    {
+      source_view->lookup(source + ":1");    //open source file at line 1
+      UnmanageThisCB(dlg);
+    }
 }
 #endif
 
@@ -2737,37 +2739,29 @@
 	GUI::Button *sharedlibrary = new GUI::Button(*bigbox, GUI::PACK_SHRINK, "sharedlibrary");
 	sharedlibrary->show();
 
-	GUI::Button *lookup = dialog->add_button("lookup", _("Lookup"));
-	lookup->signal_clicked().connect(sigc::bind(sigc::ptr_fun(lookupSourceDone),
-						    source_list));
-	lookup->show();
-
 	GUI::ScrolledWindow *sw = new GtkX::ScrolledWindow(*dialog, GUI::PACK_EXPAND_WIDGET, "source_list_sw");
 	// sw->set_size_request(-1, 100);
-	sw->show();
-
 	std::vector<GUI::String> headers;
 	headers.push_back("Sources");
 	source_list = new GUI::ListView(*sw, GUI::PACK_EXPAND_WIDGET, "source_list", headers);
-	source_list->show();
-
+	GUI::Button *lookup = dialog->add_button("lookup", _("Lookup"));
+	lookup->signal_clicked().connect(sigc::bind(sigc::ptr_fun(lookupSourceDone),source_list,dialog));
+	lookup->show();
+	sw->show();
 	source_list->signal_selection_changed().connect(sigc::bind(sigc::ptr_fun(SelectSourceCB), source_list));
-
+	source_list->show();
 	GUI::Button *button;
 	button = dialog->add_button("ok", _("OK"));
-	button->signal_clicked().connect(sigc::bind(sigc::ptr_fun(lookupSourceDone),
-						    source_list));
+	button->signal_clicked().connect(sigc::bind(sigc::ptr_fun(lookupSourceDone),source_list,dialog));
 	button = dialog->add_button("cancel", _("Cancel"));
-	button->signal_clicked().connect(sigc::bind(sigc::ptr_fun(UnmanageThisCB),
-						    dialog));
+	button->signal_clicked().connect(sigc::bind(sigc::ptr_fun(UnmanageThisCB),dialog));
 	dialog->signal_unmap().connect(sigc::ptr_fun(ClearStatusCB));
-
+   dialog->set_default_size(300,300);
 #ifdef NAG_ME
 #warning No filters.
 #endif
 	source_filter->signal_activate().connect(sigc::ptr_fun(FilterSourcesCB));
 	sharedlibrary->signal_clicked().connect(sigc::ptr_fun(LoadSharedLibrariesCB));
-
     }
 
     update_sources(source_list, source_filter);

--- gddd/ddd/options.C	2013-05-17 19:55:05.000000000 +0200
+++ gddd/ddd/options.C	2013-05-26 11:56:20.946666806 +0200
@@ -128,6 +128,7 @@
 extern "C" int pclose(FILE *stream);
 #endif
 
+extern SourceView *source_view;
 
 //-----------------------------------------------------------------------------
 // Helper Decls
@@ -381,6 +382,26 @@
 #endif
 
 #if defined(IF_XM)
+void sourceSetRegisterCB(_WidgetRec*, void*, void*)
+#else
+void sourceSetRegisterCB()
+#endif
+{	//the setup for the register dialog
+	source_view->ProgramArch = 0;
+	string archtype = gdb_question("show architecture");
+	if(archtype.length() > 2)
+	{
+		if(archtype.contains("64"))
+			source_view->ProgramArch = 1;
+	}
+	source_view->refresh_registers_command();
+	memcpy(source_view->saved_xmregs,source_view->xmregs,16*4);
+	memcpy(source_view->saved_mmregs,source_view->mmregs,8*4);
+	memcpy(source_view->saved_Masked,source_view->Masked,24*4);
+}
+
+#if defined(IF_XM)
+
 void sourceSetIntRegistersCB (Widget, XtPointer, XtPointer call_data)
 {
     XmToggleButtonCallbackStruct *info = 
@@ -394,20 +415,334 @@
 
     update_options();
 }
+
+void SetRegsPreferencesCB(_WidgetRec*, void*, void*)
+{	// if OK was pressed
+	RegisterSettingsCB();	//do the define string for gdb setup
+	EndRegsDialog();
+}
+
+void ResetRegsPreferencesCB(_WidgetRec* , void*, void*)
+{	// if Cancle is pressed just reset everything that was changed
+   memcpy(source_view->xmregs,source_view->saved_xmregs,16*4);
+   memcpy(source_view->mmregs,source_view->saved_mmregs,8*4);
+   memcpy(source_view->Masked,source_view->saved_Masked,24*4);
+	EndRegsDialog();
+}
+
 #else
-void sourceSetIntRegistersCB (GUI::RadioButton *w)
-{
-    if (w->get_active())
-    {
-	set_status("Showing integer registers only.");
-	app_data.all_registers = false;
-    }
 
+void sourceSetIntRegistersCB (GUI::Button *w)
+{
     update_options(true);
 }
+
+void ResetRegsPreferencesCB(GUI::Dialog *dlg)
+{	// if Cancle is pressed just reset everything that was changed
+   memcpy(source_view->xmregs,source_view->saved_xmregs,16*4);
+   memcpy(source_view->mmregs,source_view->saved_mmregs,8*4);
+   memcpy(source_view->Masked,source_view->saved_Masked,24*4);
+	UnmanageThisCB(dlg);
+}
+
+void SetRegsPreferencesCB(GUI::Dialog *dlg)
+{	// if OK was pressed
+	RegisterSettingsCB();	//do the define string for gdb setup
+	UnmanageThisCB(dlg);
+}
 #endif
 
 #if defined(IF_XM)
+
+void dddToggleRegisterButtonsCB(Widget,XtPointer butn, XtPointer call_data)
+{
+	if(source_view->ProgramArch != -1)	//if a session is already been loaded
+	{	//this comes up in startup	// get the button pressed
+		XmToggleButtonCallbackStruct *info = (XmToggleButtonCallbackStruct *)call_data;
+		int button = (long int)butn; 
+		if(info->set && button != -1)	//something else happened
+#else
+void dddToggleRegisterButtonsCB(GUI::RadioButton *butn, int button)
+{
+	if(source_view->ProgramArch != -1)	//if a session is already been loaded
+	{	//this comes up in startup	// get the button pressed
+		if(butn->get_active() && button != -1)	//something else happened
+#endif
+		{
+			if(button < 15)					//the mmx xmm reg buttons
+			{
+				source_view->LastClicked = button;           
+         	int j;
+         	if(source_view->LastClicked < 9)
+         	{
+            	if(!source_view->XmmSet)
+               {
+            		for(j = 0;j < 16;j++)
+            			source_view->xmregs[j] = source_view->LastClicked-1;
+            	}
+            	else
+            		source_view->xmregs[source_view->XmmSet - 1] = source_view->LastClicked-1;
+         	}
+         	else if(source_view->LastClicked < 15)
+         	{
+         		if(!source_view->mmSet)
+            	{
+            		for(j = 0;j < 8;j++)
+            			source_view->mmregs[j] = source_view->LastClicked-10;
+            	}
+         		else
+               	source_view->mmregs[source_view->mmSet - 1] = source_view->LastClicked-10;
+            }            
+			}
+			else							//integer buttons etc.
+				source_view->Masked[button-15] = 1;
+		}
+		else if(button > 14)
+			source_view->Masked[button-15] = 0;
+		if(!source_view->RegsSaved)			//only if the OK button was pressed
+			source_view->RegsSaved = true;
+	}
+}
+
+void RegisterSettingsCB(void)
+{
+	if(source_view->RegsSaved)	//do only if OK was pressed
+	{
+      string radix = gdb_question("show output-radix");  //give gdb time to process the command
+      Command cw("");                                    // doesn't work if put too close to reading the string
+      cw.echo = false;
+      cw.prompt = false;
+      cw.verbose = false;
+		char*	bldStr = new char[1024];
+		int i,k;
+		int j = 0;
+		int m = 16;
+		source_view->xmregp = 0;
+		if(source_view->ProgramArch == 0)	//32 bit mode
+			m = 8;		//only 8 xmm registers
+		for(i = 0;i < m;i++)
+		{
+			if(source_view->xmregs[i] != -1)
+			{
+				source_view->xmregp = 1;
+				break;
+			}
+		}
+		for(i = 0;i < 8;i++)	//the mmx registers
+		{
+			if(source_view->mmregs[i] != -1)
+			{
+				source_view->xmregp |= 2;
+				for(;i < 8;i++)
+				{
+					if(source_view->mmregs[i] == 0)
+					{
+						source_view->xmregp |= 4;
+						break;
+					}
+				}
+				break;
+			}
+		}
+		if(!source_view->xmregp)	//no float
+			source_view->RegisterDisplay = 0;
+		else if(source_view->xmregp & 4)	//if a floating poin st reg was set as float
+		{
+			strcpy(bldStr,source_view->vfdblStr);	//first string with integers
+			strcat(bldStr,source_view->fltStr);		//floating point regs st
+			if(source_view->ProgramArch == 0)
+				strcat(bldStr,source_view->fltstat);		//floating point state
+			if(source_view->xmregp & 1)
+			{	// at least one xmm activated
+				source_view->RegisterDisplay = 2;
+				for(i = 0;i < m;i++)
+				{
+					k = source_view->xmregs[i];
+					if(k != -1)
+					{
+						j = strlen(bldStr);
+						if(i<10)
+						{
+							strcat(bldStr,source_view->regStrPt[k]);
+							bldStr[j+8] = i + '0';			
+							bldStr[j+18] = i + '0';			
+						}
+						else
+						{
+							strcat(bldStr,source_view->regStrPt[k+7]);
+							bldStr[j+9] = i + '0' - 10;			
+							bldStr[j+20] = i + '0' - 10;			
+						}
+					}
+				}
+			}
+			else	//only the mmx or st
+				source_view->RegisterDisplay = 1;
+			strcat(bldStr,source_view->endit);	//end of the string
+         if(gdb_question("show confirm").contains(" on"))
+         {
+            cw.check = false;
+            cw.command = "set confirm off";
+            cw.priority = COMMAND_PRIORITY_INIT;
+            gdb_command(cw);
+            cw.priority = COMMAND_PRIORITY_USER;
+            cw.command = bldStr;
+            cw.check = true;
+            gdb_command(cw);
+            cw.command = "set confirm on";
+            cw.priority = COMMAND_PRIORITY_INIT;
+            cw.check = false;
+            gdb_command(cw);
+         }
+         else
+         {
+            cw.command = bldStr;
+            gdb_command(cw);
+         }
+		}
+		else
+		{	//no floating point activated
+			strcpy(bldStr,source_view->vfdblStr);
+			if(source_view->ProgramArch == 0)	//if 32 bit
+				strcat(bldStr,source_view->mxcsr);
+			for(i = 0;i < m;i++)
+			{
+				k = source_view->xmregs[i];
+				if(k != -1)
+				{	//set up the xmm string
+					j = strlen(bldStr);
+					if(i<10)
+					{
+						strcat(bldStr,source_view->regStrPt[k]);
+						bldStr[j+8] = i + '0';
+						bldStr[j+18] = i + '0';
+					}
+					else
+					{
+						strcat(bldStr,source_view->regStrPt[k+7]);
+						bldStr[j+9] = i + '0' - 10;
+						bldStr[j+20] = i + '0' - 10;
+					}
+				}
+			}
+			if(source_view->ProgramArch == 0)
+			{	//if there is at least one mmx st on
+				if((source_view->xmregp & 2) != 0)
+				{	//do the 8 register strings
+					for(i = 0;i < 8;i++)
+					{
+						k = source_view->mmregs[i];
+						if(k != -1)
+						{
+							j = strlen(bldStr);
+							strcat(bldStr,source_view->regStrPt[k+13]);
+							bldStr[j+7] = i + '0';
+							bldStr[j+16] = i + '0';
+						}
+					}
+				}
+				else
+				{	//set in only the float regs and float status
+					strcat(bldStr,source_view->fltStr);
+					if(source_view->ProgramArch == 0)
+						strcat(bldStr,source_view->fltstat);
+				}
+			}	//only set in the floating point -- later changed to mmx
+			else if(source_view->xmregp & 2)
+				strcat(bldStr,source_view->fltStr);
+			strcat(bldStr,source_view->endit);
+         if(gdb_question("show confirm").contains(" on"))
+         {
+            cw.check = false;
+            cw.command = "set confirm off";
+            cw.priority = COMMAND_PRIORITY_INIT;
+            gdb_command(cw);
+            cw.priority = COMMAND_PRIORITY_USER;
+            cw.command = bldStr;
+            cw.check = true;
+            gdb_command(cw);
+            cw.command = "set confirm on";
+            cw.priority = COMMAND_PRIORITY_INIT;
+            cw.check = false;
+            gdb_command(cw);
+         }
+         else
+         {
+            cw.command = bldStr;
+            gdb_command(cw);
+         }
+ 		}
+      memcpy(source_view->saved_xmregs,source_view->xmregs,16*4);
+      memcpy(source_view->saved_mmregs,source_view->mmregs,8*4);
+      memcpy(source_view->saved_Masked,source_view->Masked,24*4);
+      cw.priority = COMMAND_PRIORITY_INIT;
+      cw.check = true;
+      if(radix.contains("16"))                  //this causes a refresh of the register display
+         cw.command = "set output-radix 16";    //without changing anything
+      else
+         cw.command = "set output-radix 10";
+      gdb_command(cw);
+		delete bldStr;
+	}
+}
+#if defined(IF_XM)
+
+void dddToggleFPMMXButton(Widget fpbutton,XtPointer,XtPointer)
+{	//advances the MMX button text and pointer
+	source_view->mmSet++;
+	if(source_view->mmSet == 9)
+		source_view->mmSet = 0;
+	char regst[8];
+	if(!source_view->mmSet)
+		strcpy(regst,"ALL MMX");
+	else
+	{
+		strcpy(regst,"MMX 0");
+		regst[4] = source_view->mmSet-1 + '0';	//set the number for the MMX X reg.
+		ToggleRegisterButton(source_view->mmregs[source_view->mmSet-1]+1,0);
+	}
+	Arg args[1];
+   XmString label_str = XmStringCreateLocalized(regst);
+   XtSetArg(args[0],XmNlabelString,label_str);      
+   XtSetValues(fpbutton,args,1);
+}
+
+void dddToggleXMMButton(Widget fxbutton,XtPointer,XtPointer)
+{	//do the same for the XMM XX button
+	source_view->XmmSet++;
+	if(source_view->ProgramArch)
+	{
+		if(source_view->XmmSet > 16)
+			source_view->XmmSet = 0;
+	}
+	else
+	{
+		if(source_view->XmmSet > 8)
+			source_view->XmmSet = 0;
+	}
+	char regst[8];
+	if(!source_view->XmmSet)
+		strcpy(regst,"ALL XMM");
+	else
+	{
+		if(source_view->XmmSet < 11)
+		{
+			strcpy(regst,"XMM 0 ");
+			regst[4] = source_view->XmmSet-1 + '0';
+		}
+		else
+		{
+			strcpy(regst,"XMM 10");
+			regst[5] = source_view->XmmSet-11 + '0';			
+		}
+		ToggleRegisterButton(source_view->xmregs[source_view->XmmSet-1]+1,1);		
+	}
+	Arg args[1];
+   XmString label_str = XmStringCreateLocalized(regst);
+   XtSetArg(args[0],XmNlabelString,label_str);      
+   XtSetValues(fxbutton,args,1);
+}
+
 void sourceSetTabWidthCB (Widget, XtPointer, XtPointer call_data)
 {
     XmScaleCallbackStruct *info = (XmScaleCallbackStruct *)call_data;
@@ -440,6 +775,56 @@
 	       itostring(app_data.indent_code) + ".");
 }
 #else
+void dddToggleFPMMXButton(GUI::Button *fpbutton)
+{	//advances the MMX button text and pointer
+	source_view->mmSet++;
+	if(source_view->mmSet == 9)
+		source_view->mmSet = 0;
+	char regst[8];
+	if(!source_view->mmSet)
+		strcpy(regst,"ALL MMX");
+	else
+	{
+		strcpy(regst,"MMX 0");
+		regst[4] = source_view->mmSet-1 + '0';	//set the number for the MMX X reg.
+		ToggleRegisterButton(source_view->mmregs[source_view->mmSet-1],0);
+	}
+   fpbutton->set_label(regst);
+}
+
+void dddToggleXMMButton(GUI::Button *fxbutton)
+{	//do the same for the XMM XX button
+	source_view->XmmSet++;
+	if(source_view->ProgramArch)
+	{
+		if(source_view->XmmSet > 16)
+			source_view->XmmSet = 0;
+	}
+	else
+	{
+		if(source_view->XmmSet > 8)
+			source_view->XmmSet = 0;
+	}
+	char regst[8];
+	if(!source_view->XmmSet)
+		strcpy(regst,"ALL XMM");
+	else
+	{
+		if(source_view->XmmSet < 11)
+		{
+			strcpy(regst,"XMM 0 ");
+			regst[4] = source_view->XmmSet-1 + '0';
+		}
+		else
+		{
+			strcpy(regst,"XMM 10");
+			regst[5] = source_view->XmmSet-11 + '0';			
+		}
+		ToggleRegisterButton(source_view->xmregs[source_view->XmmSet-1],1);		
+	}
+   fxbutton->set_label(regst);
+}
+
 void sourceSetTabWidthCB (GUI::Scale *w)
 {
     app_data.tab_width = (unsigned int)w->get_value();

--- gddd/ddd/options.h	2013-05-17 19:55:05.000000000 +0200
+++ gddd/ddd/options.h	2013-05-18 02:37:34.449147558 +0200
@@ -39,6 +39,8 @@
 #include <X11/Intrinsic.h>
 #else
 #include <GUI/RadioButton.h>
+#include <GUI/Dialog.h>
+#include <GUI/Button.h>
 #include <GUI/CheckButton.h>
 #include <GUI/CheckMenuItem.h>
 #include <GUI/RadioMenuItem.h>
@@ -103,16 +105,24 @@
 extern void sourceSetUseSourcePathCB        (Widget, XtPointer, XtPointer);
 extern void sourceSetTabWidthCB             (Widget, XtPointer, XtPointer);
 extern void sourceSetSourceIndentCB 	    (Widget, XtPointer, XtPointer);
-extern void sourceSetCodeIndentCB 	    (Widget, XtPointer, XtPointer);
+extern void sourceSetCodeIndentCB          (Widget, XtPointer, XtPointer);
+extern void	SetRegisterSettingsCB			  (Widget, XtPointer, XtPointer);
+extern void ResetRegsPreferencesCB			  (Widget, XtPointer, XtPointer);
+extern void SetRegsPreferencesCB				  (Widget, XtPointer, XtPointer);
+extern void sourceSetRegisterCB				  (Widget,XtPointer,XtPointer);
 #else
-extern void sourceSetIntRegistersCB         (GUI::RadioButton *);
+extern void sourceSetIntRegistersCB         (GUI::Button *);
 extern void sourceSetAllRegistersCB         (GUI::RadioButton *);
 extern void sourceSetDisplayGlyphsCB        (bool);
 extern void sourceSetUseSourcePathCB        (bool);
 extern void sourceSetTabWidthCB             (GUI::Scale *);
-extern void sourceSetSourceIndentCB 	    (GUI::Scale *);
-extern void sourceSetCodeIndentCB 	    (GUI::Scale *);
+extern void sourceSetSourceIndentCB          (GUI::Scale *);
+extern void sourceSetCodeIndentCB            (GUI::Scale *);
+void sourceSetRegisterCB                     (void);
+extern void ResetRegsPreferencesCB           (GUI::Dialog *);
+extern void SetRegsPreferencesCB             (GUI::Dialog *);
 #endif
+extern void RegisterSettingsCB			  (void);
 
 #if defined(IF_XM)
 extern void graphToggleDetectAliasesCB      (Widget, XtPointer, XtPointer);
@@ -146,6 +156,9 @@
 
 #if defined(IF_XM)
 extern void dddToggleGroupIconifyCB         (Widget, XtPointer, XtPointer);
+extern void dddToggleRegisterButtonsCB			(Widget, XtPointer, XtPointer);
+extern void dddToggleFPMMXButton					(Widget, XtPointer, XtPointer);
+extern void dddToggleXMMButton					(Widget, XtPointer, XtPointer);
 extern void dddToggleUniconifyWhenReadyCB   (Widget, XtPointer, XtPointer);
 extern void dddToggleSeparateExecWindowCB   (Widget, XtPointer, XtPointer);
 extern void dddToggleCheckGrabsCB           (Widget, XtPointer, XtPointer);
@@ -162,6 +175,9 @@
 extern void dddToggleSuppressWarningsCB     (GUI::CheckButton *);
 extern void dddToggleWarnIfLockedCB         (GUI::CheckButton *);
 extern void dddToggleSaveOptionsOnExitCB    (GUI::CheckMenuItem *);
+extern void dddToggleRegisterButtonsCB			(GUI::RadioButton *, int);
+extern void dddToggleFPMMXButton             (GUI::Button *);
+extern void dddToggleXMMButton               (GUI::Button *);
 #endif
 
 #if defined(IF_XM)

--- gddd/ddd/SourceView.C	2013-05-17 19:55:05.000000000 +0200
+++ gddd/ddd/SourceView.C	2013-05-21 01:04:19.938515176 +0200
@@ -165,6 +165,8 @@
 // LessTif hacks
 #include <X11/IntrinsicP.h>
 #include "LessTifH.h"
+extern int Masked[];
+extern int xmregp;
 #else
 #include <gtkmm/image.h>
 #include <gtkmm/main.h>
@@ -489,11 +491,40 @@
     };
 };
 
+string regsTxt[] = 
+{
+	"eax","ebx","ecx","edx","esi","edi","ebp","esp","xx","xx","xx","xx","xx","xx",
+	"xx","xx","eip","eflags","cs","ss","ds","es ","fs","gs"
+};
+
+string regsTxt64[] = 
+{
+	"rax","rbx","rcx","rdx","rsi","rdi","rbp","rsp","r8","r9","r10","r11","r12","r13",
+	"r14","r15","rip","eflags","cs","ss","ds","es","fs","gs"
+};
+
+bool FirstTime = false;
+
 #if defined(IF_XM)
 static const _XtString const text_cmd_labels[] =
+{
+    N_("Print "), 
+    N_("Display "), 
+    N_("Watch "),
+    N_(""),
+    N_("Print "), 
+    N_("Display "), 
+    N_("Watch "),
+    N_(""),
+    N_("What is "),
+    N_(""),
+    N_("Lookup ") ,
+    N_("Break at "),
+    N_("Clear at ")
+};
+
 #else
 static const char *const text_cmd_labels[] =
-#endif
 {
     N_("Print "), 
     N_("Display "), 
@@ -509,7 +540,7 @@
     N_("Break at "),
     N_("Clear at ")
 };
-
+#endif
 
 static string callback_word;
 
@@ -575,7 +606,6 @@
 #include "icons/glyphs/signalarrow.xbm"
 #include "icons/glyphs/dragarrow.xbm"
 #include "icons/glyphs/stop.xbm"
-#include "icons/glyphs/multistop.xbm"
 #include "icons/glyphs/greystop.xbm"
 #include "icons/glyphs/dragstop.xbm"
 #include "icons/glyphs/cond.xbm"
@@ -642,8 +672,7 @@
 GUI::Button *SourceView::down_w                     = 0;
 GUI::SelectionDialog *SourceView::register_dialog_w = 0;
 GUI::ListView *SourceView::register_list_w          = 0;
-GUI::RadioButton *SourceView::all_registers_w       = 0;
-GUI::RadioButton *SourceView::int_registers_w       = 0;
+GUI::Button *SourceView::int_registers_w       = 0;
 GUI::Dialog *SourceView::thread_dialog_w         = 0;
 GUI::ListView *SourceView::thread_list_w         = 0;
 #endif
@@ -4163,7 +4192,8 @@
 		initial_popup_shell(tool_shell);
 
 	    if (!started_iconified(shell))
-		gdbOpenSourceWindowCB();
+         gdbOpenSourceWindowCB();
+       sourceSetRegisterCB();
 #endif
 	}
 
@@ -5401,6 +5431,7 @@
     create_text(parent, "code", false, code_form_w, code_text_w);
     if (disassemble)
 	XtManageChild(code_form_w);
+	RegisterDisplay = 1;
 }
 #else
 SourceView::SourceView(GUI::Container *parent)
@@ -5443,6 +5474,7 @@
     create_text(parent, "code", false, code_form_w, code_text_w);
     if (disassemble)
 	code_form_w->show();
+	RegisterDisplay = 1;
 }
 #endif
 
@@ -5604,51 +5636,52 @@
 					   XmDIALOG_APPLY_BUTTON));
     XtUnmanageChild(XmSelectionBoxGetChild(register_dialog_w, 
 					   XmDIALOG_CANCEL_BUTTON));
-
-    arg = 0;
-    Widget box = XmCreateRadioBox(register_dialog_w, XMST("box"), args, arg);
-    XtManageChild(box);
-
-    arg = 0;
-    XtSetArg(args[arg], XmNset, !all_registers); arg++;
-    int_registers_w = 
-	XmCreateToggleButton(box, XMST("int_registers"), args, arg);
-    XtManageChild(int_registers_w);
-
-    arg = 0;
-    XtSetArg(args[arg], XmNset, all_registers); arg++;
-    all_registers_w = 
-	XmCreateToggleButton(box, XMST("all_registers"), args, arg);
-    XtManageChild(all_registers_w);
-
-    XtAddCallback(int_registers_w, XmNvalueChangedCallback, 
-		  sourceSetIntRegistersCB, XtPointer(0));
-    XtAddCallback(all_registers_w, XmNvalueChangedCallback, 
-		  sourceSetAllRegistersCB, XtPointer(0));
-
-    arg = 0;
-    register_list_w = XmSelectionBoxGetChild(register_dialog_w, XmDIALOG_LIST);
-    XtVaSetValues(register_list_w,
-		  XmNselectionPolicy, XmSINGLE_SELECT,
-		  XtPointer(0));
-
-    XtAddCallback(register_list_w,
-		  XmNsingleSelectionCallback, SelectRegisterCB, 0);
-    XtAddCallback(register_list_w,
-		  XmNmultipleSelectionCallback, SelectRegisterCB, 0);
-    XtAddCallback(register_list_w,
-		  XmNextendedSelectionCallback, SelectRegisterCB, 0);
-    XtAddCallback(register_list_w,
-		  XmNbrowseSelectionCallback, SelectRegisterCB, 0);
-
-    XtAddCallback(register_dialog_w,
-		  XmNokCallback, UnmanageThisCB, register_dialog_w);
-    XtAddCallback(register_dialog_w,
-		  XmNokCallback, RegisterDialogPoppedDownCB, 0);
-    XtAddCallback(register_dialog_w,
-		  XmNhelpCallback, ImmediateHelpCB, 0);
-
-
+	arg = 0;
+  	box = XmCreateRadioBox(register_dialog_w,XMST("box"),args,arg);
+   XtManageChild(box);
+	if(gdb->type() == GDB)	//setup the button menu and buttons
+	{
+		Widget Rgst = XmCreatePushButton(box,XMST("Settings"),NULL,0);
+		XtManageChild(Rgst);
+		XtAddCallback(Rgst, XmNactivateCallback, 
+			ViewRegisterSettingsCB,XtPointer(0));
+		register_list_w = XmSelectionBoxGetChild(register_dialog_w, XmDIALOG_LIST);
+		XtVaSetValues(register_list_w,XmNselectionPolicy,XmSINGLE_SELECT,
+			XtPointer(0));
+		XtAddCallback(register_list_w,
+			XmNsingleSelectionCallback, SelectRegisterCB, 0);
+		XtAddCallback(register_dialog_w,
+			XmNokCallback, UnmanageThisCB, register_dialog_w);
+		XtAddCallback(register_dialog_w,
+			XmNhelpCallback, ImmediateHelpCB, 0);
+	}
+	else
+	{
+		arg = 0;
+		XtSetArg(args[arg], XmNset, !all_registers); arg++;
+		int_registers_w = 
+			XmCreateToggleButton(box, XMST("int_registers"), args, arg);
+		XtManageChild(int_registers_w);
+		arg = 0;
+		XtSetArg(args[arg], XmNset, all_registers); arg++;
+		all_registers_w = 
+		XmCreateToggleButton(box, XMST("all_registers"), args, arg);
+		XtManageChild(all_registers_w);
+		XtAddCallback(int_registers_w, XmNvalueChangedCallback, 
+			sourceSetIntRegistersCB, XtPointer(0));
+		XtAddCallback(all_registers_w, XmNvalueChangedCallback, 
+			sourceSetAllRegistersCB, XtPointer(0));
+		arg = 0;
+		register_list_w = XmSelectionBoxGetChild(register_dialog_w, XmDIALOG_LIST);
+		XtVaSetValues(register_list_w,XmNselectionPolicy,XmSINGLE_SELECT,XtPointer(0));
+		XtAddCallback(register_list_w,XmNsingleSelectionCallback,SelectRegisterCB,0);
+		XtAddCallback(register_list_w,XmNmultipleSelectionCallback, SelectRegisterCB, 0);
+		XtAddCallback(register_list_w,XmNextendedSelectionCallback, SelectRegisterCB, 0);
+		XtAddCallback(register_list_w,XmNbrowseSelectionCallback,SelectRegisterCB,0);
+		XtAddCallback(register_dialog_w,XmNokCallback,UnmanageThisCB,register_dialog_w);
+		XtAddCallback(register_dialog_w,XmNokCallback,RegisterDialogPoppedDownCB,0);
+		XtAddCallback(register_dialog_w,XmNhelpCallback,ImmediateHelpCB,0);
+	}
     // Create thread view
     arg = 0;
     XtSetArg(args[arg], XmNautoUnmanage, False); arg++;
@@ -5786,50 +5819,26 @@
     down_w->show();
     cancel_w->show();
 
-
     // Create register view
     std::vector<GUI::String> register_headers;
-    register_headers.push_back("One");
-    register_headers.push_back("Two");
-    register_headers.push_back("Three");
-    register_dialog_w = 
-	new GUI::SelectionDialog(*parent, "register_dialog", register_headers);
+    register_headers.push_back("Reg");
+    register_headers.push_back("Value");
+    register_dialog_w = new GUI::SelectionDialog(*parent, "register_dialog", register_headers);
     Delay::register_shell(register_dialog_w);
-
-
-    GUI::RadioBox *box = new GUI::RadioBox(*register_dialog_w,
-					   GUI::PACK_SHRINK,
-					   "box", GUI::ORIENTATION_HORIZONTAL);
-    box->show();
-
-    int_registers_w =
-	new GUI::RadioButton(*box, GUI::PACK_SHRINK, "int_registers", "Integer registers");
-    int_registers_w->set_active(!all_registers);
-    int_registers_w->show();
-    
-
-    all_registers_w =
-	new GUI::RadioButton(*box, GUI::PACK_SHRINK, "all_registers", "All registers");
-    all_registers_w->set_active(all_registers);
-    all_registers_w->show();
-
-    int_registers_w->signal_toggled().connect(sigc::bind(sigc::ptr_fun(sourceSetIntRegistersCB), int_registers_w));
-    all_registers_w->signal_toggled().connect(sigc::bind(sigc::ptr_fun(sourceSetAllRegistersCB), all_registers_w));
-
     register_list_w = register_dialog_w->list();
-
-    register_list_w->signal_selection_changed().connect(sigc::bind(sigc::ptr_fun(SelectRegisterCB),
-								   register_list_w));
-
+    register_list_w->signal_selection_changed().connect(sigc::bind(sigc::ptr_fun(SelectRegisterCB),register_list_w));
+    Pango::FontDescription fdesc;
+    fdesc.set_family("monospace");
+    fdesc.set_size(8 * PANGO_SCALE);
+    register_list_w->internal()->modify_font(fdesc);
     GUI::Button *button;
-    button = register_dialog_w->add_button("ok", _("OK"));
+    button = register_dialog_w->add_button("ok", _("Close"));
     button->signal_clicked().connect(sigc::bind(sigc::ptr_fun(UnmanageThisCB), register_dialog_w));
     button->show();
-    button = register_dialog_w->add_button("cancel", _("Cancel"));
-    button->signal_clicked().connect(sigc::ptr_fun(RegisterDialogPoppedDownCB));
+    button = register_dialog_w->add_button("settings", _("Settings"));
+    button->signal_clicked().connect(sigc::ptr_fun(ViewRegisterSettingsCB));
     button->show();
-
-
+    
     // Create thread view
     thread_dialog_w =
 	new GUI::Dialog(*parent, "thread_dialog");
@@ -5861,6 +5870,16 @@
     // Create remaining glyphs in the background
     CreateGlyphsNow();
 }
+
+void view_onRowActivated (GtkTreeView *treeview,GtkTreePath *path,
+        GtkTreeViewColumn *col,gpointer userdata)
+{
+   GtkTreeModel *model;
+   GtkTreeIter   iter;
+   g_print ("A row has been double-clicked!\n");
+   model = gtk_tree_view_get_model(treeview);
+}
+
 #endif
 
 #if defined(IF_XM)
@@ -11166,7 +11185,7 @@
 	set_sensitive(up_w, up_state);
 	set_sensitive(down_w, down_state);
     }
-    set_sensitive(all_registers_w, !set);
+//    set_sensitive(all_registers_w, !set);
     set_sensitive(int_registers_w, !set);
 
     refresh_buttons();
@@ -11457,16 +11476,176 @@
 
     split(register_output, register_list, count, '\n');
 
-    while (count > 0 && register_list[count - 1].empty())
-	count--;
-
-    for (int i = 0; i < count; i++)
-    {
-	tabto(register_list[i], 26);
-	untabify(register_list[i]);
-	selected[i] = false;
-    }
-
+	if(FirstTime || gdb->type() != GDB)	//FirstTime starts as false
+	{
+		while (count > 0 && register_list[count - 1].empty())
+			count--;
+	}
+	else
+	{
+		if((count > 2) && (gdb->type() == GDB))	//if you do not get a one line error message
+		{
+			source_view->ProgramArch = 0;	//x86_32 program
+			string archtype = gdb_question("show architecture");
+			if(archtype.length() > 2)
+			{
+				if(archtype.contains("64"))
+					source_view->ProgramArch = 1;	// if it is a x86_64 program
+			}
+			count = 16;			//count of  32 bit registers displayed
+			if(source_view->ProgramArch)
+				count = 24;		//64 bit registers displayed
+		}
+		else
+		{
+			while (count > 0 && register_list[count - 1].empty())
+				count--;
+		}
+		FirstTime = true;	//only one time in this routine
+	}
+	int j,i;
+	string tstr;
+	if(gdb->type() == GDB)
+	{
+		for (i = 0; i < count; i++)
+		{
+#if defined(IF_XM)
+			tabto(register_list[i], 26);
+			untabify(register_list[i]);
+#else
+         if(register_list[i].contains("\t"))
+         {
+            if(register_list[i].index("\t") < 23)
+            {
+               if(!register_list[i].contains("efl"))
+                  register_list[i].gsub("\t","\t\t");
+            }
+         }
+#endif 
+			if(register_list[i].contains("0x") || register_list[i].contains(",")
+				||register_list[i].contains("*"))
+			{
+				if(register_list[i].contains("*"))	//parse the line
+				{
+					int fR0 = register_list[i].index("*",0);
+					switch(fR0)		// make the printing come out even
+					{
+					case 3:
+						tstr = "      ";
+						break;
+					case 4:
+						tstr = "     ";
+						break;
+					case 5:
+						tstr = "    ";
+						break;
+					}
+					register_list[i] = register_list[i].at(0,fR0) + tstr +
+						register_list[i].at(fR0+1,register_list[i].length()-fR0-1);
+					if(fR0 == 3)		// this was a floating point register or mmx
+					{
+						j = register_list[i][2] & 7;
+						if(source_view->mmregs[j] == -1)
+						{
+							for(j = i;j < count-1;j++)
+								register_list[j] = register_list[j+1];
+							count--;
+							i--;
+						}
+					}	//if no st-mmx registers were chosen as floating point
+					if(register_list[i][0] == 'f' && (!source_view->xmregp & 4))
+					{	// then remove the floating point status registers
+						for(j = i;j < count-1;j++)
+							register_list[j] = register_list[j+1];
+						count--;
+						i--;
+					}	//check for mmx register
+					if(register_list[i][0] == 'm' && register_list[i][1] == 'm')
+					{
+						j = (int)register_list[i][2] & 7;	//get the number -- mm3
+						if(source_view->mmregs[j] == -1)	//if the register is masked for printing
+						{
+							for(j = i;j < count-1;j++)
+								register_list[j] = register_list[j+1];
+							count--;
+							i--;
+						}
+					}
+				}
+				else
+				{	// floating point status registers and mxcsr
+				 	if((register_list[i][0] == 'f' && register_list[i][2] != ' ' &&
+						((source_view->xmregp & 4) == 0)) ||	//no floating point or mmx displayed
+						(register_list[i][0] == 'm' && register_list[i][1] == 'x' &&
+						(!source_view->xmregp & 1)))	// no xmm register is displayed
+					{	//remove the string
+						for(j = i;j < count-1;j++)
+							register_list[j] = register_list[j+1];
+						count--;	//decrease the line count
+						i--;
+					}
+					else
+					{
+						register_list[i] = register_list[i].at(0,9)+
+							register_list[i].at(15,register_list[i].length()-15);
+						int m = register_list[i].index("0x",-1);
+						if(m > 9)	//to get rid of the double printing of the hex value
+						{				//but the decimal value will not be removed
+							int n = 9;
+							int p = register_list[i].length();
+							for(;m < p;m++,n++)
+								register_list[i][n] = register_list[i][m];
+							register_list[i][n] = 0;
+						}
+					}
+				}	//parse the floating point - mmx registers
+				if(source_view->ProgramArch == 1 && register_list[i].contains("st",0))
+				{ // get the register number
+					j = (int)register_list[i][register_list[i].index("st") + 2] & 7;
+					if(source_view->mmregs[j] != -1)
+						//gdb hack for not displaying mmx in 64 bit mode - see below
+						register_list[i] = Gdb64MMXWorkaround(register_list[i]);
+					else
+					{	// if masked - remove
+						if(source_view->RegisterDisplay > 1)
+						{
+							for(j = i;j < count-1;j++)
+								register_list[j] = register_list[j+1];
+							count--;
+							i--;
+						}
+					}
+				}
+				for(int k = 0;k < 24;k++)
+				{	// check for integer,eflags,ip,segment registers
+					if(source_view->Masked[k])
+					{	//get the correct mask
+						if(source_view->ProgramArch == 0)
+							j = register_list[i].index(regsTxt[k]);
+						else
+							j = register_list[i].index(regsTxt64[k]);
+						if(j == 0)
+						{	//remove the line
+							for(j = i;j < count-1;j++)
+								register_list[j] = register_list[j+1];
+							count--;
+							i--;
+						}
+					}
+				}
+			}
+			selected[i] = false;
+		}
+	}
+	else
+	{	// if not GDB
+	    for (i = 0; i < count; i++)
+   	 {
+			tabto(register_list[i], 26);
+			untabify(register_list[i]);
+			selected[i] = false;
+	    }
+	}
 #if defined(IF_XM)
     setLabelList(register_list_w, register_list, selected, count,
 		 false, false);
@@ -11479,17 +11658,110 @@
     delete[] selected;
 }
 
+//Hack for gdb missing mmx registers in 64bit mode - hope gdb fixes this later
+string SourceView::Gdb64MMXWorkaround(string& transin)
+{	//translate the nan output to the normal nnx output
+	string transx = "mm0      (0x";
+	transx[2] = transin[2];
+	int k = transin.length();
+	int i = (int)transin[2] - '0';
+	if(transin.contains("nan"))
+	{
+		int j;
+		int m = 17;
+		string transtr;
+		for(j = k;transin[j-1] != 'x';j--)
+			m--;
+		for(;m > 0;m--)
+			transtr += "0";
+		for(;j < k-1;j++)
+			transtr += transin[j];
+		switch(source_view->mmregs[i])
+		{
+		case 1:
+			for(i = 14;i >= 0;i -= 2)
+			{
+				transx += transtr[i];
+				transx += transtr[i+1];
+				if(i != 0)
+					transx += ",0x";
+			}
+			transx += ")";
+			break;
+		case 2:
+			for(i = 12;i >= 0;i -= 4)
+			{
+				for(j = i;j < i+4;j++)
+					transx += transtr[j];
+				if(i != 0)
+					transx += ",0x";
+			}
+			transx += ")";
+			break;
+		case 3:
+			for(j = 8;j < 16;j++)
+				transx += transtr[j];
+			transx += ",0x";
+			for(j = 0;j < 8;j++)
+				transx += transtr[j];
+			transx += ")";
+			break;
+		case 4:
+			transx += transtr;
+			transx += ")";
+			break;
+		default:
+			transx = transin;
+			break;
+		}
+	}	// 32 bit gives '0' but 64 bit gives '-inf'
+	else if(((k == 10 && transin[9] == '0') || transin.contains("-inf")) &&
+		source_view->mmregs[i] > 0 )
+	{
+		switch(source_view->mmregs[i])
+		{
+		case 1:				
+			transx += "00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)";
+			break;
+		case 2:			
+			transx += "0000,0x0000,0x0000,0x0000)";
+			break;
+		case 3:
+			transx += "00000000,0x00000000)";
+			break;
+		case 4:
+			transx += "0000000000000000)";
+			break;
+		}
+	}
+	else
+		transx = transin;
+return transx;
+}
+
 void SourceView::refresh_registers()
 {
-    string registers = gdb_question(refresh_registers_command());
-    if (registers == NO_GDB_ANSWER)
-	registers = "No registers.";
+   string registers = gdb_question(refresh_registers_command());
+   if (registers == NO_GDB_ANSWER)
+      registers = "No registers.";
+	if(gdb->type() == GDB)
+	{
+		if(registers[0] == '>' && registers[1] == '>')
+			registers = gdb_question(refresh_registers_command());
+	 	if(registers.contains("(gdb) "))	//this get rid of the extra trash
+			registers = registers.after("(gdb) ");	//that sometimes appears
+	}
     process_registers(registers);
 }
 
 string SourceView::refresh_registers_command()
 {
-    return gdb->regs_command(all_registers);
+	if(gdb->type() != GDB)
+    	return gdb->regs_command(all_registers);
+	if(source_view->RegisterDisplay == 0)
+		return "info registers";	//integer registers
+	else	// modified registers
+		return "vfdbl";
 }
 
 #if defined(IF_XM)
@@ -11502,9 +11774,13 @@
 #else
 void SourceView::ViewRegistersCB(GUI::Widget *)
 {
+    if(source_view->ProgramArch == 0)
+      register_dialog_w->set_default_size(200,380);
+    else
+      register_dialog_w->set_default_size(200,535);
     refresh_registers();
     manage_and_raise(register_dialog_w);
-    register_dialog_popped_up = true;
+    register_dialog_popped_up = true;    
 }
 #endif
 
@@ -11513,12 +11789,16 @@
 {
     register_dialog_popped_up = false;
 }
+#endif
+
+#if defined(IF_XM)
+void SourceView::ViewRegisterSettingsCB(Widget, XtPointer, XtPointer)
 #else
-void SourceView::RegisterDialogPoppedDownCB (void)
+void SourceView::ViewRegisterSettingsCB (void)
+#endif
 {
-    register_dialog_popped_up = false;
+     StartupRegisterSettings(source_view->Masked);
 }
-#endif
 
 #if defined(IF_XM)
 void SourceView::SelectRegisterCB (Widget, XtPointer, XtPointer call_data)
@@ -11534,17 +11814,26 @@
     XmStringGetLtoR(cbs->item, LIST_CHARSET, &_item);
     string item(_item);
     free(_item);
-#else
-    string item = w->get_selected().c_str();
-#endif
-
     if (!item.empty() && item[item.length() - 1] != '.')
     {
 	string regname = item.through(rxidentifier);
 	strip_space(regname);
-	item = "$" + regname;
-	source_arg->set_string(item);
+	item = "$" + regname + " =";  // '$(register) =' appears in the window. just fill in a value and press print 
+	source_arg->set_string(item); //This will update the value
     }
+#else
+   if(w->get_selected_pos() >= 0)
+   {
+      string item = w->get_selected().c_str(); //causes crashes in the register window the first time NEXT is pressed FIX!!
+      if (!item.empty() && item[item.length() - 1] != '.') // FIXED -- If there is no selected position, when the listview is refreshed,
+      {                                                     // w->get_selected_pos() will return -1 and cause w->get_selected() an error.
+         string regname = item.through(rxidentifier);
+         strip_space(regname);
+         item = "$" + regname + " =";  // '$(register) =' appears in the window. just fill in a value and press print 
+         source_arg->set_string(item); //This will update the value
+      }
+   }
+ #endif
 }
 
 //-----------------------------------------------------------------------------
@@ -12631,9 +12920,9 @@
 	    {
 		multi_stops[k][i] = 
 		    create_glyph(form_w, "multi_stop",
-				 multistop_bits, 
-				 multistop_width,
-				 multistop_height);
+				 stop_bits, 
+				 stop_width,
+				 stop_height);
 		return False;
 	    }
 	}
@@ -14777,11 +15066,6 @@
 	    XmToggleButtonSetState(all_registers_w, (Boolean)set, False);
 	if (int_registers_w)
 	    XmToggleButtonSetState(int_registers_w, !(Boolean)set, False);
-#else
-	if (all_registers_w)
-	    all_registers_w->set_active(set, false);
-	if (int_registers_w)
-	    int_registers_w->set_active(!set, false);
 #endif
 
 	refresh_registers();

--- gddd/ddd/SourceView.h	2013-05-17 19:55:05.000000000 +0200
+++ gddd/ddd/SourceView.h	2013-05-19 18:43:15.259182392 +0200
@@ -224,6 +224,7 @@
 
     static void SetWatchModeCB(Widget, XtPointer, XtPointer);
     static void ActivateGlyphCB(Widget, XtPointer, XtPointer);
+   static void ViewRegisterSettingsCB(Widget, XtPointer, XtPointer);
 #else
     static void UpdateBreakpointButtonsCB (void);
 
@@ -232,16 +233,15 @@
 
     static void CheckModificationCB(GUI::Widget *, bool editable);
 
-    static void StackDialogPoppedDownCB    (void);
-    static void CodeDialogPoppedDownCB     (void);
-    static void RegisterDialogPoppedDownCB (void);
-    static void ThreadDialogPoppedDownCB   (void);
+    static void StackDialogPoppedDownCB      (void);
+    static void CodeDialogPoppedDownCB       (void);
+    static void ThreadDialogPoppedDownCB     (void);
+    static void ViewRegisterSettingsCB       (void);
 
     static void SelectFrameCB    (GUI::ListView *);
     static void SelectRegisterCB (GUI::ListView *);
     static void SelectThreadCB   (GUI::Widget *);
     static void ThreadCommandCB  (GUI::Widget *, const char *);
-
     static void SetWatchModeCB(int);
 #endif
 
@@ -517,8 +517,8 @@
 #else
     static GUI::SelectionDialog *register_dialog_w;    // Dialog for registers
     static GUI::ListView *register_list_w;             // Register list inside
-    static GUI::RadioButton *int_registers_w;          // Display integer registers
-    static GUI::RadioButton *all_registers_w;          // Display all registers
+    static GUI::Button *int_registers_w;          // Display integer registers
+ //   static GUI::RadioButton *all_registers_w;          // Display all registers
 #endif
     static bool register_dialog_popped_up;    // True if registers are visible
 
@@ -821,6 +821,52 @@
     // Additional offset for multiple breakpoints (pixels)
     static Position multiple_stop_x_offset;
 
+	//New register data and strings
+	bool RegsSaved;
+	int	xmregp;
+	int	LastClicked;
+	int	XmmSet;
+	int	mmSet;
+	int	RegisterDisplay;
+	int	ProgramArch;
+	int	xmregs[16];
+	int	mmregs[8];
+	int	Masked[24];
+	int	saved_xmregs[16];
+	int	saved_mmregs[8];
+	int	saved_Masked[24];
+	char	vfdblStr[20];
+	char	fltStr[148];
+	char	fltstat[188];
+	char	mmx8x[28];
+	char	mmx16x[28];
+	char	mmx32x[28];
+	char	mmx64x[28];
+	char	xmmfloat[32];
+	char	xmmfloat10[32];
+	char	xmmdouble[32];
+	char	xmmdouble10[36];
+	char	xmmint8[32];
+	char	xmmint810[32];
+	char	xmmint16[32];
+	char	xmmint1610[32];
+	char	xmmint32[32];
+	char	xmmint3210[32];
+	char	xmmint64[32];
+	char	xmmint6410[32];
+	char	xmmint128[32];
+	char	xmmint12810[32];
+	char	xmmint256[32];
+	char	xmmint25610[32];
+	char	endit[6];
+	char	mxcsr[24];
+	char	*regStrPt[18];
+#if defined(IF_XM)
+	Widget box;
+#else
+   GUI::Widget *box;
+#endif
+
 private:
 #if defined(IF_XM)
     // Glyph locations: X[0] is source, X[1] is code
@@ -860,6 +906,7 @@
     static GUI::ImageHandle drag_cond;
     static GUI::ImageHandle drag_temp;
 #endif
+    static string Gdb64MMXWorkaround(string& transtr);
 
 #if defined(IF_XM)
     // Return position POS of glyph GLYPH in X/Y.  Return true iff displayed.
@@ -882,6 +929,7 @@
 				       const GUI::ImageHandle &stop,
 				       TextPositionArray& positions);
     static GUI::GlyphMark *map_arrow_at(GUI::ScrolledText *w, long pos);
+    
 #endif
 #if defined(IF_XM)
     static Widget map_drag_arrow_at(Widget w, XmTextPosition pos,
