+void
+cl_uc::build_cmdset(class cl_cmdset *cmdset)
+{
+ class cl_cmd *cmd;
+ class cl_super_cmd *super_cmd;
+ class cl_cmdset *cset;
+
+ cmdset->add(cmd= new cl_state_cmd("state", 0,
+"state State of microcontroller",
+"long help of state"));
+ cmd->init();
+
+#ifdef STATISTIC
+ cmdset->add(cmd= new cl_statistic_cmd("statistic", 0,
+"statistic [mem [startaddr [endaddr]]]\n"
+" Statistic of memory accesses",
+"long help of statistic"));
+ cmd->init();
+#endif
+
+ cmdset->add(cmd= new cl_file_cmd("file", 0,
+"file \"FILE\" Load FILE into ROM",
+"long help of file"));
+ cmd->init();
+ cmd->add_name("load");
+
+ cmdset->add(cmd= new cl_dl_cmd("download", 0,
+"download Load (intel.hex) data",
+"long help of download"));
+ cmd->init();
+ cmd->add_name("dl");
+
+ cmdset->add(cmd= new cl_pc_cmd("pc", 0,
+"pc [addr] Set/get PC",
+"long help of pc"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_reset_cmd("reset", 0,
+"reset Reset",
+"long help of reset"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_dump_cmd("dump", DD_TRUE,
+"dump memory_type [start [stop [bytes_per_line]]]\n"
+" Dump memory of specified type\n"
+"dump bit... Dump bits",
+"long help of dump"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_dch_cmd("dch", DD_TRUE,
+"dch [start [stop]] Dump code in hex form",
+"long help of dch"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_dc_cmd("dc", DD_TRUE,
+"dc [start [stop]] Dump code in disass form",
+"long help of dc"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_disassemble_cmd("disassemble", DD_TRUE,
+"disassemble [start [offset [lines]]]\n"
+" Disassemble code",
+"long help of disassemble"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_fill_cmd("fill", 0,
+"fill memory_type start end data\n"
+" Fill memory region with data",
+"long help of fill"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_where_cmd("where", 0,
+"where memory_type data...\n"
+" Case unsensitive search for data",
+"long help of where"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_Where_cmd("Where", 0,
+"Where memory_type data...\n"
+" Case sensitive search for data",
+"long help of Where"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_break_cmd("break", 0,
+"break addr [hit] Set fix breakpoint\n"
+"break mem_type r|w addr [hit]\n"
+" Set fix event breakpoint",
+"long help of break"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_tbreak_cmd("tbreak", 0,
+"tbreak addr [hit] Set temporary breakpoint\n"
+"tbreak mem_type r|w addr [hit]\n"
+" Set temporary event breakpoint",
+"long help of tbreak"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_clear_cmd("clear", 0,
+"clear [addr...] Clear fix breakpoint",
+"long help of clear"));
+ cmd->init();
+
+ cmdset->add(cmd= new cl_delete_cmd("delete", 0,
+"delete [nr...] Delete breakpoint(s)",
+"long help of clear"));
+ cmd->init();
+
+ {
+ super_cmd= (class cl_super_cmd *)(cmdset->get_cmd("get"));
+ if (super_cmd)
+ cset= super_cmd->commands;
+ else {
+ cset= new cl_cmdset();
+ cset->init();
+ }
+ cset->add(cmd= new cl_get_sfr_cmd("sfr", 0,
+"get sfr address...\n"
+" Get value of addressed SFRs",
+"long help of get sfr"));
+ cmd->init();
+ /*cset->add(cmd= new cl_get_option_cmd("option", 0,
+"get option name\n"
+" Get value of an option",
+"long help of get option"));
+cmd->init();*/
+ }
+ if (!super_cmd)
+ {
+ cmdset->add(cmd= new cl_super_cmd("get", 0,
+"get subcommand Get, see `get' command for more help",
+"long help of get", cset));
+ cmd->init();
+ }
+
+ {
+ super_cmd= (class cl_super_cmd *)(cmdset->get_cmd("set"));
+ if (super_cmd)
+ cset= super_cmd->commands;
+ else {
+ cset= new cl_cmdset();
+ cset->init();
+ }
+ cset->add(cmd= new cl_set_mem_cmd("memory", 0,
+"set memory memory_type address data...\n"
+" Place list of data into memory",
+"long help of set memory"));
+ cmd->init();
+ cset->add(cmd= new cl_set_bit_cmd("bit", 0,
+"set bit addr 0|1 Set specified bit to 0 or 1",
+"long help of set bit"));
+ cmd->init();
+ cset->add(cmd= new cl_set_hw_cmd("hardware", 0,
+"set hardware cathegory params...\n"
+" Set parameters of specified hardware element",
+"long help of set hardware"));
+ cmd->add_name("hw");
+ cmd->init();
+ }
+ if (!super_cmd)
+ {
+ cmdset->add(cmd= new cl_super_cmd("set", 0,
+"set subcommand Set, see `set' command for more help",
+"long help of set", cset));
+ cmd->init();
+ }
+
+ { // info
+ super_cmd= (class cl_super_cmd *)(cmdset->get_cmd("info"));
+ if (super_cmd)
+ cset= super_cmd->get_subcommands();
+ else {
+ cset= new cl_cmdset();
+ cset->init();
+ }
+ cset->add(cmd= new cl_info_bp_cmd("breakpoints", 0,
+"info breakpoints Status of user-settable breakpoints",
+"long help of info breakpoints"));
+ cmd->add_name("bp");
+ cmd->init();
+ cset->add(cmd= new cl_info_reg_cmd("registers", 0,
+"info registers List of integer registers and their contents",
+"long help of info registers"));
+ cmd->init();
+ cset->add(cmd= new cl_info_hw_cmd("hardware", 0,
+"info hardware cathegory\n"
+" Status of hardware elements of the CPU",
+"long help of info hardware"));
+ cmd->add_name("hw");
+ cmd->init();
+ cset->add(cmd= new cl_info_stack_cmd("stack", 0,
+"info stack Status of stack of the CPU",
+"long help of info stack"));
+ cmd->init();
+ cset->add(cmd= new cl_info_memory_cmd("memory", 0,
+"info memory Information about memory system",
+"long help of info memory"));
+ cmd->init();
+ }
+ if (!super_cmd) {
+ cmdset->add(cmd= new cl_super_cmd("info", 0,
+"info subcommand Information, see `info' command for more help",
+"long help of info", cset));
+ cmd->init();
+ }
+
+ {
+ super_cmd= (class cl_super_cmd *)(cmdset->get_cmd("timer"));
+ if (super_cmd)
+ cset= super_cmd->get_subcommands();
+ else {
+ cset= new cl_cmdset();
+ cset->init();
+ }
+ cset->add(cmd= new cl_timer_add_cmd("add", 0,
+"timer add id [direction [in_isr]]\n"
+" Create a clock counter (timer)",
+"log help of timer add"));
+ cmd->init();
+ cmd->add_name("create");
+ cmd->add_name("make");
+ cset->add(cmd= new cl_timer_delete_cmd("delete", 0,
+"timer delete id Delete a timer",
+"long help of timer delete"));
+ cmd->init();
+ cmd->add_name("remove");
+ cset->add(cmd= new cl_timer_get_cmd("get", 0,
+"timer get [id] Get value of a timer, or all",
+"long help of timer get"));
+ cmd->init();
+ cset->add(cmd= new cl_timer_run_cmd("run", 0,
+"timer start id Start a timer",
+"long help of timer run"));
+ cmd->init();
+ cmd->add_name("start");
+ cset->add(cmd= new cl_timer_stop_cmd("stop", 0,
+"timer stop id Stop a timer",
+"long help of timer stop"));
+ cmd->init();
+ cset->add(cmd= new cl_timer_value_cmd("set", 0,
+"timer set id value\n"
+" Set a timer value",
+"long help of timer set"));
+ cmd->init();
+ cmd->add_name("value");
+ }
+ if (!super_cmd) {
+ cmdset->add(cmd= new cl_super_cmd("timer", 0,
+"timer subcommand Manage timers",
+"long help of timer", cset));
+ cmd->init();
+ }
+
+ {
+ super_cmd= (class cl_super_cmd *)(cmdset->get_cmd("memory"));
+ if (super_cmd)
+ cset= super_cmd->get_subcommands();
+ else {
+ cset= new cl_cmdset();
+ cset->init();
+ }
+ /*
+ cset->add(cmd= new cl_memory_cmd("_no_parameters_", 0,
+"memory Information about memory system",
+"long help of memory"));
+ cmd->init();
+ */
+ cset->add(cmd= new cl_memory_createchip_cmd("createchip", 0,
+"memory createchip id size cellsize\n"
+" Create a new memory chip",
+"long help of memory createchip"));
+ cmd->init();
+ cmd->add_name("cchip");
+ cset->add(cmd= new cl_memory_createaddressspace_cmd("createaddressspace", 0,
+"memory createaddressspace id startaddr size\n"
+" Create address space",
+"long help of memory createaddressspace"));
+ cmd->init();
+ cmd->add_name("createaddrspace");
+ cmd->add_name("createaspace");
+ cmd->add_name("caddressspace");
+ cmd->add_name("caddrspace");
+ cmd->add_name("caspace");
+ cset->add(cmd= new cl_memory_createaddressdecoder_cmd("createaddressdecoder", 0,
+"memory createaddressdecoder addressspace begin end chip begin\n"
+" Create address decoder",
+"long help of memory createaddressdecoder"));
+ cmd->init();
+ cmd->add_name("createaddrdecoder");
+ cmd->add_name("createadecoder");
+ cmd->add_name("caddressdecoder");
+ cmd->add_name("caddrdecoder");
+ cmd->add_name("cadecoder");
+ }
+ if (!super_cmd) {
+ cmdset->add(cmd= new cl_super_cmd("memory", 0,
+"memory subcommand Manage memory chips and address spaces",
+"long help of memory", cset));
+ cmd->init();
+ }
+}
+