Consider following code:
.code
;mov rax, [var] ;produces error as expected
lea rbx, [delta]
mov rax, [rbx + (var - delta)] ;no error or warning
delta:
var dd 0
end
In my project, I often have to access data like this, via "delta offset" stored in register. Unfortunatelly, it seems there is no type size checking in this kind of addressing. This makes it very easy to accidentally access incorrect size in memory, like in example (var shold have been read to eax, not rax). This is especially problematic when accessing Windows structures, where you often aren't sure which member is dword and which is qword.
Would it be possible to issue some warning in this case? At least for case, when "var" has associated size, and "delta" does not.
> Would it be possible to issue some warning in this case?
That wouldn't be masm-compatible. The difference of two local labels is a plain number, without type.
However, a possible workaround is:
mov rax, (type var) ptr [rbx + (var - delta)]
this syntax attaches type of label "var" to the expression.
Note that you'll need jwasm v2.10rc7 for this to work - there was a small bug that made this syntax not work in v2.10rc6.