Fixed "cmp" opcode colorization

This commit is contained in:
Anton Kochkov 2013-07-17 01:54:05 +04:00
parent 8e2f68fbda
commit e81d4e900d

View File

@ -52,7 +52,7 @@ static char *filter_refline(const char *str) {
static void colorize_opcode (char *p, const char *reg, const char *num) {
int i, j, k, is_mod;
int is_jmp = (*p == 'j' || *p == 'c')? 1: 0;
int is_jmp = (*p == 'j' || ((*p == 'c') && (p[1] == 'a')))? 1: 0;
char *o;
if (is_jmp)
return;
@ -80,8 +80,13 @@ static void colorize_opcode (char *p, const char *reg, const char *num) {
strcpy (o+j, Color_RESET);
j += strlen (Color_RESET);
o[j++] = p[i];
strcpy (o+j, reg);
j += strlen (reg)-1;
if ((p[i] > '0') && (p[i] < '9')) {
strcpy (o+j, num);
j += strlen (num)-1;
} else {
strcpy (o+j, reg);
j += strlen (reg)-1;
}
continue;
case ' ':
// find if next ',' before ' ' is found