My changes for this inofficial patched release 1.1.1 :
See also Test.asm.

If you have any questions, comments, please contact me :
Burkhard Arenfeld
b.arenfeld@gmx.de
26.9.2006

The reason for this patch was, that I want to swap from Win Avrstudio to linux and want to use my 
old programs without the need to modify them. This patches makes avra more compatible to the 
Atmel AVR assembler shipped with Avrstudio 4.

(Most) changes in sourcecode are marked with a comment line  /* B.A. */

Changes in behaviour :

- Patch segfault, if .error is given without parameter

- Patch segfault, if .device is given with an invalid parameter

- Check in predef_dev() if symbol is already defined. Can happens, if someone
  tries to define the symbol with the -D parameter. 
  E.g.: 'avra -D __ATMEGA8__ Test.asm'  
  now generate error message, because __ATMEGA8__ is reserved

- Add .elseif directive. It's the same like .elif. (Original Atmel assembler use .elseif and not .elif)

- In .db lines strings can now contain ',' and ';' characters.

- Allow forward declaration of constants (.equ) except for .ifdef and .ifndef.
  Invalid forward declarations are checked now. (In the first pass undefined Symbols in .ifdef and .ifndef 
  parameters are stored in a 'blacklist' and checked in the second pass)

- Extend the .message directive for better debugging. Now it accept not only a String. You can use
  a list of expressions like in a .db directive as parameter.


Other changes :

- The assembler 'pass' variable moved into the pi struct. I deleted the pass variable from a lot of functions.

- New functions in avra.c. It was easier for me, to understand the code without the for(label = first; ...)-loops
	Replaced a lot of for(label = ...) -loops by one of this functions.

	int def_const(struct prog_info *pi, const char *name, int value);	(Moved from device.c to avra.c)
	int def_var(struct prog_info *pi, char *name, int value);			(Moved from device.c to avra.c)
	int def_blacklist(struct prog_info *pi, const char *name);
	int get_label(struct prog_info *pi,char *name,int *value);
	int get_constant(struct prog_info *pi,char *name,int *value);
	int get_variable(struct prog_info *pi,char *name,int *value);
	struct label *test_label(struct prog_info *pi,char *name,char *message);
	struct label *test_constant(struct prog_info *pi,char *name,char *message);
	struct label *test_variable(struct prog_info *pi,char *name,char *message);
	struct label *test_blacklist(struct prog_info *pi,char *name,char *message);
	struct label *search_symbol(struct prog_info *pi,struct label *first,char *name,char *message);
	void free_defs(struct prog_info *pi);
	void free_labels(struct prog_info *pi);
	void free_constants(struct prog_info *pi);
	void free_blacklist(struct prog_info *pi);
	void free_variables(struct prog_info *pi);

- Modified the print_msg function (MSGTYPE_MESSAGE_NO_LF and MSGTYPE_APPEND) (need this for new .message extension)








