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

Fix handling of DO; support unary + for floating-point numbers

Floating-point users generally expect to be able to use a unary plus.
Fix support for the DO instruction in several places.
This commit is contained in:
H. Peter Anvin
2007-09-18 17:49:09 -07:00
parent 141d7cf68d
commit cfbe7c3cc2
2 changed files with 20 additions and 11 deletions

View File

@@ -214,16 +214,18 @@ insn *parse_line(int pass, char *buffer, insn * result,
continue;
}
if ((i == TOKEN_FLOAT && is_comma_next()) || i == '-') {
int32_t sign = +1L;
if ((i == TOKEN_FLOAT && is_comma_next())
|| i == '-' || i == '+') {
int32_t sign = +1;
if (i == '-') {
if (i == '+' || i == '-') {
char *save = stdscan_bufptr;
int token = i;
sign = (i == '-') ? -1 : 1;
i = stdscan(NULL, &tokval);
sign = -1L;
if (i != TOKEN_FLOAT || !is_comma_next()) {
stdscan_bufptr = save;
i = tokval.t_type = '-';
i = tokval.t_type = token;
}
}
@@ -243,10 +245,12 @@ insn *parse_line(int pass, char *buffer, insn * result,
case I_DT:
eop->stringlen = 10;
break;
case I_DO:
eop->stringlen = 16;
break;
default:
error(ERR_NONFATAL, "floating-point constant"
" encountered in `d%c' instruction"
? (result->opcode == I_DO) ? 'o' : 'b');
" encountered in `db' instruction");
/*
* fix suggested by Pedro Gimeno... original line
* was: