#include "simavr/simavr.h"
void printHelp () {
- printf("simuc V0.0.4 (%s,%s)\n", __DATE__, __TIME__);
+ printf("simuc V0.0.5 (%s,%s)\n", __DATE__, __TIME__);
printf("usage: simuc [options] elf-file [elf-file ...]\n\n");
printf(" available options (you can use file .simucinit instead):\n");
printf(" --port ... listining port for gdb (default 1234)\n");
return 1;
}
printf("--------------------------------------------------------------------\n");
- printf("available commands: i (interrupt), c (continue), s (stack), q (quit)\n");
+ printf("available commands: i (interrupt), c (continue), s (stack), r (reset), q (quit)\n");
printf("--------------------------------------------------------------------\n");
printf("init done - press key to start\n");
getchar();
// }
if (getline(&line, &size, stdin) > 0) {
- const char *commands[] = { "quit", "interrupt", "continue", "stack" };
+ const char *commands[] = { "quit", "interrupt", "continue", "stack", "reset" };
try {
int foundIndex = -1;
int foundCnt = 0;
for (int i = 0; i < 4; i++) {
int8_t nextLed = -1;
if (ddra & (1 << i)) {
- nextLed = porta & (1 << i) ? 0 : 1;
+ nextLed = porta & (1 << i) ? 0 : 1; // port output
+ } else {
+ nextLed = 0; // port input _> led is off
}
if (nextLed != led[i]) {
change = 1;
}
printf(printHeader ? "\n" : "\n");
- char s[20];
+ char s[80];
sprintfLedStatus(s, sizeof(s), false);
printf(" %s\n", s);
break;
break;
}
+ case CommandReset: {
+ avr_reset(avr);
+ printf("RESET done -> PC=0x%04x, use command 'continue' to start!\n", avr->pc);
+ avr->state = cpu_Stopped;
+ break;
+ }
+
default: break;
}
command = ReadyForNewCommand;