Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Warning Message
◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Warning: A4031
Operand types must match
An instruction received operands of different sizes. For example,
this warning is generated by the following code:
string DB "This is a test"
.
.
.
mov ax,string[4]
Since this is a warning rather than an error, the assembler
attempts to generate code based on its best guess of the intended
result. If one of the operands is a register, the register size
overrides the size of the other operand. In the example, the word
size of AX overrides the byte size of string[4]. You can avoid
this warning and make your code less ambiguous by specifying the
operand size with the PTR operator. For example:
mov ax,WORD PTR string[4]
-♦-