fillfcb ;move eCRC CSMLCRCK C LCRCK COM)LCRCK SYM=LIBACC C A bmove0: mov a,m ora a jz d line to buff lxi h,combuf ; This routine was lifted from CRCK44.ASM and adapted for ; BDS C. To convert to .CRL file do: ; 1. CASM CRC.AAZ (makes a file "CRC.ASM" out of it.) ; 2. ASM CRC.AAZ (makes a .HEX file.) ; 3. DDT CRC.HEX (makes .CRL file - write down size in sectors.) ; 4. SAVE CRC.CRL ; ; 8080 ROUTINE FOR GENERATING A CYCLIC-REDUNDANCY-CHECK. CHARACTER ; LEAVES THAT CHARACTER IN LOCATION 'REM'. BY FRED GUTMAN. FROM ; 'EDN' MAGAZINE, 5 JUNE 1979, PAGE 84. ; maclib bds FUNCTION updcrc push b call ma2toh mov c,a call ma3toh MOV A,H ANI 128 ;Q-BIT MASK PUSH PSW ;SAVE STATUS DAD H ;2 * R(X) mov a,c ;MESSAGE BIT IN 'LSB' ADD L MOV L,A POP PSW JZ QB2 ;IF Q-BIT IS ZERO ; QB: MOV A,H XRI 0A0H ;'MS' HALF OF GENERAL POLYNOMINAL MOV H,A MOV A,L XRI 97H ;'LS' HALF OF GENERAL POLYNOMINAL MOV L,A ; QB2: pop b RET endfunc ERAL POLYNOM/* LCRCK - version 1.2 Checks the "crc" of a library member. The crc value computed by this program is compatible with the one generated by CRCK44. USE: LCRCK COMPILE/LINK: cc1 lcrck nl2 lcrck libacc crc By S. Kluger 01-10-83 Modified 03-20-83 by Gary Novosielski Changed do{}while to while{} to properly handle null members. Removed improper call to erxit. */ #include char curdsk, crc, fcb[36]; char fnam[12], libnam[16], dirbuf[128], *dirp; int fd, j, seccnt, lpc, dirsiz, filsiz; main(argc,argv) int argc; char **argv; { if (argc != 3) { printf("\nLCRCK crck check program for LBR file members.\n"); printf("Compatible with CRCK44.\n"); printf("USAGE: LCRCK \n"); printf("Where: = name of .LBR file and\n"); printf(" = full name of member file.\n"); printf("(Find with LDIR.\n\n"); exit(); } printf("\nLCRCK vers 1.2 03-20-83\n\n"); opnlib(argv[1]); if (fndmem(argv[2]) == ERROR) { printf("\n%s not in LBR file!\n",argv[2]); exit(); } printf("\nMember %s\t\t- ",argv[2]); doit(); } doit() { unsigned sum; sum = 0; dirsiz = filsiz; while(dirsiz) { reload(); j = 127; for (j=0; j<128; j++) { sum = updcrc(dirbuf[j],sum); dirp++; } } printf("CRC = %04x\n",sum); } 8 ;b͡zzvzÕùEK]0 2͵ ^#V#*~#fo^#*~#fo^#V#*n^#*n^#V# ~#fo^#& ~#fo!+!#!+!#!+!+}|z{|}|z7||7zZZ)|/g}/o#|͉k|/g}/o#ɯ2cZZk:c|/g}/o#|/g}/o#:c<2cqDM!xxGyO҃)v|͔`i|)Öxڷz/W{/_ѯzW{_=yOxGæ2cZZ͉M|}ȯ|g}o)|/g}/o#z/W{/_!9~#fo! ! ! ! ! ! K!9~#A!9"q**q"e!c*"_!"a!Y"C>2Y>2\>2[2^>2m2n>2l>2p!";!"?!@"=!"A !F#x:~#!e2d~# :" 2d +}|~#:G:dx."2d+w# +6# !6#@**|^+R2i2:*e!#"0!#"2!>ڋo&͕=|  v~2ʷ͹56!+W ?_!~7z?ͤ:>͛@w#2.ww#w#w#w*>?=͉;w#͉2> w#=ͤͲd 2l&0OxGͲg/ʃPxY͛.7:77!a{  ʥ ʥ0:?ŷO !y$ 7o&))T])))!y 2k_ :k!9DM͐+++|!Z ! ! ! ! ! !8 ! ~#fo##~#fo ! ~#fo~#fo #|; ! ~#fo~#fo!T ! ~#fo~#fo!j z LCRCK crck check program for LBR file members. Compatible with CRCK44. USAGE: LCRCK Where: = name of .LBR file and = full name of member file. (Find with LDIR. LCRCK vers 1.2 03-20-83 %s not in LBR file! Member %s - !9DM`iw#w*"*|  !"!"*| ͐*Hn&ͦ `is#r*#"*#"å Î ͐! !9CRC = %04x !9DM͐!8 !.!8+ `is`in}? ! !8!8!! !,!! !<|ʅ !8! ! ͐ !!8g"*#|¦ ! ͐ !9.LBRLBRgot %s Library type if present must be .LBR Library file not found. !9DM͐8! !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,!9~o&a{_o08A1 MAIN 0A7A DOIT 0B03 OPNLIB 0BFF FNDMEM 0D08 RELOAD 0D2B MATCHR 0D90 ERXIT 0DA6 UPDCRC 0DC4 PRINTF 0DDC _SPR 1201 _USPR 12A3 _GV2 1300 EXIT 1303 SETFCB 1316 MOVMEM 1367 OPEN 13CA READ 147D SEEK 14DA PUTCHAR 1509 STRCPY 151F STRCAT 153C STRCMP 1558 ISDIGIT 1568 TOUPPER Link statistics: Number of functions: 24 Code ends at: 0x1579 Externals begin at: 0x1600 Externals end at: 0x16D6 Jump table bytes saved: 0x84 Warmboot supressed, Rst 6 not trapped /* LIBACC - LIBrary file ACCess routines Lifted from LMODM10.C by Bill Earnest S. Kluger 01-10-83 */ #include char curdsk, crc, fcb[36]; char fnam[12], libnam[16], dirbuf[128], *dirp; int fd, j, seccnt, lpc, dirsiz, filsiz; opnlib(file) char *file; { char l, *npnt; strcpy(libnam,file); l = matchr(libnam,'.'); if (l == 0) strcat(libnam, ".LBR"); setfcb(fcb,libnam); /* build name in fcb */ movmem(fcb,fnam,12); /* get from dfcb2 for log */ if(strcmp(fcb+9, "LBR")){ printf("got %s\n",libnam); erxit("Invalid file spec, MUST be type .LBR\n"); } fd = open(libnam,0); if(fd == -1) erxit("Library file not found.\n"); npnt = fcbaddr(fd); if(npnt[1] > 127) erxit("File not for distribution.\n"); } fndmem(file) char *file; { char dnam[16], fname[36]; setfcb(fname, file); read(fd,dirbuf,1); dirp = dirbuf; dirsiz = *(dirp+14); dirp += 32; do{ if (*dirp == 255) return(ERROR); if (*dirp == 0){ strcpy(dnam, dirp+1); dnam[11]=0; if(strcmp(dnam, fname+1) == 0){ filsiz = (*(dirp+14)) + ((*(dirp+15)) * 256); seek(fd,(*(dirp+12)) + ((*(dirp+13)) * 256),0); return(OK); } } dirp += 32; if(dirp > dirbuf+128) reload(); } while(dirsiz); return(ERROR); } reload() { read (fd,dirbuf,1); dirp = dirbuf; dirsiz--; } char matchr(st,ch) char *st,ch; { int i; for(i=0; st[i]; i++){ if(st[i] == ch) return(i); } return(0); } erxit(strg) char *strg; { printf(strg); exit(); } ; st[i]; i++){ if(st[i] == ch) return(i); } return(0); } erxit(strg) char *strg; { printf(strg); exit(); }