#!/bin/perl

$cfgf = "puff1.cfg";

open(cfgfh,"<",$cfgf);

$asmf = $cfgf;
$asmf =~ s/\.cfg$/.asm/g;

print($asmf);
print "\n";

open(asmfh,'>',$asmf);

$i=0;

printf asmfh "\t\tDATA\t";
printf asmfh "%05Xh",0;

while($i<127)
{
	$i++;
	if (int($i/8) == $i/8)
	{
		printf asmfh ";\r\n\t\tDATA\t";
	}
	else
	{
		printf asmfh ",";
	}
	$v=(1+79.0*($i-1)/126.0)*50.0;
	$f=int($v);
	print "$i \t $f \n";
	printf asmfh "%05Xh",$f;
}
printf asmfh ";\r\n";
close(asmfh);