Finding things
g3cwi
Posts: 262
This evening I had to split a long into bytes. I started off on a scheme to do this but then thought to check around on the forum. A perfect answer was there. Snippet folows:
Where is great stuff like that documented or is searching around here the only way to find such gems?
I must say that I'm getting to like this stuff. Just yesterday programming an Si570 seemed like it would be all but beyond me - but I now have a fully working test system zooming about the bands!
Cheers
Richard
Testhex := $D605db76 ' 'The next code splits the long into the required bytes Reg_09_Byte := byte[@Testhex][3] 'splits off d6 Reg_10_Byte := byte[@Testhex][2] 'splits off 05 Reg_11_Byte := byte[@Testhex][1] 'splits off db Reg_12_Byte := byte[@Testhex][0] 'splits off 76
Where is great stuff like that documented or is searching around here the only way to find such gems?
I must say that I'm getting to like this stuff. Just yesterday programming an Si570 seemed like it would be all but beyond me - but I now have a fully working test system zooming about the bands!
Cheers
Richard
Comments
BYTE [BaseAddress] [Offset]
The propeller manual is really good, but I guess it's sometimes hard to remember these kind of thing from reading it once ... or twice ...
But here in the forum you are also welcome to ask such easy questions. At least you will get a pointer to where to find the needed information.
By using this format you can use a variable index to retrieve a byte.
Thanks too Jonny. I will try that.
Cheers
Richard