home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
code_examples
/
librar
/
slhex2fi.c
< prev
next >
Wrap
Text File
|
1989-02-08
|
611b
|
29 lines
/*--------------------------------------*/
/* */
/* SLHEX2FILE(X,X) */
/* */
/* Writes a number to a file in hex for-*/
/* mat. The first argument is the file */
/* descriptor and the second is the */
/* number to write. */
/* */
/*--------------------------------------*/
# include "stdio.h"
void slhex2file(fd,a)
long a;
FILE *fd;
{
long d,e;
int c;
c=e=a/16777216L;
d=a-16777216L*e;
putc(scram(c),fd);
c=d=a/65536L;
d=a-65536L*d;
putc(scram(c),fd);
c=e=d/256;
putc(scram(c),fd);
c=d=d-256*e;
putc(scram(c),fd);
}