0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

Use enumerations where practical to ease debugging

We have a lot of enumerations; by declaring fields as such, we make it
easier when debugging, since the debugger can display the enumerations
in cleartext.  However, make sure exceptional values (like -1) are
included in the enumeration, since the compiler otherwise may not
include it in the valid range of the enumeration.
This commit is contained in:
H. Peter Anvin
2007-09-12 20:27:41 -07:00
parent 7978feebd2
commit 16b0a33cea
26 changed files with 440 additions and 397 deletions

View File

@@ -246,6 +246,8 @@ int32_t assemble(int32_t segment, int32_t offset, int bits, uint32_t cp,
case I_DT:
wsize = 10;
break;
default:
break;
}
if (wsize) {
@@ -582,6 +584,8 @@ int32_t insn_size(int32_t segment, int32_t offset, int bits, uint32_t cp,
case I_DT:
wsize = 10;
break;
default:
break;
}
for (e = instruction->eops; e; e = e->next) {
@@ -1554,7 +1558,7 @@ static int matches(const struct itemplate *itemp, insn * instruction, int bits)
/*
* Check that the operand flags all match up
*/
for (i = 0; i < itemp->operands; i++)
for (i = 0; i < itemp->operands; i++) {
if (itemp->opd[i] & ~instruction->oprs[i].type ||
((itemp->opd[i] & SIZE_MASK) &&
((itemp->opd[i] ^ instruction->oprs[i].type) & SIZE_MASK))) {
@@ -1564,6 +1568,7 @@ static int matches(const struct itemplate *itemp, insn * instruction, int bits)
else
return 1;
}
}
/*
* Check operand sizes