#include "whptexec.h"
#include "whpt.h"


STRINGTABLE LOADONCALL MOVEABLE DISCARDABLE
{
;new CLI registration
  30, "whptexec"
  31, "whptexec.dll"
  32, "0"
;  32, "2"
;  33, "BkptNonmask"
;  34, "WhptSetBkptNonmask"
;  35, "h:BkptNonMask [enable|disable]"
;  36, "ISCT_SER"
;  37, "WhptSetISCT_SER"
;  38, "h:ISCT_SER <value>"
}

IWatchpoint DIALOG 19, 17, 227, 173
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "I-Watchpoint"
BEGIN
	LTEXT "Condition", -1, 73, 13, 35, 10, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "Address", -1, 168, 13, 30, 10, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "I-addr  (A)", -1, 13, 25, 33, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "Equal", IDC_I_A_CONDITION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 58, 25, 75, 58
	CONTROL "", IDC_I_A_ADDRESS, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 143, 25, 75, 12
	LTEXT "I-addr  (B)", -1, 13, 41, 33, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "Equal", IDC_I_B_CONDITION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 58, 41, 75, 58
	CONTROL "", IDC_I_B_ADDRESS, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 143, 41, 75, 12
	LTEXT "I-addr  (C)", -1, 13, 57, 33, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "Equal", IDC_I_C_CONDITION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 58, 57, 75, 58
	CONTROL "", IDC_I_C_ADDRESS, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 143, 57, 75, 12
	LTEXT "I-addr  (D)", -1, 13, 73, 33, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "Equal", IDC_I_D_CONDITION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 58, 73, 75, 58
	CONTROL "", IDC_I_D_ADDRESS, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 143, 73, 75, 12
	CONTROL "Instruction address", 103, "button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 6, 2, 216, 88
	CONTROL "Instruction Watchpoints", 104, "button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 6, 94, 216, 54
	LTEXT "break", -1, 34, 107, 21, 8
	LTEXT "break", -1, 141, 107, 21, 8
	LTEXT "IW0", -1, 16, 118, 15, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
	CHECKBOX "", IDC_I_IW0_BREAK, 40, 117, 8, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	CONTROL "", IDC_I_IW0_RELATION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_GROUP | WS_TABSTOP, 53, 116, 55, 40
	LTEXT "IW2", -1, 125, 118, 15, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
	CHECKBOX "", IDC_I_IW2_BREAK, 148, 117, 8, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	CONTROL "", IDC_I_IW2_RELATION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_GROUP | WS_TABSTOP, 162, 116, 55, 40
	LTEXT "IW1", -1, 16, 133, 15, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
	CHECKBOX "", IDC_I_IW1_BREAK, 40, 133, 8, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	CONTROL "", IDC_I_IW1_RELATION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 53, 132, 55, 40
	LTEXT "IW3", -1, 125, 133, 15, 9, WS_CHILD | WS_VISIBLE | WS_GROUP
	CHECKBOX "", IDC_I_IW3_BREAK, 148, 133, 8, 10, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	CONTROL "", IDC_I_IW3_RELATION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_GROUP | WS_TABSTOP, 162, 132, 55, 40
	PUSHBUTTON "&OK", IDC_I_OK, 29, 156, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	PUSHBUTTON "&Cancel", IDC_I_CANCEL, 90, 156, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	PUSHBUTTON "&Help", IDC_HELP, 151, 156, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END

