-0.2.37-pre4
+0.2.37-pre5
putcopyright:
'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l
+start:
+ date '+%Y.%m.%d-%H:%M' >.start
+
newer: distclean
- @if [ -f start ]; then \
+ @if [ -f .start ]; then \
tar cvf - \
- `find . -newer start -type f -print` |\
- gzip -9c >ucsim-newer-`date '+%Y.%m.%d-%H:%M'`.tgz; \
+ `find . -newer .start -type f -print` |\
+ gzip -9c >ucsim-newer-`cat .start`_`date '+%Y.%m.%d-%H:%M'`_`hostname`.tgz; \
else \
- echo "start file not found.\n"; \
+ echo ".start file not found.\n"; \
exit 1; \
fi
print-newer:
- @if [ -f start ]; then \
- find . -newer start -type f -print ;\
+ @if [ -f .start ]; then \
+ find . -newer .start -type f -print ;\
else \
- echo "start file not found.\n" ;\
+ echo ".start file not found.\n" ;\
exit 1 ;\
fi
if (params[0] == 0)
{
con->printf("Address is missing.\n");
- return(FALSE);
+ return(DD_FALSE);
}
addr= (params[0])->get_address();
if (params[1])
int
cl_file_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con)
{
- char *fname;
+ char *fname= 0;
long l;
if ((cmdline->param(0) == 0) ||
{
dot--;
*dot= '.';
- return(FALSE);
+ return(DD_FALSE);
}
}
else
if ((*celladdr < 0x20) ||
((*celladdr > 0x2f) && (*celladdr < 0x80)) ||
((*celladdr > 0x7f) && (*celladdr & 0x07)))
- return(FALSE);
+ return(DD_FALSE);
bitnum= strtol(dot, &p, 0);
if ((p && *p) ||
(bitnum < 0) ||
(bitnum > 7))
- return(FALSE);
+ return(DD_FALSE);
if (*celladdr > 0x7f)
*bitaddr= *celladdr + bitnum;
else
*bitaddr= strtol(name, &p, 0);
if ((p && *p) ||
(*bitaddr > 0xff))
- return(FALSE);
+ return(DD_FALSE);
}
else
*bitaddr= ne->addr;
*bitmask= BIT_MASK(*bitaddr);
// making symbolic name
if (!symname)
- return(TRUE);
+ return(DD_TRUE);
i= 0;
while (uc->bit_tbl()[i].name &&
(uc->bit_tbl()[i].addr != *bitaddr))
{
sym= strdup(uc->bit_tbl()[i].name);
*symname= sym;
- return(TRUE);
+ return(DD_TRUE);
}
i= 0;
while (uc->sfr_tbl()[i].name &&
sprintf(bitnumstr, "%1d", *bitaddr & 0x07);
strcat(sym, bitnumstr);
*symname= sym;
- return(TRUE);
+ return(DD_TRUE);
}
if (f= fopen(fout, "w+"), out= f?f:stdout, !f)
fprintf(stderr, "Can't open `%s': %s\n", fout, strerror(errno));
prompt= 0;
+ flags= CONS_NONE;
}
cl_console::cl_console(FILE *fin, FILE *fout, class cl_sim *asim):
sim= asim;
in = fin;
out= fout;
+ flags= CONS_NONE;
}
/*
if (sim->arg_avail('P'))
putc('\0', out);
else
- fprintf(out, "%s", prompt?prompt:
+ fprintf(out, "%s", (prompt && prompt[0])?prompt:
((p= sim->get_sarg(0, "prompt"))?p:"> "));
fflush(out);
}
if (!sim)
return(1);
if (sim->arg_avail('c'))
- {
- add_console(mk_console(sim->get_sarg('c', 0),
- sim->get_sarg('c', 0), sim));
- }
+ add_console(mk_console(sim->get_sarg('c', 0),
+ sim->get_sarg('c', 0), sim));
#ifdef SOCKET_AVAIL
if (sim->arg_avail('Z'))
- {
- add_console(mk_console(sim->get_iarg(0, "Zport"), sim));
- }
+ add_console(mk_console(sim->get_iarg(0, "Zport"), sim));
if (sim->arg_avail('r'))
- {
- add_console(mk_console(sim->get_iarg('r', 0), sim));
- }
+ add_console(mk_console(sim->get_iarg('r', 0), sim));
#endif
if (cons->get_count() == 0)
- {
- add_console(mk_console(stdin, stdout, sim));
- }
+ add_console(mk_console(stdin, stdout, sim));
return(0);
}
return(ret);
}
+int
+cl_commander::all_print(char *string, int length)
+{
+ int i;
+
+ for (i= 0; i < cons->count; i++)
+ {
+ class cl_console *c= (class cl_console*)(cons->at(i));
+ if (c->out)
+ {
+ for (int j= 0; j < length; j++)
+ putc(string[j], c->out);
+ }
+ }
+ return(0);
+}
+
/*
* Printing to actual_console
*/
virtual char *read_line(void);
virtual int proc_input(void);
virtual bool interpret(char *cmd);
- virtual bool old_command(class cl_cmdline *cmdline) { return(FALSE); }
+ virtual bool old_command(class cl_cmdline *cmdline) { return(DD_FALSE); }
};
#ifdef SOCKET_AVAIL
void set_fd_set(void);
int all_printf(char *format, ...); // print to all consoles
+ int all_print(char *string, int length);
int printf(char *format, ...); // print to actual_console
int debug(char *format, ...); // print consoles with debug flag set
int flag_printf(int iflags, char *format, ...);
#ifndef DDCONFIG_HEADER
#define DDCONFIG_HEADER
-#define TRUE 1
-#define FALSE 0
-#define bool int
+#define DD_TRUE 1
+#define DD_FALSE 0
+#define bool int
#undef STDC_HEADERS
#undef HAVE_GETOPT_H
* Tim Hurman - t.hurman@virgin.net *
* Last edited on 01th Oct 1999 *
******************************************************************************/
-#if !defined(sun)
-/* Solaris doesn't like redefining this. */
typedef void(*SIG_PF)(int);
-#endif
-
class SigHandler
{
public:
cl_sorted_list::cl_sorted_list(t_index alimit, t_index adelta):
cl_list(alimit, adelta)
{
- Duplicates= FALSE;
+ Duplicates= DD_FALSE;
}
{
t_index l = 0;
t_index h = count - 1;
- bool res= FALSE;
+ bool res= DD_FALSE;
while (l <= h)
{
h= i - 1;
if (c == 0)
{
- res= TRUE;
+ res= DD_TRUE;
if (!Duplicates)
l= i;
}
cl_strings::cl_strings(t_index alimit, t_index adelta):
cl_sorted_list(alimit, adelta)
{
- Duplicates= TRUE;
+ Duplicates= DD_TRUE;
}
cl_ustrings::search(void *key, t_index& index)
{
t_index i = 0;
- bool found= FALSE;
+ bool found= DD_FALSE;
void *Actual;
if ((count) && key)
#include "ddconfig.h"
#ifndef MyTypesHeader
-#define TRUE 1
-#define FALSE 0
-#define bool int
+#define DD_TRUE 1
+#define DD_FALSE 0
+#define bool int
#endif
typedef int t_index;
class cl_cmd *cmd= (class cl_cmd *)(sim->cmdset->at(i));
sim->cmd->printf("%s\n", cmd->short_help);
}
- return(FALSE);
+ return(DD_FALSE);
}
fprintf(sim->cmd_out(), " %s\n", o->help);
}
}
- return(FALSE);
+ return(DD_FALSE);
}
if ((id= strtok(NULL, delimiters)) == NULL)
{
fprintf(sim->cmd_out(), "Name of option has not given.\n");
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
{
fprintf(sim->cmd_out(), "Value has not given.\n");
- return(FALSE);
+ return(DD_FALSE);
}
for (i= 0; i < uc->options->count; i++)
{
break;
}
}
- return(FALSE);
+ return(DD_FALSE);
}
struct cmd_entry cmd_table[]=
{
- {"g" , cmd_go, FALSE,
+ {"g" , cmd_go, DD_FALSE,
"g [start [stop]] Go"},
- {"stop", cmd_stop, FALSE,
+ {"stop", cmd_stop, DD_FALSE,
"stop Stop"},
- {"pc", cmd_pc, FALSE,
+ {"pc", cmd_pc, DD_FALSE,
"pc [address] Get/set content of PC"},
- {"s" , cmd_step, TRUE,
+ {"s" , cmd_step, DD_TRUE,
"s [step] Step"},
- {"n" , cmd_next, TRUE,
+ {"n" , cmd_next, DD_TRUE,
"n [step] Next"},
- {"bse", cmd_brk_sete, FALSE,
+ {"bse", cmd_brk_sete, DD_FALSE,
"bse wi|ri|wx|rx|ws|rs|rc f|d addr [hit]\n"
" Set EVENT Breakpoint"},
- {"bde", cmd_brk_dele, FALSE,
+ {"bde", cmd_brk_dele, DD_FALSE,
"bde wi|ri|wx|rx|ws|rs|rc addr\n"
" Delete EVENT Breakpoint"},
- {"ba", cmd_brk_delall, FALSE,
+ {"ba", cmd_brk_delall, DD_FALSE,
"ba Delete all breakpoints"},
- {"dis", cmd_disass, TRUE,
+ {"dis", cmd_disass, DD_TRUE,
"dis [start [offset [lines]]]\n"
" Disassemble code"},
- {"dp", cmd_dump_port, FALSE,
+ {"dp", cmd_dump_port, DD_FALSE,
"dp Dump ports"},
- {"ds", cmd_dump_sfr, FALSE,
+ {"ds", cmd_dump_sfr, DD_FALSE,
"ds [addr...] Dump SFR"},
- {"db", cmd_dump_bit, TRUE,
+ {"db", cmd_dump_bit, DD_TRUE,
"db addr... Dump bit"},
- {"si", cmd_set_iram, FALSE,
+ {"si", cmd_set_iram, DD_FALSE,
"si addr data... Set Internal RAM"},
- {"sx", cmd_set_xram, FALSE,
+ {"sx", cmd_set_xram, DD_FALSE,
"sx addr data... Set External RAM"},
- {"sc", cmd_set_code, FALSE,
+ {"sc", cmd_set_code, DD_FALSE,
"sc addr data... Set code (ROM)"},
- {"ss", cmd_set_sfr, FALSE,
+ {"ss", cmd_set_sfr, DD_FALSE,
"ss addr data... Set SFR area"},
- {"sb", cmd_set_bit, FALSE,
+ {"sb", cmd_set_bit, DD_FALSE,
"sb addr data... Set bit"},
- {"sp", cmd_set_port, FALSE,
+ {"sp", cmd_set_port, DD_FALSE,
"sp port data Set port pins"},
- {"fi", cmd_fill_iram, FALSE,
+ {"fi", cmd_fill_iram, DD_FALSE,
"fi start stop data Fill IRAM area with `data'"},
- {"fx", cmd_fill_xram, FALSE,
+ {"fx", cmd_fill_xram, DD_FALSE,
"fx start stop data Fill XRAM area with `data'"},
- {"fs", cmd_fill_sfr, FALSE,
+ {"fs", cmd_fill_sfr, DD_FALSE,
"fs start stop data Fill SFR area with `data'"},
- {"fc", cmd_fill_code, FALSE,
+ {"fc", cmd_fill_code, DD_FALSE,
"fc start stop data Fill ROM area with `data'"},
- {"wi", cmd_where_iram, FALSE,
+ {"wi", cmd_where_iram, DD_FALSE,
"wi,Wi string Search for `string' in IRAM (Wi case sensitive)"},
- {"Wi", cmd_Where_iram, FALSE, NULL},
+ {"Wi", cmd_Where_iram, DD_FALSE, NULL},
- {"wx", cmd_where_xram, FALSE,
+ {"wx", cmd_where_xram, DD_FALSE,
"wx,Wx string Search for `string' in XRAM (Wx case sensitive)"},
- {"Wx", cmd_Where_xram, FALSE, NULL},
+ {"Wx", cmd_Where_xram, DD_FALSE, NULL},
- {"wc", cmd_where_code, FALSE,
+ {"wc", cmd_where_code, DD_FALSE,
"wc,Wc string Search for `string' in ROM (Wc case sensitive)"},
- {"Wc", cmd_Where_code, FALSE, NULL},
+ {"Wc", cmd_Where_code, DD_FALSE, NULL},
- {"sopt", cmd_set_option, FALSE,
+ {"sopt", cmd_set_option, DD_FALSE,
"sopt opt value Set value of option"},
- {"gopt", cmd_get_option, FALSE,
+ {"gopt", cmd_get_option, DD_FALSE,
"gopt [opt] Get value of option(s)"},
- {"show", cmd_show, FALSE,
+ {"show", cmd_show, DD_FALSE,
"show c|w Show licensing information"},
- {"h" , cmd_help, FALSE,
+ {"h" , cmd_help, DD_FALSE,
"h,? Help about commands"},
- {"?" , cmd_help, FALSE, NULL},
+ {"?" , cmd_help, DD_FALSE, NULL},
{NULL, NULL}
};
{
int i;
char *c, *s;
- bool repeat= FALSE, retval= FALSE;
+ bool repeat= DD_FALSE, retval= DD_FALSE;
if (*cmd)
{
}
else
if (last_command == NULL)
- return(FALSE);
+ return(DD_FALSE);
else
{
c= strdup(last_command);
- repeat= TRUE;
+ repeat= DD_TRUE;
}
i= 0;
s= strtok(c, delimiters);
if (cmdline->name == 0 ||
*(cmdline->name) == '\0' ||
*(cmdline->name) == '\n')
- return(TRUE);
+ return(DD_TRUE);
while ((cmd_table[i].name != NULL) &&
/*(strstr(c, cmd_table[i].name) != c)*/
(strcmp(cmdline->name, cmd_table[i].name) != 0))
if ((id= strtok(NULL, delimiters)) == NULL)
{
sim->cmd->printf("Event has not given.\n");
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
{
sim->cmd->printf("Permanency has not given\n");
- return(FALSE);
+ return(DD_FALSE);
}
switch (*s)
{
break;
default:
sim->cmd->printf("Unknow permanency\n");
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
{
sim->cmd->printf("Address has not given\n");
- return(FALSE);
+ return(DD_FALSE);
}
addr= (uint)strtol(s, NULL, 0);
if ((s= strtok(NULL, delimiters)) != NULL)
if (b)
uc->ebrk->add_bp(b);
}
- return(FALSE);
+ return(DD_FALSE);
}
else
uc->fbrk->del_bp(addr);
}
- return(FALSE);
+ return(DD_FALSE);
}*/
if ((id= strtok(NULL, delimiters)) == NULL)
{
fprintf(sim->cmd_out(), "Event has not given.\n");
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
fprintf(sim->cmd_out(), "Address has not given.\n");
else
uc->rm_ebrk(addr, id);
}
- return(FALSE);
+ return(DD_FALSE);
}
}
while (uc->ebrk->count)
uc->ebrk->free_at(0);
- return(FALSE);
+ return(DD_FALSE);
}
eb->hit, eb->cnt,
eb->addr, eb->id);
}
- return(FALSE);
+ return(DD_FALSE);
}*/
uint realstart;
if (!uc->there_is_inst())
- return(FALSE);
+ return(DD_FALSE);
if ((s= strtok(NULL, delimiters)) != NULL)
start= strtol(s, NULL, 0);
else
}
disass_last_stop= realstart;
- return(FALSE);
+ return(DD_FALSE);
}
print_bin(data, 8, sim->cmd_out());
sim->cmd->printf(" 0x%02x %3d %c\n", data, data, isprint(data)?data:'.');
- return(FALSE);
+ return(DD_FALSE);
}
else
// dump all
dump_memory(uc->mem(MEM_SFR), &start, 255, 16, sim->cmd_out(), sim);
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
{
sim->cmd->printf("Address has not given.\n");
- return(FALSE);
+ return(DD_FALSE);
}
while (s)
{
if (!interpret_bitname(s, uc, &cell, &addr, &bitaddr, &bitmask, &sym))
{
sim->cmd->printf("Bad address %s\n", s);
- return(FALSE);
+ return(DD_FALSE);
}
sim->cmd->printf("%06x %6s %c\n", addr, sym, (*cell & bitmask)?'1':'0');
free(sym);
s= strtok(NULL, delimiters);
}
- return(FALSE);
+ return(DD_FALSE);
}
t_addr start= uc->PC;
long stop= -1;
class cl_brk *b;
- bool brk_at_stop= FALSE;
+ bool brk_at_stop= DD_FALSE;
if (sim->state & SIM_GO)
{
if (start == (t_addr)stop)
{
fprintf(sim->cmd_out(), "Addresses must be different.\n");
- return(FALSE);
+ return(DD_FALSE);
}
if ((b= uc->fbrk_at(stop)))
{
- brk_at_stop= TRUE;
+ brk_at_stop= DD_TRUE;
b->cnt= 1;
}
else
uc->fbrk->del_bp(stop);*/
/*fprintf(sim->cmd_out(), "%d\n", uc->result);
uc->print_disass(uc->PC);*/
- return(FALSE);
+ return(DD_FALSE);
}
{
sim->stop(resUSER);
uc->print_disass(uc->PC, sim->cmd->actual_console);
- return(FALSE);
+ return(DD_FALSE);
}
uc->do_inst(1);
dump_step(uc, sim);
}
- return(FALSE);
+ return(DD_FALSE);
}
uc->do_inst(1);
dump_step(uc, sim);
}
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
{
uc->print_disass(uc->PC, sim->cmd->actual_console);
- return(FALSE);
+ return(DD_FALSE);
}
pc= strtol(s, &p, 0);
if (p &&
uc->PC= pc;
uc->print_disass(uc->PC, sim->cmd->actual_console);
}
- return(FALSE);
+ return(DD_FALSE);
}
proc_write_sp(*aof_SP);
PC= h*256 + l;
- was_reti= TRUE;
+ was_reti= DD_TRUE;
class it_level *il= (class it_level *)(it_levels->top());
if (il &&
il->level >= 0)
addr = get_direct(fetch(), &event_at.wi, &event_at.ws);
jaddr= fetch();
+ tick(1);
if (--(*addr))
PC= (PC + (signed char)jaddr) & (EROM_SIZE-1);
return(resGO);
reg = get_reg(code & 0x07, &event_at.wi);
jaddr= fetch();
+ tick(1);
if (--(*reg))
PC= (PC + (signed char)jaddr) & (EROM_SIZE-1);
return(resGO);
cmd_set_iram(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
set_memory(uc->mem(MEM_IRAM), 0, uc, NULL, sim);
- return(FALSE);
+ return(DD_FALSE);
}
uc->eram2xram();
set_memory(uc->mem(MEM_XRAM), 0, uc, NULL, sim);
uc->xram2eram();
- return(FALSE);
+ return(DD_FALSE);
}
cmd_set_code(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
set_memory(uc->mem(MEM_ROM), 0, uc, NULL, sim);
- return(FALSE);
+ return(DD_FALSE);
}
cmd_set_sfr(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
set_memory(uc->mem(MEM_SFR), SFR_START, uc, uc->sfr_tbl(), sim);
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
{
fprintf(sim->cmd_out(), "Address has not given.\n");
- return(FALSE);
+ return(DD_FALSE);
}
if (!interpret_bitname(s, uc, &cell, &addr, &bitaddr, &bitmask, NULL))
{
fprintf(sim->cmd_out(), "Bad address %s\n", s);
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
{
fprintf(sim->cmd_out(), "Data has not given.\n");
- return(FALSE);
+ return(DD_FALSE);
}
while (s)
{
if (!isdigit(*s))
{
fprintf(sim->cmd_out(), "Bad data %s\n", s);
- return(FALSE);
+ return(DD_FALSE);
}
if (*s == '0')
*cell&= ~bitmask;
bitmask&= 0xff;
s= strtok(NULL, delimiters);
}
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
{
fprintf(sim->cmd_out(), "Port number has not given.\n");
- return(FALSE);
+ return(DD_FALSE);
}
port= strtol(s, &p, 0);
if ((p && *p) ||
(port > 3))
{
fprintf(sim->cmd_out(), "Port number %s is wrong.\n", s);
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
{
fprintf(sim->cmd_out(), "Date has not given.\n");
- return(FALSE);
+ return(DD_FALSE);
}
data= strtol(s, &p, 0);
if (p && *p)
{
fprintf(sim->cmd_out(), "Data %s is wrong.\n", s);
- return(FALSE);
+ return(DD_FALSE);
}
uc->port_pins[port]= data;
- return(FALSE);
+ return(DD_FALSE);
}
cmd_fill_iram(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
fill_memory(uc->MEM(MEM_IRAM), uc->get_mem_size(MEM_IRAM), 0, uc, sim);
- return(FALSE);
+ return(DD_FALSE);
}
{
fill_memory(uc->MEM(MEM_XRAM), uc->get_mem_size(MEM_XRAM), 0, uc, sim);
uc->xram2eram/*FIXME*/();
- return(FALSE);
+ return(DD_FALSE);
}
cmd_fill_sfr(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
fill_memory(uc->MEM(MEM_SFR), uc->get_mem_size(MEM_SFR), SFR_START, uc, sim);
- return(FALSE);
+ return(DD_FALSE);
}
cmd_fill_code(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
fill_memory(uc->MEM(MEM_ROM), EROM_SIZE, 0, uc, sim);
- return(FALSE);
+ return(DD_FALSE);
}
if ((s= strtok(NULL, delimiters)) == NULL)
{
fprintf(sim->cmd_out(), "Parameter is not given.\n");
- return(FALSE);
+ return(DD_FALSE);
}
if (*s == 'c')
{
fprintf(sim->cmd_out(), "%s\n", warranty);
else
fprintf(sim->cmd_out(), "Unknown parameter.\n");
- return(FALSE);
+ return(DD_FALSE);
}
technology= Itech;
debug= asim->get_iarg('V', 0);
- stop_at_it= FALSE;
+ stop_at_it= DD_FALSE;
options->add(new cl_bool_opt(&debug, "verbose", "Verbose flag."));
options->add(new cl_bool_opt(&stop_at_it, "stopit",
"Stop if interrupt accepted."));
result= resGO;
- was_reti= FALSE;
+ was_reti= DD_FALSE;
s_tr_t1 = 0;
s_rec_t1 = 0;
s_rec_tick = 0;
s_in = 0;
s_out = 0;
- s_sending = FALSE;
- s_receiving= FALSE;
+ s_sending = DD_FALSE;
+ s_receiving= DD_FALSE;
s_rec_bit = 0;
s_tr_bit = 0;
}
if (addr == &((sfr->umem8)[SBUF]))
{
s_out= sfr->get(SBUF);
- s_sending= TRUE;
+ s_sending= DD_TRUE;
s_tr_bit = 0;
s_tr_tick= 0;
s_tr_t1 = 0;
}
if (addr == &((sfr->umem8)[IE]))
- was_reti= TRUE;
+ was_reti= DD_TRUE;
}
void
step--;
if (state == stGO)
{
- was_reti= FALSE;
+ was_reti= DD_FALSE;
pre_inst();
result= exec_inst();
post_inst();
int i;
uchar uc;
- p = FALSE;
+ p = DD_FALSE;
uc= sfr->get(ACC);
for (i= 0; i < 8; i++)
{
if (s_sending &&
(s_tr_bit >= bits))
{
- s_sending= FALSE;
+ s_sending= DD_FALSE;
sfr->set_bit1(SCON, bmTI);
if (serial_out)
{
if (i > 0 &&
FD_ISSET(fileno(serial_in), &set))
{
- s_receiving= TRUE;
+ s_receiving= DD_TRUE;
s_rec_bit= 0;
s_rec_tick= s_rec_t1= 0;
}
sfr->set(SBUF, s_in);
received(c);
}
- s_receiving= FALSE;
+ s_receiving= DD_FALSE;
s_rec_bit-= bits;
}
return(resGO);
if (was_reti)
{
- was_reti= FALSE;
+ was_reti= DD_FALSE;
return(resGO);
}
if (!((ie= sfr->get(IE)) & bmEA))
int
t_uc51r::do_timer2(int cycles)
{
- bool nocount= FALSE;
+ bool nocount= DD_FALSE;
uint t2mod= get_mem(MEM_SFR, T2MOD);
uint t2con= get_mem(MEM_SFR, T2CON);
uint p1= get_mem(MEM_SFR, P1);
/* Determining nr of input clocks */
if (!(t2con & bmTR2))
- nocount= TRUE; // Timer OFF
+ nocount= DD_TRUE; // Timer OFF
else
if (t2con & bmC_T2)
{
!(p1 & port_pins[1] & bmT2))
cycles= 1;
else
- nocount= TRUE;
+ nocount= DD_TRUE;
}
/* Counting */
while (cycles--)
int
t_uc52::do_timer2(int cycles)
{
- bool nocount= FALSE;
+ bool nocount= DD_FALSE;
uint t2con= get_mem(MEM_SFR, T2CON);
exf2it->activate();
/* Determining nr of input clocks */
if (!(t2con & bmTR2))
- nocount= TRUE; // Timer OFF
+ nocount= DD_TRUE; // Timer OFF
else
if (t2con & bmC_T2)
{
!(get_mem(MEM_SFR, P1) & port_pins[1] & bmT2))
cycles= 1;
else
- nocount= TRUE;
+ nocount= DD_TRUE;
}
/* Counting */
while (cycles--)
!(get_mem(MEM_SFR, P1) & port_pins[1] & bmT2EX) &&
(get_mem(MEM_SFR, T2CON) & bmEXEN2))
{
- ext2= TRUE;
+ ext2= DD_TRUE;
mem(MEM_SFR)->set_bit1(T2CON, bmEXF2);
prev_p1&= ~bmT2EX; // Falling edge has been handled
}
while (start < mem->size-len)
{
t_addr tmp= start;
- found= TRUE;
+ found= DD_TRUE;
for (i= 0; found && (i<len); i++)
found= str[i] == (cs?mem->get(start+i):toupper(mem->get(start+i)));
if (found)
bool
cmd_where_iram(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
- where_memory(uc->mem(MEM_IRAM), FALSE, sim);
- return(FALSE);
+ where_memory(uc->mem(MEM_IRAM), DD_FALSE, sim);
+ return(DD_FALSE);
}
bool
cmd_Where_iram(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
- where_memory(uc->mem(MEM_IRAM), TRUE, sim);
- return(FALSE);
+ where_memory(uc->mem(MEM_IRAM), DD_TRUE, sim);
+ return(DD_FALSE);
}
cmd_where_xram(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
uc->eram2xram/*FIXME*/();
- where_memory(uc->mem(MEM_XRAM), FALSE, sim);
- return(FALSE);
+ where_memory(uc->mem(MEM_XRAM), DD_FALSE, sim);
+ return(DD_FALSE);
}
bool
cmd_Where_xram(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
uc->eram2xram/*FIXME*/();
- where_memory(uc->mem(MEM_XRAM), TRUE, sim);
- return(FALSE);
+ where_memory(uc->mem(MEM_XRAM), DD_TRUE, sim);
+ return(DD_FALSE);
}
bool
cmd_where_code(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
- where_memory(uc->mem(MEM_ROM), FALSE, sim);
- return(FALSE);
+ where_memory(uc->mem(MEM_ROM), DD_FALSE, sim);
+ return(DD_FALSE);
}
bool
cmd_Where_code(char *cmd, class cl_uc *uc, class cl_sim *sim)
{
- where_memory(uc->mem(MEM_ROM), TRUE, sim);
- return(FALSE);
+ where_memory(uc->mem(MEM_ROM), DD_TRUE, sim);
+ return(DD_FALSE);
}
bool
cl_ev_brk::match(struct event_rec *ev)
{
- return(FALSE);
+ return(DD_FALSE);
}
b= (class cl_brk *)at(i);
if (b->type() == brkEVENT &&
((class cl_ev_brk *)b)->event == ev)
- return(TRUE);
+ return(DD_TRUE);
}
- return(FALSE);
+ return(DD_FALSE);
}
int
name= strdup(Iname);
else
name= strdup("unknown");
- active= TRUE;
+ active= DD_TRUE;
}
cl_it_src::~cl_it_src(void)
void
cl_it_src::activate(void)
{
- set_active_status(TRUE);
+ set_active_status(DD_TRUE);
}
void
cl_it_src::deactivate(void)
{
- set_active_status(FALSE);
+ set_active_status(DD_FALSE);
}
cl_memloc_coll::cl_memloc_coll(void):
cl_sorted_list(2, 2)
{
- Duplicates= FALSE;
+ Duplicates= DD_FALSE;
}
void *
if (c == '1' ||
c == 'T' ||
c == 'Y')
- *(bool *)option= TRUE;
+ *(bool *)option= DD_TRUE;
else
- *(bool *)option= FALSE;
+ *(bool *)option= DD_FALSE;
}
};
}
char *prompt;
if (arg_avail('P'))
- /*FIXME: putc('\0', f)*/;
+ cmd->all_print("\0", 1);
else
- cmd->all_printf("%s", arg_avail('P')?"\0":
- ((prompt= get_sarg(0, "prompt"))?prompt:"> "));
+ cmd->all_printf("%s", (prompt= get_sarg(0, "prompt"))?prompt:"> ") ;
}
return(0);
}
}
ebrk= new brk_coll(2, 2, (class cl_rom *)mem(MEM_ROM));
fbrk= new brk_coll(2, 2, (class cl_rom *)mem(MEM_ROM));
- fbrk->Duplicates= FALSE;
+ fbrk->Duplicates= DD_FALSE;
mk_hw_elements();
reset();
return(0);
return((class cl_mem *)(mems->at(type)));
}
-uchar *
+TYPE_UBYTE *
cl_uc::MEM(enum mem_class type)
{
class cl_mem *m;
char s2[3];
long l= 0;
- *ok= FALSE;
+ *ok= DD_FALSE;
while (bytes)
{
if (fscanf(f, "%2c", &s2[0]) == EOF)
l= l*256 + strtol(s2, NULL, 16);
bytes--;
}
- *ok= TRUE;
+ *ok= DD_TRUE;
return(l);
}
}
//memset(inst_map, '\0', sizeof(inst_map));
- ok= TRUE;
+ ok= DD_TRUE;
while (ok &&
rtyp != 1)
{
class cl_hw *
cl_uc::get_hw(enum hw_cath cath, int *idx)
{
- class cl_hw *hw;
+ class cl_hw *hw= 0;
int i= 0;
if (idx)
virtual void write_mem(enum mem_class type, long addr, ulong val);
virtual void set_mem(enum mem_class type, long addr, ulong val);
virtual class cl_mem *mem(enum mem_class type);
- virtual uchar *MEM(enum mem_class type);
+ virtual TYPE_UBYTE *MEM(enum mem_class type);
// file handling
virtual long read_hex_file(const char *name);
struct dis_entry disass_z80[]= {
- { 0x0000, 0xffff, ' ', 1, "nop" },
- { 0x9488, 0xffff, ' ', 1, "clc" },
- { 0x94d8, 0xffff, ' ', 1, "clh" },
- { 0x94f8, 0xffff, ' ', 1, "cli" },
- { 0x94a8, 0xffff, ' ', 1, "cln" },
- { 0x94c8, 0xffff, ' ', 1, "cls" },
- { 0x94e8, 0xffff, ' ', 1, "clt" },
- { 0x94b8, 0xffff, ' ', 1, "clv" },
- { 0x9498, 0xffff, ' ', 1, "clz" },
- { 0x9408, 0xffff, ' ', 1, "sec" },
- { 0x9458, 0xffff, ' ', 1, "seh" },
- { 0x9478, 0xffff, ' ', 1, "sei" },
- { 0x9428, 0xffff, ' ', 1, "sen" },
- { 0x9448, 0xffff, ' ', 1, "ses" },
- { 0x9468, 0xffff, ' ', 1, "set" },
- { 0x9438, 0xffff, ' ', 1, "sev" },
- { 0x9418, 0xffff, ' ', 1, "sez" },
- { 0x1c00, 0xfc00, ' ', 1, "adc %d,%r" },
- { 0x0c00, 0xfc00, ' ', 1, "add %d,%r" },
- { 0x9600, 0xff00, ' ', 1, "adiw %2,%6" },
- { 0x2000, 0xfc00, ' ', 1, "and %d,%r" },
- { 0x7000, 0xf000, ' ', 1, "andi %D,%K" },
- { 0x9405, 0xfe0f, ' ', 1, "asr %d" },
- { 0x9488, 0xff8f, ' ', 1, "bclr %s" },
- { 0xf800, 0xfe08, ' ', 1, "bld %d,%b" },
- { 0xf400, 0xfc07, ' ', 1, "brcc %k" },
- { 0xf000, 0xfc07, ' ', 1, "brcs %k" },
- { 0xf001, 0xfc07, ' ', 1, "breq %k" },
- { 0xf404, 0xfc07, ' ', 1, "brge %k" },
- { 0xf405, 0xfc07, ' ', 1, "brhc %k" },
- { 0xf005, 0xfc07, ' ', 1, "brhs %k" },
- { 0xf407, 0xfc07, ' ', 1, "brid %k" },
- { 0xf007, 0xfc07, ' ', 1, "brie %k" },
- { 0xf000, 0xfc07, ' ', 1, "brlo %k" },
- { 0xf004, 0xfc07, ' ', 1, "brlt %k" },
- { 0xf002, 0xfc07, ' ', 1, "brmi %k" },
- { 0xf401, 0xfc07, ' ', 1, "brne %k" },
- { 0xf402, 0xfc07, ' ', 1, "brpl %k" },
- { 0xf400, 0xfc07, ' ', 1, "brsh %k" },
- { 0xf406, 0xfc07, ' ', 1, "brtc %k" },
- { 0xf006, 0xfc07, ' ', 1, "brts %k" },
- { 0xf403, 0xfc07, ' ', 1, "brvc %k" },
- { 0xf003, 0xfc07, ' ', 1, "brvs %k" },
- { 0xf400, 0xfc00, ' ', 1, "brbc %b,%k" },
- { 0xf000, 0xfc00, ' ', 1, "brbs %b,%k" },
- { 0x9408, 0xff8f, ' ', 1, "bset %s" },
- { 0xfa00, 0xfe00, ' ', 1, "bst %d,%b" },
- { 0x940e, 0xfe0e, ' ', 2, "call %A" },
- { 0x9800, 0xff00, ' ', 1, "cbi %P,%b" },
- { 0x9400, 0xfe0f, ' ', 1, "com %d" },
- { 0x1400, 0xfc00, ' ', 1, "cp %d,%r" },
- { 0x0400, 0xfc00, ' ', 1, "cpc %d,%r" },
- { 0x3000, 0xf000, ' ', 1, "cpi %D,%K" },
- { 0x1000, 0xfc00, ' ', 1, "cpse %d,%r" },
- { 0x940a, 0xfe0f, ' ', 1, "dec %d" },
- { 0x2400, 0xfc00, ' ', 1, "eor %d,%r" },
- { 0x9509, 0xff0f, ' ', 1, "icall" },
- { 0x9409, 0xff0f, ' ', 1, "ijmp" },
- { 0xb000, 0xf800, ' ', 1, "in %d,%p" },
- { 0x9403, 0xfe0f, ' ', 1, "inc %d" },
- { 0x940c, 0xfe0e, ' ', 2, "jmp %A" },
- { 0x900c, 0xfe0f, ' ', 1, "ld %d,X" },
- { 0x900d, 0xfe0f, ' ', 1, "ld %d,X+" },
- { 0x900e, 0xfe0f, ' ', 1, "ld %d,-X" },
- { 0x8008, 0xfe0f, ' ', 1, "ld %d,Y" },
- { 0x9009, 0xfe0f, ' ', 1, "ld %d,Y+" },
- { 0x900a, 0xfe0f, ' ', 1, "ld %d,-Y" },
- { 0x8008, 0xd208, ' ', 1, "ldd %d,Y+%q" },
- { 0x8000, 0xfe0f, ' ', 1, "ld %d,Z" },
- { 0x9001, 0xfe0f, ' ', 1, "ld %d,Z+" },
- { 0x9002, 0xfe0f, ' ', 1, "ld %d,-Z" },
- { 0x8000, 0xd208, ' ', 1, "ldd %d,Z+%q" },
- { 0xe000, 0xf000, ' ', 1, "ldi %D,%K" },
- { 0x9000, 0xfe0f, ' ', 2, "lds %d,%R" },
- { 0x95c8, 0xffff, ' ', 1, "lpm" },
- { 0x95d8, 0xffff, ' ', 1, "elpm" }, // in some devices equal to lpm
- { 0x9406, 0xfe0f, ' ', 1, "lsr %d" },
- { 0x2c00, 0xfc00, ' ', 1, "mov %d,%r" },
- { 0x9c00, 0xfc00, ' ', 1, "mul %d,%r" },
- { 0x9401, 0xfe0f, ' ', 1, "neg %d" },
- { 0x2800, 0xfc00, ' ', 1, "or %d,%r" },
- { 0x6000, 0xf000, ' ', 1, "ori %d,%K" },
- { 0xb800, 0xf800, ' ', 1, "out %p,%d" },
- { 0x900f, 0xfe0f, ' ', 1, "pop %d" },
- { 0x920f, 0xfe0f, ' ', 1, "push %d" },
- { 0xd000, 0xf000, ' ', 1, "rcall %a" },
- { 0x9508, 0xff9f, ' ', 1, "ret" },
- { 0x9518, 0xff9f, ' ', 1, "reti" },
- { 0xc000, 0xf000, ' ', 1, "rjmp %a" },
- { 0x9407, 0xfe0f, ' ', 1, "ror %d" },
- { 0x0800, 0xfc00, ' ', 1, "sbc %d,%r" },
- { 0x4000, 0xf000, ' ', 1, "sbci %D,%K" },
- { 0x9a00, 0xff00, ' ', 1, "sbi %P,%b" },
- { 0x9900, 0xff00, ' ', 1, "sbic %P,%b" },
- { 0x9b00, 0xff00, ' ', 1, "sbis %P,%b" },
- { 0x9700, 0xff00, ' ', 1, "sbiw %2,%6" },
- { 0x6000, 0xf000, ' ', 1, "sbr %D,%K" },
- { 0xfc00, 0xfe00, ' ', 1, "sbrc %d,%b" },
- { 0xfe00, 0xfe00, ' ', 1, "sbrs %d,%b" },
- { 0xef0f, 0xff0f, ' ', 1, "ser %D" },
- { 0x9588, 0xffef, ' ', 1, "sleep" },
- { 0x920c, 0xfe0f, ' ', 1, "st X,%d" },
- { 0x920d, 0xfe0f, ' ', 1, "st X+,%d" },
- { 0x920e, 0xfe0f, ' ', 1, "st -X,%d" },
- { 0x8208, 0xfe0f, ' ', 1, "st Y,%d" },
- { 0x9209, 0xfe0f, ' ', 1, "st Y+,%d" },
- { 0x920a, 0xfe0f, ' ', 1, "st -Y,%d" },
- { 0x8208, 0xd208, ' ', 1, "std Y+%q,%d" },
- { 0x8200, 0xfe0f, ' ', 1, "st Z,%d" },
- { 0x9201, 0xfe0f, ' ', 1, "st Z+,%d" },
- { 0x9202, 0xfe0f, ' ', 1, "st -Z,%d" },
- { 0x8200, 0xd208, ' ', 1, "std Z+%q,%d" },
- { 0x9200, 0xfe0f, ' ', 2, "sts %R,%d" },
- { 0x1800, 0xfc00, ' ', 1, "sub %d,%r" },
- { 0x5000, 0xf000, ' ', 1, "subi %D,%K" },
- { 0x9402, 0xfe0f, ' ', 1, "swap %d" },
- { 0x95a8, 0xffef, ' ', 1, "wdr" },
+ { 0x0000, 0x00ff, ' ', 1, "nop" },
{ 0, 0, 0, 0, NULL }
};