home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
code_examples
/
librar
/
grabdate.c
< prev
next >
Wrap
Text File
|
1989-02-08
|
1KB
|
39 lines
/*--------------------------------------*/
/* */
/* GRABDATE(X) */
/* */
/* Functionality: */
/* Gets the system date. */
/* Arguments: */
/* 0: The date array that the */
/* system date is put in. */
/* Returns: Nothing */
/* Functions used: */
/* INT86() */
/* Author: John Callicotte */
/* Date created/modified: 09/01/88 */
/* */
/*--------------------------------------*/
# include "dos.h"
void grabdate(aa)
char aa[8];
{
union REGS outt;
int d;
outt.x.ax=256*42; /* Put 42 in AH register. (DOS function 42) */
int86(33,&outt,&outt); /* Make the DOS call. */
aa[6]=((outt.x.cx-1900)/10)+48; /* Register CX has the year. */
aa[7]=((outt.x.cx-1900)-((aa[6]-48)*10))+48;
aa[0]=((outt.x.dx/256)/10)+48; /* Register DX has the month. */
aa[1]=((outt.x.dx/256)-((aa[0]-48)*10))+48;
d=outt.x.dx-256*(outt.x.dx/256);
aa[3]=(d/10)+48;
aa[4]=(d-((aa[3]-48)*10))+48;
aa[2]=aa[5]=47;
}