Personally, I would never use a 3-byte structure; add one padding byte, and everything works fine. Anyway, here's a testbed for 32-bit Masm:
include \masm32\include\masm32rt.inc
S3 STRUCT
x0 db ?
x1 db ?
x2 db ?
; x3 db ? ; uncomment, and it will work just fine
S3 ENDS
.data
s3b S3 <1, 2, 3>
.code
s3Test proc s3passed:S3
lea edx, s3passed
print hex$(edx), " is the address", 13, 10
movzx eax, s3passed.x0
print str$(eax), " = x0", 13, 10
movzx eax, s3passed.x1
print str$(eax), " = x1", 13, 10
movzx eax, s3passed.x2
print str$(eax), " = x2", 13, 10
ret
s3Test endp
start:
; int 3
invoke s3Test, s3b ; UAsm: Error A2049: Invalid instruction operands
inkey "buggy indeed"
exit
end start
OPT_Assembler mlv14 ; no complaints but there is a FAT BUG
0040102B ³. A0 02204000 mov al, [402002] ; the S3 starts at 402000
00401030 ³. 66:50 push ax
00401032 ³. 66:FF35 02204000 push word ptr [402002]
00401039 ³. E8 C2FFFFFF call 00401000