qcenv.hlp (Topic list)
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]
                                    -♦-