home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
canada-remote-systems
/
cpower
/
bindump.c
< prev
next >
Wrap
Text File
|
2019-04-13
|
911b
|
54 lines
/* BINDUMP.C
* - DOES BINARY DUMP OF ANY FILE
* TO PRINTER
* ┬EN ╨EDERSEN ═AY 1987
*/
#INCLUDE "STDIO.H"
#DEFINE STDPRN 4
MAIN(ARGC,ARGV)
INT ARGC;
CHAR **ARGV;
█
╞╔╠┼ *INPUT;
CHAR BVAL[9];
INT LINE,I,J,K;
LINE=0;
OPEN(STDPRN,4,4);
IF (ARGC != 2) █
PRINTF("\N╒SAGE: BINDUMP FILENAME\N");
EXIT();
▌
ELSE █
INPUT = FOPEN(*++ARGV,"R");
IF (FERROR() > 0) █
PRINTF("\NCAN'T OPEN %S\N", *ARGV);
EXIT();
▌
▌
FOR (I = 0; I < 10; I++)
BVAL[I] = 0X00;
FPRINTF(STDPRN, "\NBINDUMP: %S\N\N", *ARGV);
WHILE ((J = FGETC(INPUT)) != ┼╧╞) █
FOR (I = 7; I >= 0; I--) █
K = J & 0X01;
K += '0';
BVAL[I] = K;
J >>= 1;
▌
FPRINTF(STDPRN, "%S", BVAL);
FPRINTF(STDPRN, " ");
LINE++;
IF (LINE > 7) █
FPRINTF(STDPRN, "\N");
LINE = 0;
▌
▌
FPRINTF(STDPRN, "\N\NEND OF FILE\N");
CLOSE(STDPRN);
▌