#include<reg51.h>
#include<absacc.h>
#include<stdio.h>
#include<math.h>
#define uchar unsigned char
#define uint unsigned int
uchar STH0;
uchar STL0;
bit FY=0;
uchar Song_Index=0,Tone_Index=0;
uchar k, key;
sbit SPK=P3^7;
sbit LED1=P1^0;
sbit LED2=P1^1;
sbit LED3=P1^2;
sbit LED4=P1^3;
sbit LED5=P1^4;
sbit LED6=P1^5;
uchar code DSY_CODE[]=
{0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
uchar code Song[][50]=
{{13,12,10,12,15,13,12,13,10,12,13,12,10,8,6,12,10,9,9,10,12,12,13,10,9,8,12,10,9,8,6,8,5,-1},
{8,9,10,8,8,9,10,8,10,11,12,10,11,12,-1},
{1,2,3,1,1,2,3,1,3,4,5,3,4,5,5,6,5,4,3,1,5,6,5,6,3,1,2,5,1,2,5,1,-1},
{10,10,10,9,10,910,9,9,6,6,7,8,9,8,7,6,5,6,-1},
{10,10,10,9,10,13,12,13,12,12,9,9,10,11,12,11,10,9,8,10,10,-1},
{13,14,13,12,12,10,12,10,9,13,12,10,9,10,10,-1},
{9,13,13,13,8,13,13,13,13,14,15,14,13,14,13,14,10,10,-1},
{13,14,13,12,12,10,12,10,12,13,14,13,14,13,14,10,-1},
{9,13,13,13,8,13,13,13,13,14,15,14,13,13,14,12,13,-1},
{12,10,12,15,13,15,12,12,8,9,10,9,8,9,0,0,12,10,12,15,14,13,15,12,12,9,10,11,7,8,0,0,-1},
{5,5,6,5,8,7,5,5,6,5,9,8,5,5,12,10,8,7,13,11,11,10,8,9,8,3,3,4,3,8,7,3,3,4,3,9,8,5,5,10,10,8,7,6,-1},
{8,0,8,9,13,5,0,10,9,9,9,0,9,9,8,9,0,0,0,9,0,9,10,11,12,0,11,11,11,11,0,10,11,12,10,0,0,12,8,0,10,11
,12,8,12,13,14},
{6,10,10,10,10,9,8,8,7,6,13,13,13,13,13,12,10,12,12,11,10,10,13,13,12,10,9,8,9,8,7,6,3,-1},
{13,13,8,13,13,13,13,14,15,14,13,14,13,14,10,10,13,14,13,12,12,10,12,10,12,13,14,13,14,13,14,1
0,9,13,13,13,8,13,13,13,13,14,15,14,13,13,14,12,13,-1},
{12,8,0,10,11,12,8,12,13,14,13,0,0,0,15,15,15,14,13,13,12,12,10,11,11,10,9,8,0,0,0,-1},
{5,8,8,8,8,5,6,7,8,8,0,10,8,9,10,12,12,12,10,10,8,10,12,10,9,9,13,12,9,10,12,10,12,10,9,10,8,9,10,
-1} };
uchar code Len[][50]=
{{1,2,1,1,1,2,2,2,1,2,2,1,1,2,2,2,2,2,1,2,1,2,2,1,1,2,1,2,2,2,2,2,4,-1},
{1,1,1,1,1,1,1,1,1,1,2,1,1,2,-1},
{1,1,1,1,1,1,1,1,1,1,2,1,1,2,0,1,0,1,1,1,0,1,0,1,1,1,1,1,2,1,1,2,-1},