ram->dump(0, 31, 16, con);
- con->printf("ITHSVNZC SREG= 0x%02x %3d %c\n",
- sreg, sreg, isprint(sreg)?sreg:'.');
- con->printf("%c%c%c%c%c%c%c%c ",
- (sreg&BIT_I)?'1':'0',
- (sreg&BIT_T)?'1':'0',
- (sreg&BIT_H)?'1':'0',
- (sreg&BIT_S)?'1':'0',
- (sreg&BIT_V)?'1':'0',
- (sreg&BIT_N)?'1':'0',
- (sreg&BIT_Z)?'1':'0',
- (sreg&BIT_C)?'1':'0');
- con->printf("SP = 0x%06x\n",
- ram->get(SPH)*256+ram->get(SPL));
+ con->dd_printf("ITHSVNZC SREG= 0x%02x %3d %c\n",
+ sreg, sreg, isprint(sreg)?sreg:'.');
+ con->dd_printf("%c%c%c%c%c%c%c%c ",
+ (sreg&BIT_I)?'1':'0',
+ (sreg&BIT_T)?'1':'0',
+ (sreg&BIT_H)?'1':'0',
+ (sreg&BIT_S)?'1':'0',
+ (sreg&BIT_V)?'1':'0',
+ (sreg&BIT_N)?'1':'0',
+ (sreg&BIT_Z)?'1':'0',
+ (sreg&BIT_C)?'1':'0');
+ con->dd_printf("SP = 0x%06x\n",
+ ram->get(SPH)*256+ram->get(SPL));
x= ram->get(XH)*256 + ram->get(XL);
data= ram->get(x);
- con->printf("X= 0x%04x [X]= 0x%02x %3d %c ", x,
- data, data, isprint(data)?data:'.');
+ con->dd_printf("X= 0x%04x [X]= 0x%02x %3d %c ", x,
+ data, data, isprint(data)?data:'.');
y= ram->get(YH)*256 + ram->get(YL);
data= ram->get(y);
- con->printf("Y= 0x%04x [Y]= 0x%02x %3d %c ", y,
- data, data, isprint(data)?data:'.');
+ con->dd_printf("Y= 0x%04x [Y]= 0x%02x %3d %c ", y,
+ data, data, isprint(data)?data:'.');
z= ram->get(ZH)*256 + ram->get(ZL);
data= ram->get(z);
- con->printf("Z= 0x%04x [Z]= 0x%02x %3d %c\n", z,
- data, data, isprint(data)?data:'.');
+ con->dd_printf("Z= 0x%04x [Z]= 0x%02x %3d %c\n", z,
+ data, data, isprint(data)?data:'.');
print_disass(PC, con);
}
}
else
{
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);
}
return(DD_FALSE);
{
if (hit > 99999)
{
- con->printf("Hit value %d is too big.\n", hit);
+ con->dd_printf("Hit value %d is too big.\n", hit);
return;
}
if (uc->fbrk->bp_at(addr))
- con->printf("Breakpoint at 0x%06x is already set.\n", addr);
+ con->dd_printf("Breakpoint at 0x%06x is already set.\n", addr);
else
{
class cl_brk *b= new cl_fetch_brk(uc->make_new_brknr(),
b->init();
uc->fbrk->add_bp(b);
char *s= uc->disass(addr, NULL);
- con->printf("Breakpoint %d at 0x%06x: %s\n", b->nr, addr, s);
+ con->dd_printf("Breakpoint %d at 0x%06x: %s\n", b->nr, addr, s);
free(s);
}
}
if (b)
uc->ebrk->add_bp(b);
else
- con->printf("Couldn't make event breakpoint\n");
+ con->dd_printf("Couldn't make event breakpoint\n");
}
{
if (!brk)
{
- con->printf("No breakpoint at this address.\n");
+ con->dd_printf("No breakpoint at this address.\n");
return(0);
}
uc->fbrk->del_bp(uc->PC);
return(DD_FALSE);
addr= param->value.address;
if (uc->fbrk->bp_at(addr) == 0)
- con->printf("No breakpoint at 0x%06x\n", addr);
+ con->dd_printf("No breakpoint at 0x%06x\n", addr);
else
uc->fbrk->del_bp(addr);
}
{
int i;
- con->printf("ucsim version %s\n", VERSIONSTR);
- con->printf("Type of microcontroller: %s\n", uc->id_string());
- con->printf("Controller has %d hardware element(s).\n",
- uc->hws->count);
+ con->dd_printf("ucsim version %s\n", VERSIONSTR);
+ con->dd_printf("Type of microcontroller: %s\n", uc->id_string());
+ con->dd_printf("Controller has %d hardware element(s).\n", uc->hws->count);
for (i= 0; i < uc->hws->count; i++)
{
class cl_hw *hw= (class cl_hw *)(uc->hws->at(i));
- con->printf(" %s[%d]\n", hw->id_string, hw->id);
+ con->dd_printf(" %s[%d]\n", hw->id_string, hw->id);
}
- con->printf("Memories:\n");
+ con->dd_printf("Memories:\n");
for (i= MEM_ROM; i < MEM_TYPES; i++)
{
class cl_mem *mem= (class cl_mem *)(uc->mems->at(i));
if (mem)
- con->printf(" %s size= 0x%06x %6d width= %2d class= \"%s\"\n",
- mem->id_string(), mem->size, mem->size, mem->width,
- (mem->class_name)?(mem->class_name):"unknown");
+ con->dd_printf(" %s size= 0x%06x %6d width= %2d class= \"%s\"\n",
+ mem->id_string(), mem->size, mem->size, mem->width,
+ (mem->class_name)?(mem->class_name):"unknown");
}
return(0);
}
uc->mems->put_at(type, mem);
}
else
- con->printf("Can not make memory \"%s\"\n", mem_class);
+ con->dd_printf("Can not make memory \"%s\"\n", mem_class);
}
return(DD_FALSE);
}
}
else
{
- con->printf("Error: wrong syntax\n"
- "%s\n", short_help?short_help:"no help");
+ con->dd_printf("Error: wrong syntax\n"
+ "%s\n", short_help?short_help:"no help");
}
return(DD_FALSE);;
if (params[0])
if (!(params[0]->get_address(sim->uc, &start)))
{
- con->printf("Error: wrong start address\n");
+ con->dd_printf("Error: wrong start address\n");
return(DD_FALSE);
}
if (params[1])
if (!(params[1]->get_address(sim->uc, &end)))
{
- con->printf("Error: wromg end address\n");
+ con->dd_printf("Error: wromg end address\n");
return(DD_FALSE);
}
if (params[0])
{
if (!sim->uc->inst_at(start))
- con->printf("Warning: maybe not instruction at 0x%06lx\n", start);
+ con->dd_printf("Warning: maybe not instruction at 0x%06lx\n", start);
sim->uc->PC= start;
if (params[1])
{
if (start == end)
{
- con->printf("Addresses must be different.\n");
+ con->dd_printf("Addresses must be different.\n");
return(DD_FALSE);
}
if ((b= sim->uc->fbrk_at(end)))
}
}
}
- con->printf("Simulation started, PC=0x%06x\n", sim->uc->PC);
+ con->dd_printf("Simulation started, PC=0x%06x\n", sim->uc->PC);
if (sim->uc->fbrk_at(start))
sim->uc->do_inst(1);
sim->start(con);
{
c= (class cl_cmd *)(cmdset->at(i));
if (c->short_help)
- con->printf("%s\n", c->short_help);
+ con->dd_printf("%s\n", c->short_help);
else
- con->printf("%s\n", (char*)(c->names->at(0)));
+ con->dd_printf("%s\n", (char*)(c->names->at(0)));
}
}
else if (cmdline->syntax_match(/*sim*/0, STRING)) {
matches++;
}
if (!matches)
- con->printf("No such command\n");
+ con->dd_printf("No such command\n");
else if (matches > 1)
for (i= 0; i < cmdset->count; i++)
{
if (!c->name_match(parm->value.string.string, DD_FALSE))
continue;
if (c->short_help)
- con->printf("%s\n", c->short_help);
+ con->dd_printf("%s\n", c->short_help);
else
- con->printf("%s\n", (char*)(c->names->at(0)));
+ con->dd_printf("%s\n", (char*)(c->names->at(0)));
}
else
for (i= 0; i < cmdset->count; i++)
if (!c->name_match(parm->value.string.string, DD_FALSE))
continue;
if (c->short_help)
- con->printf("%s\n", c->short_help);
+ con->dd_printf("%s\n", c->short_help);
else
- con->printf("%s\n", (char*)(c->names->at(0)));
+ con->dd_printf("%s\n", (char*)(c->names->at(0)));
int names;
- con->printf("Names of command:");
+ con->dd_printf("Names of command:");
for (names= 0; names < c->names->count; names++)
- con->printf(" %s", (char*)(c->names->at(names)));
- con->printf("\n");
+ con->dd_printf(" %s", (char*)(c->names->at(names)));
+ con->dd_printf("\n");
if (c->long_help)
- con->printf("%s\n", c->long_help);
+ con->dd_printf("%s\n", c->long_help);
else
- con->printf("%s\n", (char*)(c->names->at(0)));
+ con->dd_printf("%s\n", (char*)(c->names->at(0)));
}
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax");
return(0);
}
// class cl_cmdline *cmdline, class cl_console *con)
COMMAND_DO_WORK_UC(cl_state_cmd)
{
- con->printf("CPU state= %s PC= 0x%06x XTAL= %g\n",
- get_id_string(cpu_states, uc->state),
- uc->PC,
- uc->xtal);
- con->printf("Total time since last reset= %g sec (%lu clks)\n",
- uc->get_rtime(), uc->ticks->ticks);
- con->printf("Time in isr = %g sec (%lu clks) %3.2g%%\n",
- uc->isr_ticks->get_rtime(uc->xtal),
- uc->isr_ticks->ticks,
- (uc->ticks->ticks == 0)?0.0:
- (100.0*((double)(uc->isr_ticks->ticks)/
- (double)(uc->ticks->ticks))));
- con->printf("Time in idle= %g sec (%lu clks) %3.2g%%\n",
- uc->idle_ticks->get_rtime(uc->xtal),
- uc->idle_ticks->ticks,
- (uc->ticks->ticks == 0)?0.0:
- (100.0*((double)(uc->idle_ticks->ticks)/
- (double)(uc->ticks->ticks))));
- con->printf("Max value of stack pointer= 0x%06x, avg= 0x%06x\n",
- uc->sp_max, uc->sp_avg);
+ con->dd_printf("CPU state= %s PC= 0x%06x XTAL= %g\n",
+ get_id_string(cpu_states, uc->state),
+ uc->PC,
+ uc->xtal);
+ con->dd_printf("Total time since last reset= %g sec (%lu clks)\n",
+ uc->get_rtime(), uc->ticks->ticks);
+ con->dd_printf("Time in isr = %g sec (%lu clks) %3.2g%%\n",
+ uc->isr_ticks->get_rtime(uc->xtal),
+ uc->isr_ticks->ticks,
+ (uc->ticks->ticks == 0)?0.0:
+ (100.0*((double)(uc->isr_ticks->ticks)/
+ (double)(uc->ticks->ticks))));
+ con->dd_printf("Time in idle= %g sec (%lu clks) %3.2g%%\n",
+ uc->idle_ticks->get_rtime(uc->xtal),
+ uc->idle_ticks->ticks,
+ (uc->ticks->ticks == 0)?0.0:
+ (100.0*((double)(uc->idle_ticks->ticks)/
+ (double)(uc->ticks->ticks))));
+ con->dd_printf("Max value of stack pointer= 0x%06x, avg= 0x%06x\n",
+ uc->sp_max, uc->sp_avg);
return(0);
}
if ((cmdline->param(0) == 0) ||
((fname= cmdline->param(0)->get_svalue()) == NULL))
{
- con->printf("File name is missing.\n");
+ con->dd_printf("File name is missing.\n");
return(0);
}
if ((l= uc->read_hex_file(fname)) >= 0)
- con->printf("%ld words read from %s\n", l, fname);
+ con->dd_printf("%ld words read from %s\n", l, fname);
return(0);
}
long l;
if ((l= uc->read_hex_file(NULL)) >= 0)
- con->printf("%ld words loaded\n", l);
+ con->dd_printf("%ld words loaded\n", l);
return(0);
}
{
if (!(params[0]->get_address(uc, &addr)))
{
- con->printf("Error: wrong parameter\n");
+ con->dd_printf("Error: wrong parameter\n");
return(DD_FALSE);
}
if (addr >= uc->get_mem_size(MEM_ROM))
addr= 0;
if (!uc->inst_at(addr))
- con->printf("Warning: maybe not instruction at 0x%06x\n", addr);
+ con->dd_printf("Warning: maybe not instruction at 0x%06x\n", addr);
uc->PC= addr;
}
uc->print_disass(uc->PC, con);
mem,
params[0]->value.bit.mem_address,
params[0]->value.bit.mask);
- con->printf("%10s ", sn?sn:"");
- con->printf(mem->addr_format, params[0]->value.bit.mem_address);
- con->printf(" ");
- con->printf(mem->data_format, m);
- con->printf(" %c\n", (m&(params[0]->value.bit.mask))?'1':'0');
+ con->dd_printf("%10s ", sn?sn:"");
+ con->dd_printf(mem->addr_format, params[0]->value.bit.mem_address);
+ con->dd_printf(" ");
+ con->dd_printf(mem->data_format, m);
+ con->dd_printf(" %c\n", (m&(params[0]->value.bit.mask))?'1':'0');
i++;
params[0]= cmdline->param(i);
}
if (params[0])
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
}
else if (cmdline->syntax_match(uc, MEMORY))
{
mem->dump(start, end, bpl, con);
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);;
}
}
if (start >= rom->size)
{
- con->printf("Error: start address is wrong\n");
+ con->dd_printf("Error: start address is wrong\n");
return(DD_FALSE);
}
if (end >= rom->size)
{
- con->printf("Error: end address is wrong\n");
+ con->dd_printf("Error: end address is wrong\n");
return(DD_FALSE);
}
}
else
{
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);
}
if (lines < 1)
{
- con->printf("Error: wrong `lines' parameter\n");
+ con->dd_printf("Error: wrong `lines' parameter\n");
return(DD_FALSE);
}
if (!uc->there_is_inst())
}
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);;
}
int len= params[1]->value.data_list.len;
if (!len)
{
- con->printf("Error: nothing to search for\n");
+ con->dd_printf("Error: nothing to search for\n");
return(DD_FALSE);
}
t_addr addr= 0;
}
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);
}
if (!mem)
{
- con->printf("Error: No SFR\n");
+ con->dd_printf("Error: No SFR\n");
return(DD_FALSE);
}
for (i= 0, parm= cmdline->param(i);
i++, parm= cmdline->param(i))
{
if (!parm->as_address(uc))
- con->printf("Warning: Invalid address %s\n",
- (char*)cmdline->tokens->at(i+1));
+ con->dd_printf("Warning: Invalid address %s\n",
+ (char*)cmdline->tokens->at(i+1));
else
mem->dump(parm->value.address, parm->value.address, 1, con);
}
s= parm->value.string.string;
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
int i;
for (i= 0; i < uc->options->count; i++)
if (!s ||
!strcmp(s, o->id))
{
- con->printf("%s ", o->id);
+ con->dd_printf("%s ", o->id);
o->print(con);
- con->printf(" %s\n", o->help);
+ con->dd_printf(" %s\n", o->help);
}
}
int i;
char *s;
- con->printf("Num Type Disp Hit Cnt Address What\n");
+ con->dd_printf("Num Type Disp Hit Cnt Address What\n");
for (i= 0; i < uc->fbrk->count; i++)
{
class cl_brk *fb= (class cl_brk *)(uc->fbrk->at(i));
s= uc->disass(fb->addr, NULL);
- con->printf("%-3d %-10s %s %-5d %-5d 0x%06x %s\n", fb->nr,
- "fetch", (fb->perm==brkFIX)?"keep":"del ",
- fb->hit, fb->cnt,
- fb->addr, s);
+ con->dd_printf("%-3d %-10s %s %-5d %-5d 0x%06x %s\n", fb->nr,
+ "fetch", (fb->perm==brkFIX)?"keep":"del ",
+ fb->hit, fb->cnt,
+ fb->addr, s);
free(s);
}
for (i= 0; i < uc->ebrk->count; i++)
{
class cl_ev_brk *eb= (class cl_ev_brk *)(uc->ebrk->at(i));
- con->printf("%-3d %-10s %s %-5d %-5d 0x%06x %s\n", eb->nr,
- "event", (eb->perm==brkFIX)?"keep":"del ",
- eb->hit, eb->cnt,
- eb->addr, eb->id);
+ con->dd_printf("%-3d %-10s %s %-5d %-5d 0x%06x %s\n", eb->nr,
+ "event", (eb->perm==brkFIX)?"keep":"del ",
+ eb->hit, eb->cnt,
+ eb->addr, eb->id);
}
/*t_addr a;
class cl_rom *r= (class cl_rom *)(sim->uc->mem(MEM_ROM));
for (a= 0; a < sim->uc->get_mem_size(MEM_ROM); a++)
{
if (r->bp_map->get(a))
- con->printf("0x%06x\n", a);
+ con->dd_printf("0x%06x\n", a);
}*/
return(0);
}
hw->print_info(con);
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);
}
if (*end == '"')
end--;
else
- con->printf("Unterminated string\n");
+ con->dd_printf("Unterminated string\n");
param_str= (char *)malloc(end-start+2);
strncpy(param_str, start, 1+end-start);
param_str[1+end-start]= '\0';
if (*dot == '\0')
{
bit= 0;
- con->printf("Uncomplete bit address\n");
+ con->dd_printf("Uncomplete bit address\n");
delete sfr;
}
else
if (*dot == '\0')
{
aname= 0;
- con->printf("Uncomplete array\n");
+ con->dd_printf("Uncomplete array\n");
}
else
{
*p= '\0';
if (strlen(dot) == 0)
{
- con->printf("Uncomplete array index\n");
+ con->dd_printf("Uncomplete array index\n");
delete aname;
}
else
case operate_on_app:
if (!app)
{
- con->printf("There is no application to work on!\n");
+ con->dd_printf("There is no application to work on!\n");
return(DD_TRUE);
}
return(do_work(app, cmdline, con));
case operate_on_sim:
if (!sim)
{
- con->printf("There is no simulator to work on!\n");
+ con->dd_printf("There is no simulator to work on!\n");
return(DD_TRUE);
}
return(do_work(sim, cmdline, con));
case operate_on_uc:
if (!sim)
{
- con->printf("There is no microcontroller to work on!\n");
+ con->dd_printf("There is no microcontroller to work on!\n");
return(DD_TRUE);
}
return(do_work(uc, cmdline, con));
int
cl_cmd::do_work(class cl_cmdline *cmdline, class cl_console *con)
{
- con->printf("Command \"%s\" does nothing.\n",
+ con->dd_printf("Command \"%s\" does nothing.\n",
(char*)(names->at(0)));
return(0);
}
cl_cmd::do_work(class cl_app *app,
class cl_cmdline *cmdline, class cl_console *con)
{
- con->printf("Command \"%s\" does nothing on application.\n",
+ con->dd_printf("Command \"%s\" does nothing on application.\n",
(char*)(names->at(0)));
return(0);
}
cl_cmd::do_work(class cl_sim *sim,
class cl_cmdline *cmdline, class cl_console *con)
{
- con->printf("Command \"%s\" does nothing on simulator.\n",
+ con->dd_printf("Command \"%s\" does nothing on simulator.\n",
(char*)(names->at(0)));
return(0);
}
cl_cmd::do_work(class cl_uc *uc,
class cl_cmdline *cmdline, class cl_console *con)
{
- con->printf("Command \"%s\" does nothing on microcontroller.\n",
+ con->dd_printf("Command \"%s\" does nothing on microcontroller.\n",
(char*)(names->at(0)));
return(0);
}
if ((cmd= commands->get_cmd("_no_parameters_")) != 0)
return(cmd->work(app, cmdline, con));
int i;
- con->printf("\"%s\" must be followed by the name of a subcommand\n"
- "List of subcommands:\n", (char*)(names->at(0)));
+ con->dd_printf("\"%s\" must be followed by the name of a subcommand\n"
+ "List of subcommands:\n", (char*)(names->at(0)));
for (i= 0; i < commands->count; i++)
{
cmd= (class cl_cmd *)(commands->at(i));
- con->printf("%s\n", cmd->short_help);
+ con->dd_printf("%s\n", cmd->short_help);
}
return(0);
}
if ((cmd= commands->get_cmd(cmdline)) == NULL)
{
- con->printf("Undefined subcommand: \"%s\". Try \"help %s\".\n",
- cmdline->name, (char*)(names->at(0)));
+ con->dd_printf("Undefined subcommand: \"%s\". Try \"help %s\".\n",
+ cmdline->name, (char*)(names->at(0)));
return(0);
}
return(cmd->work(app, cmdline, con));
isatty(fileno(in)))
flags|= CONS_INTERACTIVE;
else
- printf("Warning: non-interactive console\n");
+ dd_printf("Warning: non-interactive console\n");
}
cl_console::cl_console(FILE *fin, FILE *fout, class cl_app *the_app):
isatty(fileno(in)))
flags|= CONS_INTERACTIVE;
else
- printf("Warning: non-interactive console\n");
+ dd_printf("Warning: non-interactive console\n");
}
/*
}
int
-cl_console::printf(char *format, ...)
+cl_console::dd_printf(char *format, ...)
{
va_list ap;
int ret= 0;
*/
int
-cl_commander::printf(char *format, ...)
+cl_commander::dd_printf(char *format, ...)
{
va_list ap;
int ret= 0;
virtual void welcome(void);
virtual void print_prompt(void);
- virtual int printf(char *format, ...);
+ virtual int dd_printf(char *format, ...);
virtual void print_bin(long data, int bits);
virtual int match(int fdnum);
virtual int get_in_fd(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 dd_printf(char *format, ...); // print to actual_console
int debug(char *format, ...); // print consoles with debug flag set
int flag_printf(int iflags, char *format, ...);
int input_avail(void);
int len= params[2]->value.data_list.len;
if (len == 0)
- con->printf("Error: no data\n");
+ con->dd_printf("Error: no data\n");
else
{
int i;
}
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);;
}
mem->dump(mem_addr, mem_addr, 1, con);
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);;
}
l= params[1]->value.number;
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
if (pn < 0 ||
pn > 3)
- con->printf("Error: wrong port\n");
+ con->dd_printf("Error: wrong port\n");
else
uc->port_pins[pn]= l;
return(DD_FALSE);;
s= params[1]->value.string.string;
}
else
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
if (!id ||
!s)
{
- con->printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
+ con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
return(DD_FALSE);
}
// class cl_cmdline *cmdline, class cl_console *con)
COMMAND_DO_WORK(cl_show_copying_cmd)
{
- con->printf("%s\n", copying);
+ con->dd_printf("%s\n", copying);
return(DD_FALSE);;
}
// class cl_cmdline *cmdline, class cl_console *con)
COMMAND_DO_WORK(cl_show_warranty_cmd)
{
- con->printf("%s\n", warranty);
+ con->dd_printf("%s\n", warranty);
return(DD_FALSE);;
}
if (cmdline->param(0) == 0)
{
if (long_help)
- con->printf("%s\n", long_help);
+ con->dd_printf("%s\n", long_help);
else
- con->printf("What to do?\n");
+ con->dd_printf("What to do?\n");
return(0);
}
if ((s= cmdline->param(0)->get_svalue()))
{
if (cmdline->param(1) == 0)
{
- con->printf("Timer number is missing\n");
+ con->dd_printf("Timer number is missing\n");
return(0);
}
set_ticker(uc, cmdline->param(1));
else if (strstr(s, "v") == s)
return(val(uc, cmdline, con));
else
- con->printf("Undefined timer command: \"%s\". Try \"help timer\"\n",
- s);
+ con->dd_printf("Undefined timer command: \"%s\". Try \"help timer\"\n",
+ s);
}
return(0);
}
if (!name &&
what < 1)
{
- con->printf("Error: Timer id must be greater then zero or a string\n");
+ con->dd_printf("Error: "
+ "Timer id must be greater then zero or a string\n");
return(DD_FALSE);
}
if (ticker)
{
if (name)
- con->printf("Error: Timer \"%s\" already exists\n", name);
+ con->dd_printf("Error: Timer \"%s\" already exists\n", name);
else
- con->printf("Error: Timer %d already exists\n", what);
+ con->dd_printf("Error: Timer %d already exists\n", what);
return(0);
}
if (params[2])
if (!params[2]->get_ivalue(&dir))
{
- con->printf("Error: Wrong direction\n");
+ con->dd_printf("Error: Wrong direction\n");
return(DD_FALSE);
}
if (params[3])
if (!params[3]->get_ivalue(&in_isr))
{
- con->printf("Error: Wrong parameter\n");
+ con->dd_printf("Error: Wrong parameter\n");
return(DD_FALSE);
}
if (!ticker)
{
if (name)
- con->printf("Timer \"%s\" does not exist\n", name);
+ con->dd_printf("Timer \"%s\" does not exist\n", name);
else
- con->printf("Timer %d does not exist\n", what);
+ con->dd_printf("Timer %d does not exist\n", what);
return(0);
}
if (name)
if (!ticker)
{
if (name)
- con->printf("Timer %d does not exist\n", name);
+ con->dd_printf("Timer %d does not exist\n", name);
else
- con->printf("Timer %d does not exist\n", what);
+ con->dd_printf("Timer %d does not exist\n", what);
return(0);
}
ticker->options|= TICK_RUN;
if (!ticker)
{
if (name)
- con->printf("Timer %d does not exist\n", name);
+ con->dd_printf("Timer %d does not exist\n", name);
else
- con->printf("Timer %d does not exist\n", what);
+ con->dd_printf("Timer %d does not exist\n", what);
return(0);
}
ticker->options&= ~TICK_RUN;
if (!ticker)
{
if (name)
- con->printf("Error: Timer %d does not exist\n", name);
+ con->dd_printf("Error: Timer %d does not exist\n", name);
else
- con->printf("Error: Timer %d does not exist\n", what);
+ con->dd_printf("Error: Timer %d does not exist\n", what);
return(0);
}
if (params[2])
{
- con->printf("Error: Value is missing\n");
+ con->dd_printf("Error: Value is missing\n");
return(DD_FALSE);
}
long val;
if (!params[2]->get_ivalue(&val))
{
- con->printf("Error: Wrong parameter\n");
+ con->dd_printf("Error: Wrong parameter\n");
return(DD_FALSE);
}
ticker->ticks= val;
int ie= uc->get_mem(MEM_SFR, IE);
int i;
- con->printf("Interrupts are %s. Interrupt sources:\n",
- (ie&bmEA)?"enabled":"disabled");
- con->printf(" Handler En Pr Req Act Name\n");
+ con->dd_printf("Interrupts are %s. Interrupt sources:\n",
+ (ie&bmEA)?"enabled":"disabled");
+ con->dd_printf(" Handler En Pr Req Act Name\n");
for (i= 0; i < uc->it_sources->count; i++)
{
class cl_it_src *is= (class cl_it_src *)(uc->it_sources->at(i));
- con->printf(" 0x%06x", is->addr);
- con->printf(" %-3s", (ie&(is->ie_mask))?"en":"dis");
- con->printf(" %2d", uc->it_priority(is->ie_mask));
- con->printf(" %-3s",
- (uc->get_mem(MEM_SFR, is->src_reg)&(is->src_mask))?
- "YES":"no");
- con->printf(" %-3s", (is->active)?"act":"no");
- con->printf(" %s", is->name);
- con->printf("\n");
+ con->dd_printf(" 0x%06x", is->addr);
+ con->dd_printf(" %-3s", (ie&(is->ie_mask))?"en":"dis");
+ con->dd_printf(" %2d", uc->it_priority(is->ie_mask));
+ con->dd_printf(" %-3s",
+ (uc->get_mem(MEM_SFR, is->src_reg)&(is->src_mask))?
+ "YES":"no");
+ con->dd_printf(" %-3s", (is->active)?"act":"no");
+ con->dd_printf(" %s", is->name);
+ con->dd_printf("\n");
}
- con->printf("Active interrupt service(s):\n");
- con->printf(" Pr Handler PC Source\n");
+ con->dd_printf("Active interrupt service(s):\n");
+ con->dd_printf(" Pr Handler PC Source\n");
for (i= 0; i < uc->it_levels->count; i++)
{
class it_level *il= (class it_level *)(uc->it_levels->at(i));
if (il->level >= 0)
{
- con->printf(" %2d", il->level);
- con->printf(" 0x%06x", il->addr);
- con->printf(" 0x%06x", il->PC);
- con->printf(" %s", (il->source)?(il->source->name):"nothing");
- con->printf("\n");
+ con->dd_printf(" %2d", il->level);
+ con->dd_printf(" 0x%06x", il->addr);
+ con->dd_printf(" 0x%06x", il->PC);
+ con->dd_printf(" %s", (il->source)?(il->source->name):"nothing");
+ con->dd_printf("\n");
}
}
}
{
uchar data;
- con->printf("%s[%d]\n", id_string, id);
+ con->dd_printf("%s[%d]\n", id_string, id);
data= uc->get_mem(MEM_SFR, sfr);
- con->printf("P%d ", id);
+ con->dd_printf("P%d ", id);
con->print_bin(data, 8);
- con->printf(" 0x%02x %3d %c (Value in SFR register)\n",
- data, data, isprint(data)?data:'.');
+ con->dd_printf(" 0x%02x %3d %c (Value in SFR register)\n",
+ data, data, isprint(data)?data:'.');
data= uc->port_pins[id];
- con->printf("Pin%d ", id);
+ con->dd_printf("Pin%d ", id);
con->print_bin(data, 8);
- con->printf(" 0x%02x %3d %c (Output of outside circuits)\n",
- data, data, isprint(data)?data:'.');
+ con->dd_printf(" 0x%02x %3d %c (Output of outside circuits)\n",
+ data, data, isprint(data)?data:'.');
data= uc->port_pins[id] & uc->get_mem(MEM_SFR, sfr);
- con->printf("Port%d ", id);
+ con->dd_printf("Port%d ", id);
con->print_bin(data, 8);
- con->printf(" 0x%02x %3d %c (Value on the port pins)\n",
- data, data, isprint(data)?data:'.');
+ con->dd_printf(" 0x%02x %3d %c (Value on the port pins)\n",
+ data, data, isprint(data)?data:'.');
}
"9 bit UART timer clocked" };
int scon= uc->get_mem(MEM_SFR, SCON);
- con->printf("%s[%d]", id_string, id);
+ con->dd_printf("%s[%d]", id_string, id);
int mode= (scon&(bmSM0|bmSM1))>>6;
- con->printf(" %s MultiProc=%s", modes[mode],
- (mode&2)?((scon&bmSM2)?"ON":"OFF"):"none");
- con->printf(" irq=%s", (uc->get_mem(MEM_SFR, IE)&bmES)?"en":"dis");
- con->printf(" prio=%d", uc->it_priority(bmPS));
- con->printf("\n");
+ con->dd_printf(" %s MultiProc=%s", modes[mode],
+ (mode&2)?((scon&bmSM2)?"ON":"OFF"):"none");
+ con->dd_printf(" irq=%s", (uc->get_mem(MEM_SFR, IE)&bmES)?"en":"dis");
+ con->dd_printf(" prio=%d", uc->it_priority(bmPS));
+ con->dd_printf("\n");
- con->printf("Receiver");
- con->printf(" %s", (scon&bmREN)?"ON":"OFF");
- con->printf(" RB8=%c", (scon&bmRB8)?'1':'0');
- con->printf(" irq=%c", (scon&bmRI)?'1':'0');
- con->printf("\n");
+ con->dd_printf("Receiver");
+ con->dd_printf(" %s", (scon&bmREN)?"ON":"OFF");
+ con->dd_printf(" RB8=%c", (scon&bmRB8)?'1':'0');
+ con->dd_printf(" irq=%c", (scon&bmRI)?'1':'0');
+ con->dd_printf("\n");
- con->printf("Transmitter");
- con->printf(" TB8=%c", (scon&bmTB8)?'1':'0');
- con->printf(" irq=%c", (scon&bmTI)?'1':'0');
- con->printf("\n");
+ con->dd_printf("Transmitter");
+ con->dd_printf(" TB8=%c", (scon&bmTB8)?'1':'0');
+ con->dd_printf(" irq=%c", (scon&bmTI)?'1':'0');
+ con->dd_printf("\n");
}
int tmod= uc->get_mem(MEM_SFR, TMOD);
int on;
- con->printf("%s[%d] 0x%04x", id_string, id,
- 256*uc->get_mem(MEM_SFR, TH0)+uc->get_mem(MEM_SFR, TL0));
+ con->dd_printf("%s[%d] 0x%04x", id_string, id,
+ 256*uc->get_mem(MEM_SFR, TH0)+uc->get_mem(MEM_SFR, TL0));
int mode= tmod & (bmM00|bmM10);
- con->printf(" %s", modes[mode]);
- con->printf(" %s", (tmod&bmC_T0)?"counter":"timer");
+ con->dd_printf(" %s", modes[mode]);
+ con->dd_printf(" %s", (tmod&bmC_T0)?"counter":"timer");
if (tmod&bmGATE0)
{
- con->printf(" gated");
+ con->dd_printf(" gated");
on= uc->get_mem(MEM_SFR, P3) & uc->port_pins[3] & bm_INT0;
}
else
on= uc->get_mem(MEM_SFR, TCON) & bmTR0;
- con->printf(" %s", on?"ON":"OFF");
- con->printf(" irq=%c", (uc->get_mem(MEM_SFR, TCON)&bmTF0)?'1':'0');
- con->printf(" %s", (uc->get_mem(MEM_SFR, IE)&bmET0)?"en":"dis");
- con->printf(" prio=%d", uc->it_priority(bmPT0));
- con->printf("\n");
+ con->dd_printf(" %s", on?"ON":"OFF");
+ con->dd_printf(" irq=%c", (uc->get_mem(MEM_SFR, TCON)&bmTF0)?'1':'0');
+ con->dd_printf(" %s", (uc->get_mem(MEM_SFR, IE)&bmET0)?"en":"dis");
+ con->dd_printf(" prio=%d", uc->it_priority(bmPT0));
+ con->dd_printf("\n");
}
int tmod= uc->get_mem(MEM_SFR, TMOD);
int on;
- con->printf("%s[%d] 0x%04x", id_string, id,
- 256*uc->get_mem(MEM_SFR, TH1)+uc->get_mem(MEM_SFR, TL1));
+ con->dd_printf("%s[%d] 0x%04x", id_string, id,
+ 256*uc->get_mem(MEM_SFR, TH1)+uc->get_mem(MEM_SFR, TL1));
int mode= (tmod & (bmM11|bmM01)) >> 4;
- con->printf(" %s", modes[mode]);
- con->printf(" %s", (tmod&bmC_T1)?"counter":"timer");
+ con->dd_printf(" %s", modes[mode]);
+ con->dd_printf(" %s", (tmod&bmC_T1)?"counter":"timer");
if (tmod&bmGATE1)
{
- con->printf(" gated");
+ con->dd_printf(" gated");
on= uc->get_mem(MEM_SFR, P3) & uc->port_pins[3] & bm_INT0;
}
else
on= uc->get_mem(MEM_SFR, TCON) & bmTR1;
- con->printf(" %s", on?"ON":"OFF");
- con->printf(" irq=%c", (uc->get_mem(MEM_SFR, TCON)&bmTF1)?'1':'0');
- con->printf(" %s", (uc->get_mem(MEM_SFR, IE)&bmET1)?"en":"dis");
- con->printf(" prio=%d", uc->it_priority(bmPT1));
- con->printf("\n");
+ con->dd_printf(" %s", on?"ON":"OFF");
+ con->dd_printf(" irq=%c", (uc->get_mem(MEM_SFR, TCON)&bmTF1)?'1':'0');
+ con->dd_printf(" %s", (uc->get_mem(MEM_SFR, IE)&bmET1)?"en":"dis");
+ con->dd_printf(" prio=%d", uc->it_priority(bmPT1));
+ con->dd_printf("\n");
}
{
int t2con= uc->get_mem(MEM_SFR, T2CON);
- con->printf("%s[%d] 0x%04x", id_string, id,
- 256*uc->get_mem(MEM_SFR, TH2)+uc->get_mem(MEM_SFR, TL2));
+ con->dd_printf("%s[%d] 0x%04x", id_string, id,
+ 256*uc->get_mem(MEM_SFR, TH2)+uc->get_mem(MEM_SFR, TL2));
if (t2con & (bmRCLK|bmTCLK))
{
- con->printf(" baud");
+ con->dd_printf(" baud");
if (t2con & bmRCLK)
- con->printf(" RCLK");
+ con->dd_printf(" RCLK");
if (t2con & bmTCLK)
- con->printf(" TCLK");
+ con->dd_printf(" TCLK");
}
else
- con->printf(" %s", (t2con&bmCP_RL2)?"capture":"reload");
- con->printf(" 0x%04x",
- 256*uc->get_mem(MEM_SFR, RCAP2H)+uc->get_mem(MEM_SFR, RCAP2L));
- con->printf(" %s", (t2con&bmC_T2)?"counter":"timer");
- con->printf(" %s", (t2con&bmTR2)?"ON":"OFF");
- con->printf(" irq=%c", (t2con&bmTF2)?'1':'0');
- con->printf(" %s", (uc->get_mem(MEM_SFR, IE)&bmET2)?"en":"dis");
- con->printf(" prio=%d", uc->it_priority(bmPT2));
- con->printf("\n");
+ con->dd_printf(" %s", (t2con&bmCP_RL2)?"capture":"reload");
+ con->dd_printf(" 0x%04x",
+ 256*uc->get_mem(MEM_SFR, RCAP2H)+
+ uc->get_mem(MEM_SFR, RCAP2L));
+ con->dd_printf(" %s", (t2con&bmC_T2)?"counter":"timer");
+ con->dd_printf(" %s", (t2con&bmTR2)?"ON":"OFF");
+ con->dd_printf(" irq=%c", (t2con&bmTF2)?'1':'0');
+ con->dd_printf(" %s", (uc->get_mem(MEM_SFR, IE)&bmET2)?"en":"dis");
+ con->dd_printf(" prio=%d", uc->it_priority(bmPT2));
+ con->dd_printf("\n");
}
iram->dump (start, start + 7, 8, con);
start = sfr->get (PSW) & 0x18;
data = iram->get (iram->get (start));
- con->printf ("%06x %02x %c",
- iram->get (start), data, isprint (data) ? data : '.');
- con->printf (" ACC= 0x%02x %3d %c B= 0x%02x",
- sfr->get (ACC), sfr->get (ACC),
- isprint (sfr->get (ACC)) ? (sfr->get (ACC)) : '.', sfr->get (B));
+ con->dd_printf("%06x %02x %c",
+ iram->get (start), data, isprint (data) ? data : '.');
+ con->dd_printf(" ACC= 0x%02x %3d %c B= 0x%02x",
+ sfr->get (ACC), sfr->get (ACC),
+ isprint (sfr->get (ACC)) ?
+ (sfr->get (ACC)) : '.', sfr->get (B));
eram2xram ();
data = get_mem (MEM_XRAM,
sfr->get (DPX) * 256*256 + sfr->get (DPH) * 256 + sfr->get (DPL));
- con->printf (" DPTR= 0x%02x%02x%02x @DPTR= 0x%02x %3d %c\n",
- sfr->get (DPX), sfr->get (DPH), sfr->get (DPL),
- data, data, isprint (data) ? data : '.');
+ con->dd_printf (" DPTR= 0x%02x%02x%02x @DPTR= 0x%02x %3d %c\n",
+ sfr->get (DPX), sfr->get (DPH), sfr->get (DPL),
+ data, data, isprint (data) ? data : '.');
data = iram->get (iram->get (start + 1));
- con->printf ("%06x %02x %c", iram->get (start + 1), data,
- isprint (data) ? data : '.');
+ con->dd_printf ("%06x %02x %c", iram->get (start + 1), data,
+ isprint (data) ? data : '.');
data= sfr->get (PSW);
- con->printf (" PSW= 0x%02x CY=%c AC=%c OV=%c P=%c ",
- data,
- (data & bmCY) ? '1' : '0', (data & bmAC) ? '1' : '0',
- (data & bmOV) ? '1' : '0', (data & bmP ) ? '1' : '0'
- );
+ con->dd_printf (" PSW= 0x%02x CY=%c AC=%c OV=%c P=%c ",
+ data,
+ (data & bmCY) ? '1' : '0', (data & bmAC) ? '1' : '0',
+ (data & bmOV) ? '1' : '0', (data & bmP ) ? '1' : '0'
+ );
/* show stack pointer */
if (sfr->get (ACON) & 0x04)
/* SA: 10 bit stack */
- con->printf ("SP10 0x%03x %3d\n",
- (sfr->get (ESP) & 3) * 256 + sfr->get (SP),
- get_mem (MEM_IXRAM, (sfr->get (ESP) & 3) * 256 + sfr->get (SP))
- );
+ con->dd_printf ("SP10 0x%03x %3d\n",
+ (sfr->get (ESP) & 3) * 256 + sfr->get (SP),
+ get_mem (MEM_IXRAM, (sfr->get (ESP) & 3) * 256 + sfr->get (SP))
+ );
else
- con->printf ("SP 0x%02x %3d\n",
- sfr->get (SP),
- iram->get (sfr->get (SP))
- );
+ con->dd_printf ("SP 0x%02x %3d\n",
+ sfr->get (SP),
+ iram->get (sfr->get (SP))
+ );
print_disass (PC, con);
}
/* End of s51.src/uc390.cc */
iram->dump(start, start+7, 8, con);
start= sfr->get(PSW) & 0x18;
data= iram->get(iram->get(start));
- con->printf("%06x %02x %c",
- iram->get(start), data, isprint(data)?data:'.');
+ con->dd_printf("%06x %02x %c",
+ iram->get(start), data, isprint(data)?data:'.');
- con->printf(" ACC= 0x%02x %3d %c B= 0x%02x", sfr->get(ACC), sfr->get(ACC),
- isprint(sfr->get(ACC))?(sfr->get(ACC)):'.', sfr->get(B));
+ con->dd_printf(" ACC= 0x%02x %3d %c B= 0x%02x",
+ sfr->get(ACC), sfr->get(ACC),
+ isprint(sfr->get(ACC))?(sfr->get(ACC)):'.', sfr->get(B));
eram2xram();
data= get_mem(MEM_XRAM, sfr->get(DPH)*256+sfr->get(DPL));
- con->printf(" DPTR= 0x%02x%02x @DPTR= 0x%02x %3d %c\n", sfr->get(DPH),
- sfr->get(DPL), data, data, isprint(data)?data:'.');
+ con->dd_printf(" DPTR= 0x%02x%02x @DPTR= 0x%02x %3d %c\n", sfr->get(DPH),
+ sfr->get(DPL), data, data, isprint(data)?data:'.');
data= iram->get(iram->get(start+1));
- con->printf("%06x %02x %c", iram->get(start+1), data,
- isprint(data)?data:'.');
+ con->dd_printf("%06x %02x %c", iram->get(start+1), data,
+ isprint(data)?data:'.');
data= sfr->get(PSW);
- con->printf(" PSW= 0x%02x CY=%c AC=%c OV=%c P=%c\n", data,
- (data&bmCY)?'1':'0', (data&bmAC)?'1':'0',
- (data&bmOV)?'1':'0', (data&bmP)?'1':'0');
+ con->dd_printf(" PSW= 0x%02x CY=%c AC=%c OV=%c P=%c\n", data,
+ (data&bmCY)?'1':'0', (data&bmAC)?'1':'0',
+ (data&bmOV)?'1':'0', (data&bmP)?'1':'0');
print_disass(PC, con);
}
void
cl_hw::print_info(class cl_console *con)
{
- con->printf("%s[%d]\n", id_string, id);
+ con->dd_printf("%s[%d]\n", id_string, id);
}
while ((start <= stop) &&
(start < size))
{
- con->printf(addr_format, start); con->printf(" ");
+ con->dd_printf(addr_format, start); con->dd_printf(" ");
for (i= 0;
(i < bpl) &&
(start+i < size) &&
(start+i <= stop);
i++)
{
- con->printf(data_format, read(start+i)); con->printf(" ");
+ con->dd_printf(data_format, read(start+i)); con->dd_printf(" ");
}
while (i < bpl)
{
j= width/4 + ((width%4)?1:0) + 1;
while (j)
{
- con->printf(" ");
+ con->dd_printf(" ");
j--;
}
i++;
i++)
{
long c= get(start+i);
- con->printf("%c", isprint(255&c)?(255&c):'.');
+ con->dd_printf("%c", isprint(255&c)?(255&c):'.');
if (width > 8)
- con->printf("%c", isprint(255&(c>>8))?(255&(c>>8)):'.');
+ con->dd_printf("%c", isprint(255&(c>>8))?(255&(c>>8)):'.');
if (width > 16)
- con->printf("%c", isprint(255&(c>>16))?(255&(c>>16)):'.');
+ con->dd_printf("%c", isprint(255&(c>>16))?(255&(c>>16)):'.');
if (width > 24)
- con->printf("%c", isprint(255&(c>>24))?(255&(c>>24)):'.');
+ con->dd_printf("%c", isprint(255&(c>>24))?(255&(c>>24)):'.');
}
- con->printf("\n");
+ con->dd_printf("\n");
dump_finished= start+i;
start+= bpl;
}
cl_bool_opt::print(class cl_console *con)
{
if (*(bool *)option)
- con->printf("TRUE");
+ con->dd_printf("TRUE");
else
- con->printf("FALSE");
+ con->dd_printf("FALSE");
}
bool
{
if (/*sim->cmd->actual_console &&
sim->cmd->actual_console*/con->flags & CONS_DEBUG)
- con->printf("TRUE");
+ con->dd_printf("TRUE");
else
- con->printf("FALSE");
+ con->dd_printf("FALSE");
}
bool
if (reason == resUSER &&
cmd->frozen_console->input_avail())
cmd->frozen_console->read_line();
- cmd->frozen_console->printf("Stop at 0x%06x: (%d) ", uc->PC, reason);
+ cmd->frozen_console->dd_printf("Stop at 0x%06x: (%d) ", uc->PC, reason);
switch (reason)
{
case resHALT:
- cmd->frozen_console->printf("Halted\n");
+ cmd->frozen_console->dd_printf("Halted\n");
break;
case resINV_ADDR:
- cmd->frozen_console->printf("Invalid address\n");
+ cmd->frozen_console->dd_printf("Invalid address\n");
break;
case resSTACK_OV:
- cmd->frozen_console->printf("Stack overflow\n");
+ cmd->frozen_console->dd_printf("Stack overflow\n");
break;
case resBREAKPOINT:
- cmd->frozen_console->printf("Breakpoint\n");
+ cmd->frozen_console->dd_printf("Breakpoint\n");
break;
case resINTERRUPT:
- cmd->frozen_console->printf("Interrupt\n");
+ cmd->frozen_console->dd_printf("Interrupt\n");
break;
case resWDTRESET:
- cmd->frozen_console->printf("Watchdog reset\n");
+ cmd->frozen_console->dd_printf("Watchdog reset\n");
break;
case resUSER:
- cmd->frozen_console->printf("User stopped\n");
+ cmd->frozen_console->dd_printf("User stopped\n");
break;
case resINV_INST:
- cmd->frozen_console->printf("Invalid instruction 0x%04x\n",
- uc->get_mem(MEM_ROM, uc->PC));
+ cmd->frozen_console->dd_printf("Invalid instruction 0x%04x\n",
+ uc->get_mem(MEM_ROM, uc->PC));
break;
default:
- cmd->frozen_console->printf("Unknown reason\n");
+ cmd->frozen_console->dd_printf("Unknown reason\n");
break;
}
- cmd->frozen_console->printf("F 0x%06x\n", uc->PC); // for sdcdb
+ cmd->frozen_console->dd_printf("F 0x%06x\n", uc->PC); // for sdcdb
//if (cmd->actual_console != cmd->frozen_console)
cmd->frozen_console->flags&= ~CONS_FROZEN;
cmd->frozen_console->print_prompt();
void
cl_ticker::dump(int nr, double xtal, class cl_console *con)
{
- con->printf("timer #%d(\"%s\") %s%s: %g sec (%lu clks)\n",
- nr, name?name:"unnamed",
- (options&TICK_RUN)?"ON":"OFF",
- (options&TICK_INISR)?",ISR":"",
- get_rtime(xtal), ticks);
+ con->dd_printf("timer #%d(\"%s\") %s%s: %g sec (%lu clks)\n",
+ nr, name?name:"unnamed",
+ (options&TICK_RUN)?"ON":"OFF",
+ (options&TICK_INISR)?",ISR":"",
+ get_rtime(xtal), ticks);
}
if (!name)
{
sim->app->get_commander()->
- printf("cl_uc::read_hex_file File name not specified\n");
+ dd_printf("cl_uc::read_hex_file File name not specified\n");
return(-1);
}
else
if (sim->app->args->get_iarg('V', 0) &&
rtyp != 1)
sim->app->get_commander()->
- printf("Unknown record type %d(0x%x)\n", rtyp, rtyp);
+ dd_printf("Unknown record type %d(0x%x)\n",
+ rtyp, rtyp);
}
else
if (sim->app->args->get_iarg('V', 0))
sim->app->get_commander()->
- printf("Checksum error (%x instead of %x) in "
- "record %ld.\n", chk, sum, recnum);
+ dd_printf("Checksum error (%x instead of %x) in "
+ "record %ld.\n", chk, sum, recnum);
}
else
if (sim->app->args->get_iarg('V', 0))
sim->app->get_commander()->
- printf("Read error in record %ld.\n", recnum);
+ dd_printf("Read error in record %ld.\n", recnum);
}
}
if (get_mem_width(MEM_ROM) > 8 &&
if (name)
fclose(f);
if (sim->app->args->get_iarg('V', 0))
- sim->app->get_commander()->printf("%ld records have been read\n", recnum);
+ sim->app->get_commander()->dd_printf("%ld records have been read\n",
+ recnum);
analyze(0);
return(written);
}
b= fbrk_at(addr);
dis= disass(addr, NULL);
if (b)
- con->printf("%c", (b->perm == brkFIX)?'F':'D');
+ con->dd_printf("%c", (b->perm == brkFIX)?'F':'D');
else
- con->printf(" ");
- con->printf("%c ", inst_at(addr)?' ':'?');
- con->printf(rom->addr_format, addr); con->printf(" ");
- con->printf(rom->data_format, code);
+ con->dd_printf(" ");
+ con->dd_printf("%c ", inst_at(addr)?' ':'?');
+ con->dd_printf(rom->addr_format, addr); con->dd_printf(" ");
+ con->dd_printf(rom->data_format, code);
for (i= 1; i < inst_length(code); i++)
{
- con->printf(" ");
- con->printf(rom->data_format, get_mem(MEM_ROM, addr+i));
+ con->dd_printf(" ");
+ con->dd_printf(rom->data_format, get_mem(MEM_ROM, addr+i));
}
int li= longest_inst();
while (i < li)
int j;
j= rom->width/4 + ((rom->width%4)?1:0) + 1;
while (j)
- con->printf(" "), j--;
+ con->dd_printf(" "), j--;
i++;
}
- con->printf(" %s\n", dis);
+ con->dd_printf(" %s\n", dis);
free(dis);
}
void
cl_uc::print_regs(class cl_console *con)
{
- con->printf("No registers\n");
+ con->dd_printf("No registers\n");
}
int
void
cl_z80::print_regs(class cl_console *con)
{
- con->printf("SZ-A--P-C Flags= 0x%02x %3d %c ",
- regs.F, regs.F, isprint(regs.F)?regs.F:'.');
- con->printf("A= 0x%02x %3d %c\n",
- regs.A, regs.A, isprint(regs.A)?regs.A:'.');
- con->printf("%c%c-%c--%c-%c\n",
- (regs.F&BIT_S)?'1':'0',
- (regs.F&BIT_Z)?'1':'0',
- (regs.F&BIT_A)?'1':'0',
- (regs.F&BIT_P)?'1':'0',
- (regs.F&BIT_C)?'1':'0');
- con->printf("BC= 0x%04x [BC]= %02x %3d %c ",
- regs.BC, ram->get(regs.BC), ram->get(regs.BC),
- isprint(ram->get(regs.BC))?ram->get(regs.BC):'.');
- con->printf("DE= 0x%04x [DE]= %02x %3d %c ",
- regs.DE, ram->get(regs.DE), ram->get(regs.DE),
- isprint(ram->get(regs.DE))?ram->get(regs.DE):'.');
- con->printf("HL= 0x%04x [HL]= %02x %3d %c\n",
- regs.HL, ram->get(regs.HL), ram->get(regs.HL),
- isprint(ram->get(regs.HL))?ram->get(regs.HL):'.');
- con->printf("IX= 0x%04x [IX]= %02x %3d %c ",
- regs.IX, ram->get(regs.IX), ram->get(regs.IX),
- isprint(ram->get(regs.IX))?ram->get(regs.IX):'.');
- con->printf("IY= 0x%04x [IY]= %02x %3d %c ",
- regs.IY, ram->get(regs.IY), ram->get(regs.IY),
- isprint(ram->get(regs.IY))?ram->get(regs.IY):'.');
- con->printf("SP= 0x%04x [SP]= %02x %3d %c\n",
- regs.SP, ram->get(regs.SP), ram->get(regs.SP),
- isprint(ram->get(regs.SP))?ram->get(regs.SP):'.');
+ con->dd_printf("SZ-A--P-C Flags= 0x%02x %3d %c ",
+ regs.F, regs.F, isprint(regs.F)?regs.F:'.');
+ con->dd_printf("A= 0x%02x %3d %c\n",
+ regs.A, regs.A, isprint(regs.A)?regs.A:'.');
+ con->dd_printf("%c%c-%c--%c-%c\n",
+ (regs.F&BIT_S)?'1':'0',
+ (regs.F&BIT_Z)?'1':'0',
+ (regs.F&BIT_A)?'1':'0',
+ (regs.F&BIT_P)?'1':'0',
+ (regs.F&BIT_C)?'1':'0');
+ con->dd_printf("BC= 0x%04x [BC]= %02x %3d %c ",
+ regs.BC, ram->get(regs.BC), ram->get(regs.BC),
+ isprint(ram->get(regs.BC))?ram->get(regs.BC):'.');
+ con->dd_printf("DE= 0x%04x [DE]= %02x %3d %c ",
+ regs.DE, ram->get(regs.DE), ram->get(regs.DE),
+ isprint(ram->get(regs.DE))?ram->get(regs.DE):'.');
+ con->dd_printf("HL= 0x%04x [HL]= %02x %3d %c\n",
+ regs.HL, ram->get(regs.HL), ram->get(regs.HL),
+ isprint(ram->get(regs.HL))?ram->get(regs.HL):'.');
+ con->dd_printf("IX= 0x%04x [IX]= %02x %3d %c ",
+ regs.IX, ram->get(regs.IX), ram->get(regs.IX),
+ isprint(ram->get(regs.IX))?ram->get(regs.IX):'.');
+ con->dd_printf("IY= 0x%04x [IY]= %02x %3d %c ",
+ regs.IY, ram->get(regs.IY), ram->get(regs.IY),
+ isprint(ram->get(regs.IY))?ram->get(regs.IY):'.');
+ con->dd_printf("SP= 0x%04x [SP]= %02x %3d %c\n",
+ regs.SP, ram->get(regs.SP), ram->get(regs.SP),
+ isprint(ram->get(regs.SP))?ram->get(regs.SP):'.');
print_disass(PC, con);
}