As shown in your example, the structure
definition defines foo.bar whereas the
structure instantiation then references
foobar.bar, which (of course) fails.
Write "at foo.bar, db 00h" instead.
The first sentence of the last paragraph
in section 4.11.9 of the manual describes
this, though it could do a better job.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If the standard 'at' macro is changed to something like the following then the structure name is optional.
%imacro at 1-2+.nolist
; Find the first character of the member label...
%defstr %$memberstring %1
%substr %$char %$memberstring 1
; ...if it is a dot, then prepend the structure name.
%ifidn %$char,'.'
%xdefine %$member_label %[%$strucname]%1
%else
%define %$member_label %1
%endif
times (%$member_label-%$strucname)-($-%$strucstart) db 0
%2
%endmacro
- Anonymous Coward
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As shown in your example, the structure
definition defines foo.bar whereas the
structure instantiation then references
foobar.bar, which (of course) fails.
Write "at foo.bar, db 00h" instead.
The first sentence of the last paragraph
in section 4.11.9 of the manual describes
this, though it could do a better job.
It's not clear to me that this shouldn't be fixed. It's a pretty serious violation of user expectation, one would think.
The tricky part is that it's not very clear *how* to fix it -- in particular, what is the user expectation of expressions on the right-hand side?
If the standard 'at' macro is changed to something like the following then the structure name is optional.
%imacro at 1-2+.nolist
; Find the first character of the member label...
%defstr %$memberstring %1
%substr %$char %$memberstring 1
; ...if it is a dot, then prepend the structure name.
%ifidn %$char,'.'
%xdefine %$member_label %[%$strucname]%1
%else
%define %$member_label %1
%endif
times (%$member_label-%$strucname)-($-%$strucstart) db 0
%2
%endmacro
- Anonymous Coward