#include<reg52.h>
#include<stdio.h>
void delay(unsigned int z);
void uart_init(void);
int main(void)
{
int a=99;
char *string="able";
uart_init();
while(1)
{
puts{"abcd"};
printf("%d %x %c %s %p\n",a,a,(char)a,string,string);
delay(1000);
}
return 0;
}
void uart_init(void)
{
TMOD=0x20;
TH1=0xf3;
TL1=0xf3;
TR1=1;
SCON=0x50;
PCON=0x00;
IE=0x90;
TI=1;
}
void delay(unsigned int z)
{
unsigned int x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
|