clear
;CRC16L
unalias -all

define poly	8005

;l					; 0     -1
;byte sample1[] = "abc";		//,	
;byte sample2[] = "ABC";		//,	
;byte sample3[] = "This is a string";	//,	

alias crc16l_test	{\
	define_mem 10000 10000 #1     #2 -f;	\
						\
	add_mem_area	ram	8000 2000 2 RW;	\
	add_io_area	io	0000 0100;	\
						\
	set -s 8000 "abc";		\
	set -s 8010 "ABC";		\
	set -s 8020 "This is a string";		\
						\
	print @crc16L(8000, 3, $poly);	\
	print $_ADDR , $_RESULT;		\
						\
	print @crc16L(8010, 3, $poly);	\
	print $_ADDR , $_RESULT;		\
	print @crc16L(8020, 16t, $poly);	\
	print $_ADDR , $_RESULT;		\
						\
	print @crc16L(8000, 3, $poly,-1);	\
	print @crc16L(8010, 3, $poly,-1);	\
	print @crc16L(8020, 16t, $poly,-1);	\
}
	

;-----------------------------------------
crc16l_test  LE     BA

;#exit
;-----------------------------------------
crc16l_test  BE     BA

;-----------------------------------------
crc16l_test  LE     WA


;-----------------------------------------
crc16l_test  BE     WA


