How do you convert ASCII to BCD?

1 answer

Answer

1059102

2026-04-25 23:45

+ Follow

void main ()

{

unsigned char hrs,mins,secs;

char ch1, ch2;

puts("\nEnter the hours to update: ");

ch1=getche();

ch2=getch();

hrs = ASCIItoBCD(ch1, ch2);

puts("\nEnter the minutes to update: ");

ch1=getche();

ch2=getch();

mins = ASCIItoBCD(ch1, ch2);

puts("\nEnter the seconds to update: ");

ch1=getche();

ch2=getch();

secs = ASCIItoBCD(ch1, ch2);

*tm = 0;

_CH = hrs;

_CL=mins;

_DH= secs;

_DL=0;

_AH =3;

geninterrupt(0x1a);

puts("Time Updated");

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.