Skip to content

Commit

Permalink
minor patch to the disassembler from Tim: correct printing of strings.
Browse files Browse the repository at this point in the history
git-svn-id: http://unix-jun72.googlecode.com/svn/trunk@265 44b2186c-a14b-0410-8c95-595313601b93
  • Loading branch information
warren.toomey committed May 20, 2008
1 parent 6c7afd1 commit 0da0e51
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tools/disaout/opset.c
Expand Up @@ -171,6 +171,18 @@ int guess_jsr_r5(int addr)
}
}

void printquoted(char *str)
{
while(*str) {
switch(*str) {
case '\n': printf("\\n"); break;
case '\r': printf("\\r"); break;
case '\b': printf("\\b"); break;
default: printf("%c", *str);
}
str++;
}
}

/*
* Print out an operand. Return any increment to skip to reach the next
Expand Down Expand Up @@ -216,7 +228,9 @@ int paddr(char *str, int addr, int a, int lastr)
jsrr5_skip= s->size;
if (s->type==SYM_JSRTEXT) {
char *str= (char *)&ispace[addr+4];
printf("; <%s>; .even", str);
printf("; <");
printquoted(str);
printf(">; .even");
} else {
u_int16_t var2= ispace[addr + 4] + (ispace[addr + 5] << 8);
printf("; 0%o", var2);
Expand Down

0 comments on commit 0da0e51

Please sign in to comment.