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
44 *----------------------------------------------------------------------------
48 cl_get_sfr_cmd::do_work(class cl_sim *sim,
49 class cl_cmdline *cmdline, class cl_console *con)
51 class cl_mem *mem= sim->uc->mem(MEM_SFR);
52 class cl_cmd_arg *parm;
57 con->printf("Error: No SFR\n");
60 for (i= 0, parm= cmdline->param(i);
62 i++, parm= cmdline->param(i))
64 if (!parm->as_address())
65 con->printf("Warning: Invalid address %s\n",
66 (char*)cmdline->tokens->at(i+1));
68 mem->dump(parm->value.address, parm->value.address, 1, con);
77 *----------------------------------------------------------------------------
81 cl_get_option_cmd::do_work(class cl_sim *sim,
82 class cl_cmdline *cmdline, class cl_console *con)
84 class cl_cmd_arg *parm= cmdline->param(0);
89 else if (cmdline->syntax_match(sim, STRING)) {
90 s= parm->value.string.string;
93 con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
96 for (i= 0; i < sim->uc->options->count; i++)
98 class cl_option *o= (class cl_option *)(sim->uc->options->at(i));
102 con->printf("%s ", o->id);
104 con->printf(" %s\n", o->help);
112 /* End of cmd.src/get.cc */