LWatchpoint DIALOG 2, -103, 289, 196
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "L-Watchpoint"
BEGIN
	LTEXT "condition", -1, 62, 12, 38, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "address", -1, 132, 11, 38, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "read/write", -1, 186, 11, 42, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "L-addr (E)", -1, 12, 24, 35, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "", IDC_L_E_CONDITION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 49, 22, 60, 58
	CONTROL "", IDC_L_E_ADDRESS, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 119, 22, 61, 12
	CONTROL "", IDC_L_E_RW, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 185, 22, 52, 42
	LTEXT "L-addr (F)", -1, 12, 38, 35, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "", IDC_L_F_CONDITION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 49, 37, 60, 58
	CONTROL "", IDC_L_F_ADDRESS, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 119, 37, 61, 12
	CONTROL "", IDC_L_F_RW, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 185, 37, 52, 42
	LTEXT "condition", -1, 59, 67, 35, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "signed", -1, 102, 66, 25, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "data", -1, 142, 67, 16, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "mask", -1, 195, 67, 20, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "size", -1, 247, 67, 16, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "L-data (G)", -1, 10, 79, 35, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "", IDC_L_G_CONDITION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 46, 76, 60, 58
	CONTROL "", IDC_L_G_SIGNED, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 109, 76, 10, 12
	CONTROL "", IDC_L_G_DATA, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 119, 76, 60, 12
	CONTROL "", IDC_L_G_MASK, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 182, 76, 49, 50
	CONTROL "", IDC_L_G_SIZE, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 233, 76, 47, 50
	LTEXT "L-data (H)", -1, 10, 92, 35, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "", IDC_L_H_CONDITION, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 46, 91, 60, 58
	CONTROL "", IDC_L_H_SIGNED, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 109, 90, 10, 12
	EDITTEXT IDC_L_H_DATA, 119, 91, 60, 12
	CONTROL "", IDC_L_H_MASK, "COMBOBOX", CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 182, 91, 49, 50
	CONTROL "", IDC_L_H_SIZE, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 233, 91, 47, 50
	LTEXT "break", -1, 57, 124, 24, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "IWatchpoint", -1, 89, 124, 40, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "L-addr", -1, 164, 124, 20, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "L-data", -1, 224, 124, 30, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "LWatchpoint0", -1, 9, 136, 50, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "", IDC_L_LW0_ENABLE, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 64, 135, 10, 12
	CONTROL "", IDC_L_LW0_IW, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 84, 134, 55, 58
	CONTROL "", IDC_L_LW0_LADDR, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 149, 134, 55, 58
	CONTROL "", IDC_L_LW0_LDATA, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 214, 134, 55, 58
	LTEXT "LWatchpoint1", -1, 9, 150, 50, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "", IDC_L_LW1_ENABLE, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 64, 149, 10, 12
	CONTROL "", IDC_L_LW1_IW, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 84, 149, 55, 58
	CONTROL "", IDC_L_LW1_LADDR, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 149, 149, 55, 58
	CONTROL "", IDC_L_LW1_LDATA, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 214, 149, 55, 58
	PUSHBUTTON "&OK", IDC_L_OK, 43, 177, 55, 16, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	PUSHBUTTON "&Cancel", IDC_L_CANCEL, 113, 177, 55, 16, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	CONTROL "Load/Restore Address", 205, "button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 4, -1, 280, 53
	CONTROL "Load/Restore Data", 205, "button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 4, 55, 280, 51
	CONTROL "Load/Restore Watchpoints", 205, "button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 4, 112, 280, 53
	PUSHBUTTON "&Help", IDC_HELP, 182, 177, 55, 16, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END

Counter DIALOG 18, -29, 162, 92
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Counter"
BEGIN
	LTEXT "enable", -1, 39, 6, 25, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "count", -1, 78, 6, 20, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "IW0", -1, 120, 9, 20, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "LW0", -1, 140, 9, 20, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "Count-A", -1, 10, 20, 30, 10, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "", IDC_C_A_ENABLE, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 45, 17, 10, 12
	EDITTEXT IDC_C_A_COUNT, 65, 18, 45, 12
	RADIOBUTTON "", IDC_C_A_IW0, 125, 19, 10, 12, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	RADIOBUTTON "", IDC_C_A_LW0, 145, 19, 10, 12, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	LTEXT "enable", -1, 39, 37, 25, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "count", -1, 78, 37, 20, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "IW1", -1, 120, 40, 20, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "LW1", -1, 140, 40, 20, 8, WS_CHILD | WS_VISIBLE | WS_GROUP
	LTEXT "Count-B", -1, 10, 47, 30, 10, WS_CHILD | WS_VISIBLE | WS_GROUP
	CONTROL "", IDC_C_B_ENABLE, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 45, 47, 10, 12
	EDITTEXT IDC_C_B_COUNT, 65, 47, 45, 12
	RADIOBUTTON "", IDC_C_B_IW1, 125, 50, 10, 12, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	RADIOBUTTON "", IDC_C_B_LW1, 145, 50, 10, 12, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	PUSHBUTTON "&OK", IDC_C_OK, 12, 74, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	PUSHBUTTON "&Cancel", IDC_C_CANCEL, 61, 74, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
	PUSHBUTTON "&Help", IDC_HELP, 110, 74, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END

