Thanks for all comments.
But since the NMEA sentences are a stream of characters with no fixed length how capture the whole sentence ?
NMEA 0183 strings start with $, then end with <cr><lf>. The data fields end with *, and always followed by two bytes of checksum.
So, why not run a loop, starting with $ until you reach *, reading character by character, then end (i.e. exit) the loop when you reach *, then do the XOR operation on the characters (bytes) you inputted, to see if the checksum is correct?
First, call the entire NMEA sentence a$. Then you separate that input string into its individual characters:
FOR i = 1 TO 1000
num(i) = ASC(a$, i)
IF num(i) = 42 THEN EXIT FOR
NEXT i
numChar = i
The second statement breaks up the long string a$ into its separate characters. The array num(i) is the decimal value assigned to each of the ASCII characters in the NMEA RMC sentence. You exit that FOR loop when you reach character 42, which is *.
Now you know the length of that string of characters. numChar = i. (NMEA strings are at most 82 characters long, so even if the string is not compliant, 1000 should be more than enough.)
Then the checksum:
FOR i = 2 TO numChar - 1
total = total XOR num(i)
NEXT i
totalHexInit$ = HEX$(total)
totalHex$ = RIGHT$("00" + totalHexInit$, 2)
You have to start with the character after $, end with the characters just before *, and the checksum is two bytes wide. Now you have the computed checksum, which you can check against the checksum characters sent in the RMC sentence, after *.