如何摆脱 TASM 警告操作数大小冲突

问题描述 投票:0回答:1

编译以下汇编源文件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.

,我收到以下警告:

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

如何消除第 6 行中的警告 操作数大小冲突 (

start: cmp bx, after-start
)?

我有一个解决方法:使用

cmp bx, ...
db
指令的字节进行硬编码。还有更好的吗

assembly x86 tasm
1个回答
0
投票

根据 Michael Petch 的评论,我刚刚验证使用

cmp bx, small after-start
确实消除了警告。

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.
© www.soinside.com 2019 - 2024. All rights reserved.