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
45 *----------------------------------------------------------------------------
49 //cl_get_sfr_cmd::do_work(class cl_sim *sim,
50 // class cl_cmdline *cmdline, class cl_console *con)
51 COMMAND_DO_WORK_UC(cl_get_sfr_cmd)
53 class cl_mem *mem= uc->mem(MEM_SFR);
54 class cl_cmd_arg *parm;
59 con->dd_printf("Error: No SFR\n");
62 for (i= 0, parm= cmdline->param(i);
64 i++, parm= cmdline->param(i))
66 if (!parm->as_address(uc))
67 con->dd_printf("Warning: Invalid address %s\n",
68 (char*)cmdline->tokens->at(i+1));
70 mem->dump(parm->value.address, parm->value.address, 1, con);
79 *----------------------------------------------------------------------------
83 //cl_get_option_cmd::do_work(class cl_sim *sim,
84 // class cl_cmdline *cmdline, class cl_console *con)
85 COMMAND_DO_WORK_UC(cl_get_option_cmd)
87 class cl_cmd_arg *parm= cmdline->param(0);
92 else if (cmdline->syntax_match(uc, STRING)) {
93 s= parm->value.string.string;
96 con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
99 for (i= 0; i < uc->options->count; i++)
101 class cl_option *o= (class cl_option *)(uc->options->at(i));
105 con->dd_printf("%s ", o->id);
107 con->dd_printf(" %s\n", o->help);
115 /* End of cmd.src/get.cc */