.SH NAME
ulas
.SH SYNOPSIS
- ulas [-hvVpdA] [-o=path] [-I=path] [-l=path] [-a=initial-address] [-S=ulas|mlb] [input]
+ ulas [-hvVpdA] [-o=path] [-I=path] [-l=path] [-a=initial-address] [-S=ulas|mlb|sym] [input]
.SH DESCRIPTION
ulas
cfg->sym_fmt = ULAS_SYM_FMT_DEFAULT;
} else if (strcmp("mlb", optarg) == 0) {
cfg->sym_fmt = ULAS_SYM_FMT_MLB;
- } else {
+ } else if (strcmp("sym", optarg) == 0) {
+ cfg->sym_fmt = ULAS_SYM_FMT_SYM;
+ }else {
printf("Invalid symbol format: %s\n", optarg);
exit(-1);
}
void ulas_help(void) {
printf("%s\n", ULAS_NAME);
printf("Usage %s [-%s] [-o=path] [-I=path] [-l=path] [-a=initial-address] "
- "[-S=ulas|mlb] "
+ "[-S=ulas|mlb|sym] "
"[input]\n\n",
ULAS_NAME, ULAS_OPTS);
ULAS_HELP("h", "display this help and exit");
}
fprintf(dst, "\n");
break;
+ case ULAS_SYM_FMT_SYM:
+ fprintf(dst, "00:");
+
+ switch (s->tok.type) {
+ case ULAS_INT:
+ fprintf(dst, "%x", ulas_valint(&s->tok, &rc));
+ break;
+ case ULAS_STR:
+ fprintf(dst, "%s", ulas_valstr(&s->tok, &rc));
+ break;
+ default:
+ fprintf(dst, "<Unknown type>");
+ break;
+ }
+
+ if (!s->name || s->name[0] == '\0') {
+ fprintf(dst, "<unnamed>");
+ } else {
+ fprintf(dst, " %s", s->name);
+ }
+ fprintf(dst, "\n");
+ break;
case ULAS_SYM_FMT_MLB:
switch (s->tok.type) {
case ULAS_INT: {
enum ulas_warm { ULAS_WARN_OVERFLOW = 1, ULAS_WARN_ALL = 0x7FFFFFFF };
-enum ulas_symfmt { ULAS_SYM_FMT_DEFAULT, ULAS_SYM_FMT_MLB };
+enum ulas_symfmt { ULAS_SYM_FMT_DEFAULT, ULAS_SYM_FMT_SYM, ULAS_SYM_FMT_MLB };
struct ulas_config {
// argv represents file names