Does anyone know how to write a perl script to do a checksum calculation of an intel hex record?
The intel hex record format is:
:BBAAAATTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDCC
where
BB = 2 digit byte count
AAAA = 4 digit hex address
TT = 2 digit hex record type
DD = 2 digit hex data byte
CC = 2 digit checksum byte
The checksum is calculated by summing the values of all hexadecimal digit pairs in the record and taking the two's complement.
for example:
intel record:
:1000F000FF3FFF3FFF3FFF3FFF3FFF3FFF3FFF3F10
sum of all hex bytes except the checksum:
10+00+F0+00+FF+3F+...+FF+3F = AF0
2's compliment of F0 is 10
Thanks.
The intel hex record format is:
:BBAAAATTDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDCC
where
BB = 2 digit byte count
AAAA = 4 digit hex address
TT = 2 digit hex record type
DD = 2 digit hex data byte
CC = 2 digit checksum byte
The checksum is calculated by summing the values of all hexadecimal digit pairs in the record and taking the two's complement.
for example:
intel record:
:1000F000FF3FFF3FFF3FFF3FFF3FFF3FFF3FFF3F10
sum of all hex bytes except the checksum:
10+00+F0+00+FF+3F+...+FF+3F = AF0
2's compliment of F0 is 10
Thanks.