0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-07-24 10:25:42 -04:00
Sławomir Bocheński 5b9bcacebb Make istruc "at" support struc local labels
istruc currently does not work very well with passing local labels to
"at" macro, as the labels are inserted literally. E.g. considering the
example from test/struc.asm:

	struc teststruc1
	  .long: resd 1
	  .word: resw 1
	  .byte: resb 1
	  .str:  resb 32
	endstruc
	; ...
	istruc teststruc1
	 at .word, db 5
	iend

if one were to put a global label before istruc to refer to its
instance, the code would fail to compile, due to ".word" being unknown
in that scope. Of course one could then use full form after "at", i.e.
"teststruc1.word", but this seems rather tedious.

This also makes istruc use with local labels fail for anything but the
last declared struc.

The change automatically prepends struc name to the label if the label
given to "at" starts with a dot.

Signed-off-by: Sławomir Bocheński <lkslawek@gmail.com>
2022-09-09 00:30:06 +02:00
..
2020-07-16 23:11:03 -07:00
2020-07-10 19:26:52 -07:00