-}
-
-
-/*
- * Command: reset
- *----------------------------------------------------------------------------
- */
-
-int
-cl_reset_cmd::do_work(class cl_sim *sim,
- class cl_cmdline *cmdline, class cl_console *con)
-{
- sim->uc->reset();
- return(0);
-}
-
-
-/*
- * Command: dump
- *----------------------------------------------------------------------------
- */
-
-int
-cl_dump_cmd::do_work(class cl_sim *sim,
- class cl_cmdline *cmdline, class cl_console *con)
-{
- class cl_mem *mem= 0;
- long bpl= 8;
- t_addr start= 0, end;
- class cl_cmd_arg *params[4]= { cmdline->param(0),
- cmdline->param(1),
- cmdline->param(2),
- cmdline->param(3) };
-
- if (params[0] &&
- params[0]->as_bit(sim->uc))
- {
- int i= 0;
- while (params[0] &&
- params[0]->as_bit(sim->uc))
- {
- t_mem m;
- mem= params[0]->value.bit.mem;
- m= mem->read(params[0]->value.bit.mem_address);
- char *sn=
- sim->uc->symbolic_bit_name((t_addr)-1,
- mem,
- params[0]->value.bit.mem_address,
- params[0]->value.bit.mask);
- con->printf("%10s ", sn?sn:"");
- con->printf(mem->addr_format, params[0]->value.bit.mem_address);
- con->printf(" ");
- con->printf(mem->data_format, m);
- con->printf(" %c\n", (m&(params[0]->value.bit.mask))?'1':'0');
- i++;
- params[0]= cmdline->param(i);
- }
- if (params[0])
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
- }
- else if (cmdline->syntax_match(sim, MEMORY))
- {
- mem= params[0]->value.memory;
- mem->dump(con);
- }
- else if (cmdline->syntax_match(sim, MEMORY ADDRESS)) {
- mem = params[0]->value.memory;
- start= params[1]->value.address;
- end = start+10*8-1;
- mem->dump(start, end, bpl, con);
- }
- else if (cmdline->syntax_match(sim, MEMORY ADDRESS ADDRESS)) {
- mem = params[0]->value.memory;
- start= params[1]->value.address;
- end = params[2]->value.address;
- mem->dump(start, end, bpl, con);
- }
- else if (cmdline->syntax_match(sim, MEMORY ADDRESS ADDRESS NUMBER)) {
- mem = params[0]->value.memory;
- start= params[1]->value.address;
- end = params[2]->value.address;
- bpl = params[3]->value.number;
- mem->dump(start, end, bpl, con);
+ /*
+ if (cmdline->syntax_match(0, STRING)) {
+ matches= 0;
+ for (i= 0; i < cmdset->count; i++)
+ {
+ c= (class cl_cmd *)(cmdset->at(i));
+ if (c->name_match(parm->value.string.string, DD_FALSE))
+ matches++;
+ }
+ if (!matches)
+ con->dd_printf("No such command\n");
+ else if (matches > 1)
+ for (i= 0; i < cmdset->count; i++)
+ {
+ c= (class cl_cmd *)(cmdset->at(i));
+ if (!c->name_match(parm->value.string.string, DD_FALSE))
+ continue;
+ if (c->short_help)
+ con->dd_printf("%s\n", c->short_help);
+ else
+ con->dd_printf("%s\n", (char*)(c->names->at(0)));
+ }
+ else
+ for (i= 0; i < cmdset->count; i++)
+ {
+ c= (class cl_cmd *)(cmdset->at(i));
+ if (!c->name_match(parm->value.string.string, DD_FALSE))
+ continue;
+ if (c->short_help)
+ con->dd_printf("%s\n", c->short_help);
+ else
+ con->dd_printf("%s\n", (char*)(c->names->at(0)));
+ int names;
+ con->dd_printf("Names of command:");
+ for (names= 0; names < c->names->count; names++)
+ con->dd_printf(" %s", (char*)(c->names->at(names)));
+ con->dd_printf("\n");
+ if (c->long_help)
+ con->dd_printf("%s\n", c->long_help);
+ else
+ con->dd_printf("%s\n", (char*)(c->names->at(0)));
+ }