程序如下,但是运行显示的ASCII却不正确?请问是偏移地址算的不正确吗??!还是什么原因呢?!
static GetFontasc (char *asccodes1)
{
unsigned long offset;
char *p1;
p1=asccodes1;
offset=(*asccodes1)*16;
ASC=fopen("D:\\ascii","rb");
fseek(ASC, offset, SEEK_SET);
fread(FontDataBufasc, 16, 1, ASC);
fclose(ASC);
}
void Lcd_DispAsc(char *asccodes2)
{
int i,j,m=0;
unsigned int data;
char *p2;
p2=asccodes2;
GetFontasc(p2);
for(j=0;j<16;j++)
{
data=FontDataBufasc[j];
for(i=0;i<8;i++)
{
if(data&(128>>i))
{printf("%c",'#');m++;}
else
{printf("%c",'-');m++;}
}
if(m>7)
printf("\n");
}
}
int main()
{
Lcd_DispAsc("A");
return 1;
} |