[comp.os.os9] CRC-24 Routine for Executables ??

johns@hpwala.HP.COM (John Silva) (07/26/88)

(Sorry if this question has already been asked before, but I do not normally
read this group.  I am asking this question for a friend.)

  Does anyone know of a CRC-24 routine for calculating the CRC that is used
when OS-9 loads a program (the one in the descriptor - if I have the
terminology right ...) ??

  Any pointers appreciated,

	John Silva
	UN*X :   johns%hpwala@hplabs.hp.com
		 ... hplabs!hpwala!johns

pete@wlbr.EATON.COM (Pete Lyall) (07/29/88)

In article <514@hpwala.HP.COM> johns@hpwala.UUCP (John Silva) writes:
>  Does anyone know of a CRC-24 routine for calculating the CRC that is used
>when OS-9 loads a program (the one in the descriptor - if I have the
>terminology right ...) ??

John - 

There's a built in system call to handle the generation of 24 bit
CRC's (at least in 6809/OS9....I''m sure there's something similar in
os9/68000 as well).

Have your friend look at the 'F$CRC' call.

In essence he needs to initialize a three byte area (the temporary
CRC accumulator) to $FF's. Then set:

 X register = starting address of block to generate CRC for
 Y register = number of bytes to process
 D register = pointer to the 3 byte area used as a CRC accumulator.

 then just 'OS9 F$Crc'

 The file/data to be CRC'd may be processed in several chunks.. the
 CRC will be accumulated over these chunks. It is just prior to the
 first pass that the temp. accumulator need be initialized.


-- 
Pete Lyall (OS9 Users Group VP)|  DELPHI: OS9UGVP  |  Eaton Corp.(818)-706-5693
Compuserve: 76703,4230 (OS9 Sysop) OS9 (home): (805)-985-0632 (24hr./1200 baud)
Internet: pete@wlbr.eaton.com            UUCP: {scgvax,jplgodo,voder}!wlbr!pete 

johns@hpwala.HP.COM (John Silva) (08/02/88)

In article <22294@wlbr.EATON.COM> pete@wlbr.UUCP (0000-Pete Lyall) writes:
-In article <514@hpwala.HP.COM> johns@hpwala.UUCP (John Silva) writes:
--  Does anyone know of a CRC-24 routine for calculating the CRC that is used
--when OS-9 loads a program (the one in the descriptor - if I have the
--terminology right ...) ??
-
-John - 
-
-There's a built in system call to handle the generation of 24 bit
-CRC's (at least in 6809/OS9....I''m sure there's something similar in
-os9/68000 as well).
-
 I didn't have all the details of what he was trying to accomplish, but,
 what he needed was a C (or 680xx) version of the CRC24 routine for a 6809
 cross assembler that he was trying to get working on his Amiga.  He did
 end up using the F$CRC routine (by disassembling it), and converting it
 into C code.
-

  Thanks for the response,
	John