2 * Simulator of microcontrollers (cmd.src/get.cc)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
48 *----------------------------------------------------------------------------
52 //cl_get_sfr_cmd::do_work(class cl_sim *sim,
53 // class cl_cmdline *cmdline, class cl_console_base *con)
54 COMMAND_DO_WORK_UC(cl_get_sfr_cmd)
56 class cl_address_space *mem= uc->address_space(MEM_SFR_ID);
57 class cl_cmd_arg *parm;
62 con->dd_printf("Error: No SFR\n");
65 for (i= 0, parm= cmdline->param(i);
67 i++, parm= cmdline->param(i))
69 if (!parm->as_address(uc) ||
70 !mem->valid_address(parm->value.address))
71 con->dd_printf("Warning: Invalid address %s\n",
72 (char*)cmdline->tokens->at(i+1));
74 mem->dump(parm->value.address, parm->value.address, 1, con);
83 *----------------------------------------------------------------------------
87 //cl_get_option_cmd::do_work(class cl_sim *sim,
88 // class cl_cmdline *cmdline, class cl_console_base *con)
89 COMMAND_DO_WORK_APP(cl_get_option_cmd)
91 class cl_cmd_arg *parm= cmdline->param(0);
96 else if (cmdline->syntax_match(0/*app->get_uc()*/, STRING)) {
97 s= parm->value.string.string;
100 con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
103 for (i= 0; i < app->options->count; i++)
105 class cl_option *o= (class cl_option *)(/*uc*/app->options->at(i));
107 !strcmp(s, o->get_name())))
111 con->dd_printf("%2d. %s(by %s): ", i, object_name(o),
112 object_name(o->get_creator()));
114 con->dd_printf(" - %s\n", o->help);
119 con->dd_printf("%2d. %s(by %s) is hidden!\n", i, object_name(o),
120 object_name(o->get_creator()));
130 /* End of cmd.src/get.cc */