| delorie.com/archives/browse.cgi | search |
| Message-ID: | <360F20F0.D025E1A7@post.comstar.ru> |
| Date: | Mon, 28 Sep 1998 08:38:56 +0300 |
| From: | Dim Zegebart <zager AT post DOT comstar DOT ru> |
| Reply-To: | zager AT post DOT comstar DOT ru |
| Organization: | Comstar Ltd. |
| MIME-Version: | 1.0 |
| To: | Silviu Simen <ssimen AT ubisoft DOT ro>, "djgpp AT delorie DOT com" <djgpp AT delorie DOT com> |
| Subject: | Re: outportb problem ? |
| References: | <360B42E0 DOT 7A0E2FDC AT ubisoft DOT ro> |
Silviu Simen wrote:
> typedef unsigned char byte;
> byte byte_read_cmos(byte adresa) {
> byte x;
> outportb(0x70,adresa);
> delay(2);
> x =inportb(0x71);
> return x;
> }
>
> void read_cmos(void) {
> byte i;
> byte *p;
> for(p=(char*)&cmos,i=0;i<sizeof(cmos);p++,i++)
> *p=byte_read_cmos(i);
> }
Looks correct, the only suggestion (rather stupid) is p=(byte*)&cmos;
not (char*)
--
Dim Zegebart
Moscow, Russia
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |