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:
		| @@ -1208,7 +1208,7 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits, | ||||
|                 nasm_warn(WARN_OTHER, "forward reference in RESx " | ||||
|                            "can have unpredictable results"); | ||||
|             else | ||||
|                 length += ins->oprs[0].offset; | ||||
|                 length += ins->oprs[0].offset * resb_bytes(ins->opcode); | ||||
|             break; | ||||
|  | ||||
|         case 0341: | ||||
| @@ -1875,7 +1875,7 @@ static void gencode(struct out_data *data, insn *ins) | ||||
|             if (ins->oprs[0].segment != NO_SEG) | ||||
|                 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; | ||||
|  | ||||
|         case 0341: | ||||
|   | ||||
							
								
								
									
										10
									
								
								asm/parser.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								asm/parser.c
									
									
									
									
									
								
							| @@ -1141,16 +1141,6 @@ is_expression: | ||||
|     while (opnum < MAX_OPERANDS) | ||||
|         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; | ||||
|  | ||||
| fail: | ||||
|   | ||||
| @@ -59,13 +59,13 @@ DO		ignore				ignore						ignore | ||||
| DY		ignore				ignore						ignore | ||||
| DZ		ignore				ignore						ignore | ||||
| RESB		imm				[	resb]					8086 | ||||
| RESW		ignore				ignore						ignore | ||||
| RESD		ignore				ignore						ignore | ||||
| RESQ		ignore				ignore						ignore | ||||
| REST		ignore				ignore						ignore | ||||
| RESO		ignore				ignore						ignore | ||||
| RESY		ignore				ignore						ignore | ||||
| RESZ		ignore				ignore						ignore | ||||
| RESW		imm				[	resb]					8086 | ||||
| RESD		imm				[	resb]					8086 | ||||
| RESQ		imm				[	resb]					8086 | ||||
| REST		imm				[	resb]					8086 | ||||
| RESO		imm				[	resb]					8086 | ||||
| RESY		imm				[	resb]					8086 | ||||
| RESZ		imm				[	resb]					8086 | ||||
| INCBIN		ignore				ignore						ignore | ||||
|  | ||||
| ;# Conventional instructions | ||||
|   | ||||
		Reference in New Issue
	
	Block a user