[Coco] Coco OS9 Source Control (question)

Greg Law glaw at live.com
Mon Jun 16 19:56:41 EDT 2014


If you are writing this in C, load the text file into a contiguous block of 
memory then call crc() with the starting address and size of the file. This 
returns a 3-byte CRC that can be converted to say a hex string with 
printf().

If you don't have sufficient memory to load the entire file in one shot, you 
can also load the file in say 8K chunks and keep calling crc() with each 
loaded chunk to accumulate the final CRC.

If you look up the F$CRC system call, you'll see that it has these input 
parameters:

X = starting address
Y = number of bytes
U = address of the 3-byte CRC accumulator

The gist is that you need to initialize the CRC accumulator with zeroes once 
and only once before you begin calculating the CRC for each file. Each 
subsequent call to F$CRC will continue accumulating the CRC into the 3-byte 
accumulator. After you've called F$CRC for the last chunk of the file, the 
CRC of the file is the 3-byte value in the accumulator.

I don't have the C compiler manual with me to confirm, but I think crc() is 
a thin wrapper around the F$CRC system call and takes all three parameters 
as inputs.

-----Original Message----- 
From: Bill Pierce via Coco
Sent: Monday, June 16, 2014 6:55 PM
To: coco at maltedmedia.com
Subject: Re: [Coco] Coco OS9 Source Control (question)


Thanks Gene, is the syscall and access method in the vfy source?
I need to make the checksum into a short ASCII string to add as a file 
extension for easy ID and searching. It alsohas to be added to the checksum 
report file.


Bill Pierce
"Today is a good day... I woke up" - Ritchie Havens


My Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Co-Webmaster of The TRS-80 Color Computer Archive
http://www.colorcomputerarchive.com/
Co-Contributor, Co-Editor for CocoPedia
http://www.cocopedia.com/wiki/index.php/Main_Page
E-Mail: ooogalapasooo at aol.com




-----Original Message-----
From: Gene Heskett <gheskett at wdtv.com>
To: coco <coco at maltedmedia.com>
Sent: Mon, Jun 16, 2014 6:11 pm
Subject: Re: [Coco] Coco OS9 Source Control (question)


On Monday 16 June 2014 17:55:38 Bill Pierce via Coco did opine
And Gene did reply:
(nitr)os9 has a syscall to do that.  Thats how I did the updates, if
required, in vfy.  No sense in re-inventing that particular wheel. :)


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS

-- 
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco



-- 
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco 



More information about the Coco mailing list