How is the Checksum from Hex file calculated?

Hi, as the title says I’m curious to know how the checksum value is calculated, below is a single line from the hex file which was loaded onto my Fez Cerb board, I’ve added spaces to make it easier to read, S315 appears on every line, the address on line 1 is 080C0000 followed by 16 hex values which represent the bytes, the values 9D on line 1 and 33 on line 2 are I assume the checksum values but I’ve no idea how they are generated so any insights would be great.

S315 080C0000 4D 53 53 70 6F 74 31 00 C5 A0 EE F8 39 46 84 DE 33
S315 080C0010 00 00 00 00 00 00 00 00 FF FF FF FF 02 00 2B 00 9D

@ chillydk147 - All here: Intel HEX - Wikipedia

Thanks, it’s actually based upon the Motorola S-record file format which does a 1s compliment calculation instead of a 2s compliment calculation, [url]https://en.wikipedia.org/wiki/SREC_(file_format)[/url], line 2 is calculated as shown below

15+08+0C+00+10+00+00+00+00+00+00+00+00+FF+FF+FF+FF+02+00+2B+00 = 0x462 or 0100 0110 0010

then we take the LSB “0110 0010” and invert it to get “1001 1101” which is 0x9D