WatchPoint_Menu MENU 
BEGIN
	POPUP "&File"
	BEGIN
		MENUITEM "E&xit", IDM_MENU_EXIT
	END

	POPUP "W&atchpoint"
	BEGIN
		MENUITEM "&I-Watchpoint...", IDM_IWATCHPOINT
		MENUITEM "&L-Watchpoint...", IDM_LWATCHPOINT
		MENUITEM "&Counter...", IDM_COUNTER
		MENUITEM SEPARATOR
		MENUITEM "Watchpoints &Nonmasked", IDM_NONMASK_BIT
                MENUITEM "IW2&&IW3 used as &Breakpoints", IDM_ENABLEHWBKPT
	END

	POPUP "&Windows"
	BEGIN
		MENUITEM "&Breakpoint", IDM_EVTWBKPT
		MENUITEM "&Cpu", IDM_EVTWCPU
		MENUITEM "&Memory", IDM_EVTWMEMORY
		MENUITEM "&Peripheral", IDM_EVTWPERIPHERAL
		MENUITEM "S&hell", IDM_EVTWSHELL
		MENUITEM "&Source", IDM_EVTWSOURCE
		MENUITEM "S&tack", IDM_EVTWSTACK
		MENUITEM "Stat&us", IDM_EVTWSTATUS
		MENUITEM "T&oolbar", IDM_EVTWTOOLBAR
		MENUITEM "&Variable", IDM_EVTWVARIABLE
		MENUITEM "&Watchpoint", IDM_EVTWWATCHPOINT
	END

	POPUP "&Help"
	BEGIN
		MENUITEM "Help &Index", IDM_HELP
		MENUITEM "&Help With Help", IDM_HLPHLP
		MENUITEM SEPARATOR
		MENUITEM "Help With &Watchpoint", IDM_HLPWHPT
	END

END


WATCHPOINT ICON 
BEGIN
	'00 00 01 00 01 00 20 20 10 00 00 00 00 00 E8 02'
	'00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00'
	'00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00'
	'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
	'00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00'
	'00 00 80 00 80 00 80 80 00 00 80 80 80 00 C0 C0'
	'C0 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00'
	'00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 00'
	'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
	'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
	'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
	'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
	'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
	'00 00 FF FF FF FF FF FF FF FF F0 00 00 00 00 00'
	'00 0F FF FF FF FF FF FF FF FF FF 00 00 00 00 00'
	'00 FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'00 FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'0F FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'0F FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'FF FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'FF FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'FF FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'FF FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'FF FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'FF FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'FF FF FF FF FF FF FF FF FF FF FF F0 00 00 00 00'
	'FF FF 0F FF F0 FF FF 0F FF F0 FF F0 00 00 00 00'
	'FF FF 0F FF F0 FF FF 0F FF F0 FF F0 00 00 00 00'
	'FF FF 0F FF F0 FF FF 0F FF F0 FF F0 00 00 00 00'
	'FF FF 0F FF F0 FF FF 0F FF F0 FF F0 00 00 00 00'
	'FF FF 0F FF F0 FF FF 0F FF F0 FF F0 00 00 00 00'
	'FF FF 0F FF F0 FF FF 0F FF F0 FF F0 00 00 00 00'
	'00 00 0F FF F0 FF FF 0F FF F0 FF F0 00 00 00 00'
	'00 00 0F FF F0 FF FF 0F FF F0 FF F0 00 00 00 00'
	'00 00 0F FF F0 FF FF 0F FF F0 00 00 00 00 00 00'
	'00 00 0F FF F0 FF FF 0F FF F0 00 00 00 00 00 00'
	'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
	'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
	'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
	'00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF'
	'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00'
	'00 7F FE 00 00 3F FC 00 00 1F F8 00 00 0F F8 00'
	'00 0F F0 00 00 0F F0 00 00 0F E0 00 00 0F E0 00'
	'00 0F E0 00 00 0F E0 00 00 0F E0 00 00 0F E0 00'
	'00 0F E0 00 00 0F E0 00 00 0F E0 00 00 0F E0 00'
	'00 0F E0 00 00 0F E0 00 00 0F E0 00 00 0F F0 00'
	'00 0F FF 00 00 0F FF 00 00 1F FF 00 00 FF FF 80'
	'00 FF FF FF FF FF FF FF FF FF FF FF FF FF'
END

