home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CBM Funet Archive
/
cbm-funet-archive-2003.iso
/
cbm
/
programming
/
msdos
/
xa214f.lzh
/
xa214f
/
misc
/
printcbm.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-01-03
|
2KB
|
67 lines
/*
XA65 - 6502 CROSS ASSEMBLER AND UTILITY SUITE
PRINTCBM - LIST cbm BASIC PROGRAMS
cOPYRIGHT (c) 1997 aNDR{$e9} fACHAT (A.FACHAT@PHYSIK.TU-CHEMNITZ.DE)
tHIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
IT UNDER THE TERMS OF THE gnu gENERAL pUBLIC lICENSE AS PUBLISHED BY
THE fREE sOFTWARE fOUNDATION; EITHER VERSION 2 OF THE lICENSE, OR
(AT YOUR OPTION) ANY LATER VERSION.
tHIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
BUT without any warranty; WITHOUT EVEN THE IMPLIED WARRANTY OF
merchantability OR fitness for a particular purpose. sEE THE
gnu gENERAL pUBLIC lICENSE FOR MORE DETAILS.
yOU SHOULD HAVE RECEIVED A COPY OF THE gnu gENERAL pUBLIC lICENSE
ALONG WITH THIS PROGRAM; IF NOT, WRITE TO THE fREE sOFTWARE
fOUNDATION, iNC., 675 mASS aVE, cAMBRIDGE, ma 02139, usa.
*/
#INCLUDE <STDIO.H>
CHAR *CMD[]={$7b} "END","FOR","NEXT","DATA","INPUT#","INPUT","DIM","READ",
"LET","GOTO","RUN","IF","RESTORE","GOSUB","RETURN",
"REM","STOP","ON","WAIT","LOAD","SAVE","VERIFY","DEF",
"POKE","PRINT#","PRINT","CONT","LIST","CLR","CMD","SYS",
"OPEN","CLOSE","GET","NEW","TAB(","TO","FN","SPC(",
"THEN","NOT","STEP","+","-","*","/","^","AND","OR",
">","=","<","SGN","INT","ABS","USR","FRE","POS","SQR",
"RND","LOG","EXP","COS","SIN","TAN","ATN","PEEK","LEN",
"STR$","VAL","ASC","CHR$","LEFT$","RIGHT$","MID$","GO"{$7d};
INT MAIN(INT ARGC, CHAR *ARGV[]){$7b}
file *FP;
INT A,B,C;
IF(ARGC>1){$7b}
FP=FOPEN(ARGV[1],"RB");
IF(FP){$7b}
B=FGETC(FP);
B=FGETC(FP);
WHILE(B!=eof){$7b}
A=FGETC(FP);
A=A+256*FGETC(FP);
IF(A){$7b}
A=FGETC(FP);
A=A+256*FGETC(FP);
PRINTF("%D ",A);
WHILE((C=FGETC(FP))){$7b}
IF(C==eof)
BREAK;
IF(C>=0X80 && C<0XCC)
PRINTF("%S",CMD[C-0X80]);
ELSE
PRINTF("%C",C);
{$7d}
PRINTF("\N");
{$7d} ELSE
BREAK;
{$7d}
FCLOSE(FP);
{$7d} ELSE
PRINTF("fILE %S NOT FOUND!\N",ARGV[1]);
{$7d} ELSE
PRINTF("USAGE: LISTCBM FILE\N");
RETURN(0);
{$7d}