assemblyx86tasm

how to get rid of TASM warning Operand size conflict


When compiling the following assembly source file TASM 4.1 (tasm file.asm):

ideal
p386n
model flat
stack 100h  ; Dummy, to pacify TASM.
codeseg
start: cmp bx, after-start
after:
db 66h, 81h, 0fbh
dw after-start
end start  ; Dummy, to pacify TASM.

, I get the following warning:

Turbo Assembler  Version 4.1  Copyright (c) 1988, 1996 Borland International

Assembling file:   file.asm
*Warning* file.asm(6) Operand size conflict
Error messages:    None
Warning messages:  1
Passes:            1
Remaining memory:  470k

How do I get rid of warning Operand size conflict in line 6 (start: cmp bx, after-start)?

I have a workaround: hardcoding the bytes of the cmp bx, ... instruction with db. Is there anything better?


Solution

  • Based on the comment by Michael Petch, I've just verified that using cmp bx, small after-start does indeed get rid of the warning.

    ideal
    p386n
    model flat
    stack 100h  ; Dummy, to pacify TASM.
    codeseg
    start: cmp bx, small after-start
    after:
    db 66h, 81h, 0fbh
    dw after-start
    end start  ; Dummy, to pacify TASM.