Help with WRLONG in PASM
yamaha1
Posts: 6
Hi all, new to the forum but have been learning the Propeller for a year or so now.
I am having an issue that I can't seem to figure out.....
It's a simple process that measures the input state of a pin at set intervals, stores the state of the pin in a long in the cog, then when all 32 bits are read, writes to the hub.
reading the pin, seems to be working correctly as does storing the data in the cog. However, when I write it to the HUB, I only get the lower 16 bits indicated in both VeiwPort terminal and Prop Serial Terminal.....
Any suggestions?
In the manual it states:
WRLONG
Instruction: Write a long to main memory.
WRLONG Value, 〈#〉 Address
Value (d-field) is the register containing the 32-bit value to write to main memory.
Address (s-field) is a register or a 9-bit literal whose value is the main memory address to write to.
....I'm having trouble wrapping my head around why I'm only get 16 of the bits.
Thanks!
I am having an issue that I can't seem to figure out.....
It's a simple process that measures the input state of a pin at set intervals, stores the state of the pin in a long in the cog, then when all 32 bits are read, writes to the hub.
reading the pin, seems to be working correctly as does storing the data in the cog. However, when I write it to the HUB, I only get the lower 16 bits indicated in both VeiwPort terminal and Prop Serial Terminal.....
Any suggestions?
In the manual it states:
WRLONG
Instruction: Write a long to main memory.
WRLONG Value, 〈#〉 Address
Value (d-field) is the register containing the 32-bit value to write to main memory.
Address (s-field) is a register or a 9-bit literal whose value is the main memory address to write to.
....I'm having trouble wrapping my head around why I'm only get 16 of the bits.
Thanks!
spin
4K
Comments
replace that by
debug.bin( info, 32 )
so the issue wasn't with the WRLONG, but with my pointer to the VAR for Serial Terminal.
Thanks MagIO2!!
debug.bin( long[ @info ], 32 ) would have worked as well, but it's not necessary, as info is accessible directly here.
Oh ... AND ... Welcome to the forum!
Because the variable is called out at the beginning of the object, the "Long[ @info]" is not required since the variable is directly accessible within the object and any methods that are called within the object.
But, this format "Long [@info]", would be required if I were to call my "start" method from a different object while passing the VAR address....
something like:
object 1
object 2:
Cool! Thanks for all your help and the warm Welcome!!