0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-10-10 00:25:06 -04:00

Don't convert the various RESx instructions to RESB

All it does is complicate things; instead leave the opcode where it
is.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin
2018-12-18 18:06:26 -08:00
parent 5df6ca712d
commit 5358b98405
3 changed files with 9 additions and 19 deletions

View File

@@ -1208,7 +1208,7 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
nasm_warn(WARN_OTHER, "forward reference in RESx " nasm_warn(WARN_OTHER, "forward reference in RESx "
"can have unpredictable results"); "can have unpredictable results");
else else
length += ins->oprs[0].offset; length += ins->oprs[0].offset * resb_bytes(ins->opcode);
break; break;
case 0341: case 0341:
@@ -1875,7 +1875,7 @@ static void gencode(struct out_data *data, insn *ins)
if (ins->oprs[0].segment != NO_SEG) if (ins->oprs[0].segment != NO_SEG)
nasm_panic("non-constant BSS size in pass two"); nasm_panic("non-constant BSS size in pass two");
out_reserve(data, ins->oprs[0].offset); out_reserve(data, ins->oprs[0].offset * resb_bytes(ins->opcode));
break; break;
case 0341: case 0341:

View File

@@ -1141,16 +1141,6 @@ is_expression:
while (opnum < MAX_OPERANDS) while (opnum < MAX_OPERANDS)
result->oprs[opnum++].type = 0; result->oprs[opnum++].type = 0;
/*
* Transform RESW, RESD, RESQ, REST, RESO, RESY, RESZ into RESB.
*/
if (opcode_is_resb(result->opcode)) {
result->oprs[0].offset *= resb_bytes(result->opcode);
result->oprs[0].offset *= result->times;
result->times = 1;
result->opcode = I_RESB;
}
return result; return result;
fail: fail:

View File

@@ -59,13 +59,13 @@ DO ignore ignore ignore
DY ignore ignore ignore DY ignore ignore ignore
DZ ignore ignore ignore DZ ignore ignore ignore
RESB imm [ resb] 8086 RESB imm [ resb] 8086
RESW ignore ignore ignore RESW imm [ resb] 8086
RESD ignore ignore ignore RESD imm [ resb] 8086
RESQ ignore ignore ignore RESQ imm [ resb] 8086
REST ignore ignore ignore REST imm [ resb] 8086
RESO ignore ignore ignore RESO imm [ resb] 8086
RESY ignore ignore ignore RESY imm [ resb] 8086
RESZ ignore ignore ignore RESZ imm [ resb] 8086
INCBIN ignore ignore ignore INCBIN ignore ignore ignore
;# Conventional instructions ;# Conventional instructions