2 * Simulator of microcontrollers (sim.src/argcl.h)
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
28 #ifndef SIM_ARGCL_HEADER
29 #define SIM_ARGCL_HEADER
35 * Base type of arguments/parameters
38 class cl_arg: public cl_base
55 virtual bool get_ivalue(long *value);
56 virtual char *get_svalue(void);
57 virtual double get_fvalue(void);
58 virtual void *get_pvalue(void);
59 virtual bool get_bit_address(class cl_uc *uc, // input
60 class cl_mem **mem, // outputs
62 t_mem *bit_mask) { return(DD_FALSE); }
70 class cl_cmd_arg: public cl_arg
75 bool interpreted_as_string;
98 cl_cmd_arg(class cl_uc *iuc, long i): cl_arg(i)
99 { uc= iuc; interpreted_as_string= DD_FALSE; }
100 cl_cmd_arg(class cl_uc *iuc, char *s): cl_arg(s)
101 { uc= iuc; interpreted_as_string= DD_FALSE; }
104 virtual int is_string(void) { return(DD_FALSE); }
105 virtual bool get_address(t_addr *addr) { return(DD_FALSE); }
106 virtual bool as_address(void);
107 virtual bool as_number(void);
108 virtual bool as_data(void);
109 virtual bool as_string(void);
110 virtual bool as_memory(void);
111 virtual bool as_hw(class cl_uc *uc);
112 virtual bool as_bit(class cl_uc *uc);
115 class cl_cmd_int_arg: public cl_cmd_arg
118 cl_cmd_int_arg(class cl_uc *iuc, long addr);
120 virtual bool get_address(t_addr *addr);
121 virtual bool get_bit_address(class cl_uc *uc, // input
122 class cl_mem **mem, // outputs
125 virtual bool as_string(void);
128 class cl_cmd_sym_arg: public cl_cmd_arg
131 cl_cmd_sym_arg(class cl_uc *iuc, char *sym);
133 virtual bool get_address(t_addr *addr);
134 virtual bool get_bit_address(class cl_uc *uc, // input
135 class cl_mem **mem, // outputs
138 virtual bool as_address(void);
139 virtual bool as_string(void);
140 virtual bool as_hw(class cl_uc *uc);
143 class cl_cmd_str_arg: public cl_cmd_arg
146 cl_cmd_str_arg(class cl_uc *iuc, char *str);
148 virtual int is_string(void) { return(1); }
151 class cl_cmd_bit_arg: public cl_cmd_arg
154 class cl_cmd_arg *sfr, *bit;
157 cl_cmd_bit_arg(class cl_uc *iuc,
158 class cl_cmd_arg *asfr, class cl_cmd_arg *abit);
159 ~cl_cmd_bit_arg(void);
161 virtual bool get_address(t_addr *addr);
162 virtual bool get_bit_address(class cl_uc *uc, // input
163 class cl_mem **mem, // outputs
168 class cl_cmd_array_arg: public cl_cmd_arg
171 class cl_cmd_arg *name, *index;
174 cl_cmd_array_arg(class cl_uc *iuc,
175 class cl_cmd_arg *aname, class cl_cmd_arg *aindex);
176 ~cl_cmd_array_arg(void);
177 virtual bool as_hw(class cl_uc *uc);
185 class cl_prg_arg: public cl_arg
192 cl_prg_arg(char sn, char *ln, long lv);
193 cl_prg_arg(char sn, char *ln, char *lv);
194 cl_prg_arg(char sn, char *ln, double fv);
195 cl_prg_arg(char sn, char *ln, void *pv);