problem using @hserptr

pjrebordao

Senior Member
On a 20X2, I have these lines:

let hserptr = 0
let CMD = @hserptr

But I get a syntax error on @hserptr... why ?

PS - CMD is a byte var
 

srnet

Senior Member
But I get a syntax error on @hserptr... why ?
@hserptr is not in the list of supported special function registers for the 20X2.

For the supported special function registers, see page 20 of the manual.
 

inglewoodpete

Senior Member
The practice of using hserptr to read data from the scratchpad buffer is risky. hserptr pointer points to the next free location in the scratchpad and will change without warning whenever a new serial character arrives. hserptr is best set for hardware serial data reception and left alone. Check its value if you want to see if you have received data but don't use it as a read pointer. As Technical has indicated, point the ptr variable at the data for reading the scratchpad buffer.
 
Top