fasmg icon indicating copy to clipboard operation
fasmg copied to clipboard

Using segment label with some instructions with x86-2 package throw error: variable term used where not expected

Open LKMystery opened this issue 6 months ago • 1 comments

Example code:

`format MZ

entry code_segment:start

xdata = 0x100

segment code_segment use16

start:

add ax, xdata + 0x100 ; correct mov ax, xdata + 0x100 ; correct

mov ax, data_segment + 1 ; correct mov dx, data_segment + 1 ; correct add dx, data_segment + 1 ; correct add ax, data_segment + 1 ; error : add? [113] Processed: emit size: @src.imm

segment data_segment use16 ` using x86 package compiled it.

I found in file x86-2.inc on line 1347 asm emit size: @src.imm and changed to check size = 2 jyes imm16 asm emit size: @src.imm imm16: call word, @src.imm to get work!

LKMystery avatar Aug 05 '24 11:08 LKMystery