clear
;CRC7
unalias -all


;set -s 8000 -b 01 01 ef
;set -s 8010 -b 80 80 f7
;print @crc7L(8000, 3, 45 << 1)	;0x01f6d870->0x38
;print @crc7R(8010, 3, 51)	;0x0000000e



	define_mem 10000 10000 be     ba -f;
						
	add_mem_area	ram	8000 2000 2 RW;	
	add_io_area	io	0000 0100;	
						
	set -s 8000 -b @inc(100,0)
;CRC7L
define poly 45 << 1
	print @crc7L(8000, 1t, $poly);	
	print @crc7L(8001, 1t, $poly);	
	print @crc7L(8080, 1t, $poly);	
	print @crc7L(80ff, 1t, $poly);	

;CRC7R
define poly 51
	print @crc7R(8000, 1t, $poly);		
	print @crc7R(8001, 1t, $poly);		
	print @crc7R(8080, 1t, $poly);		
	print @crc7R(80ff, 1t, $poly);		


;CRC16L
define poly 8005
	print @crc16L(8000, 1t, $poly);	
	print @crc16L(8001, 1t, $poly);	
	print @crc16L(8080, 1t, $poly);	
	print @crc16L(80ff, 1t, $poly);	

;CRC16R
define poly a001
	print @crc16R(8000, 1t, $poly);		
	print @crc16R(8001, 1t, $poly);		
	print @crc16R(8080, 1t, $poly);		
	print @crc16R(80ff, 1t, $poly);		


;CRC16L CCITT
define poly 1021
	print @crc16L(8000, 1t, $poly);	
	print @crc16L(8001, 1t, $poly);	
	print @crc16L(8080, 1t, $poly);	
	print @crc16L(80ff, 1t, $poly);	

;CRC16R CCITT
define poly 8408
	print @crc16R(8000, 1t, $poly);		
	print @crc16R(8001, 1t, $poly);		
	print @crc16R(8080, 1t, $poly);		
	print @crc16R(80ff, 1t, $poly);		


;CRC32L
define poly 04c11db7
	print @crc32L(8000, 1t, $poly);	
	print @crc32L(8001, 1t, $poly);	
	print @crc32L(8080, 1t, $poly);	
	print @crc32L(80ff, 1t, $poly);	

;CRC32R
define poly edb88320
	print @crc32R(8000, 1t, $poly);		
	print @crc32R(8001, 1t, $poly);		
	print @crc32R(8080, 1t, $poly);		
	print @crc32R(80ff, 1t, $poly);		


;CRC32L
define poly 04c11db7
	print @crc32L(8000, 1t, $poly, -1);	
	print @crc32L(8001, 1t, $poly, -1);	
	print @crc32L(8080, 1t, $poly, -1);	
	print @crc32L(80ff, 1t, $poly, -1);	

;CRC32R
define poly edb88320
	print @crc32R(8000, 1t, $poly, -1);		
	print @crc32R(8001, 1t, $poly, -1);		
	print @crc32R(8080, 1t, $poly, -1);		
	print @crc32R(80ff, 1t, $poly, -1);		


