Skip to content

valid operand size but shows warning #171

@lab-bat

Description

@lab-bat

Using nasm (current master) on following file (command: nasm -fwin32 -w+all test.asm -o test.obj -l test.lst)

section .text
test:
BITS 16
o32     pushf
o32     popf
o32     ret
o32     ret     0
o32     retf
o32     retf    0
o32     iret
BITS 32
o16     pushf
o16     popf
o16     ret
o16     ret     0
o16     retf
o16     retf    0
o16     iret
BITS 64
o16     pushf
o16     popf
o16     ret
o16     ret     0
o16     retf
o16     retf    0
o16     iret
o32     pushf
o32     popf
o32     ret
o32     ret     0
o32     retf
o32     retf    0
o32     iret
.end:

shows the following warning

test.asm:4: warning: invalid operand size prefix o32, must be o16 [-w+prefix-opsize]
test.asm:5: warning: invalid operand size prefix o32, must be o16 [-w+prefix-opsize]
test.asm:10: warning: invalid operand size prefix o32, must be o16 [-w+prefix-opsize]
test.asm:12: warning: invalid operand size prefix o16, must be o32 [-w+prefix-opsize]
test.asm:13: warning: invalid operand size prefix o16, must be o32 [-w+prefix-opsize]
test.asm:18: warning: invalid operand size prefix o16, must be o32 [-w+prefix-opsize]
test.asm:20: warning: invalid operand size prefix o16, must be o64 [-w+prefix-opsize]
test.asm:21: warning: invalid operand size prefix o16, must be o64 [-w+prefix-opsize]
test.asm:26: warning: invalid operand size prefix o16, must be o64 [-w+prefix-opsize]
test.asm:27: warning: invalid operand size prefix o32, must be o64 [-w+prefix-opsize]
test.asm:28: warning: invalid operand size prefix o32, must be o64 [-w+prefix-opsize]
test.asm:33: warning: invalid operand size prefix o32, must be o64 [-w+prefix-opsize]

But those size override prefix is valid. I cannot use -w-prefix-opsize because o16 mov eax, [si] or o32 mov ax, [esi] critical warning would be silented, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions