Lockset sempahore assembly syntax
TransistorToaster
Posts: 149
Hello,
Did anyone play with the LOCKSET in ASSEMBLY with success?
I have a producer consumer paradigm between two cogs with semaphore protection. One is in assembly, while the other is in spin and the code behaves as if the semaphores are not working properly.
On p 234 od the Propeller manual, the example of how to use lockset is:
I did not find an example for the assembly version, so this is what i came up with
I am pretty certain that I correctly pass from the spin code to the asm code when I do my cognew(@asmStart, @var). If I remove the lockclr in the ASM code, then the spin code never passes though the wait on the lockset. I did not test the other way around because I honeslty don't know if I have the proper assembly code.
If you deal with this problem, please give me your input.
Thanks,
F
Did anyone play with the LOCKSET in ASSEMBLY with success?
I have a producer consumer paradigm between two cogs with semaphore protection. One is in assembly, while the other is in spin and the code behaves as if the semaphores are not working properly.
On p 234 od the Propeller manual, the example of how to use lockset is:
repeat until not lockset(semId) ' do the work on the shared resource lockclr(semId)
I did not find an example for the assembly version, so this is what i came up with
label lockset lock_id if_c jmp #label ' do the work on the shared resource lockclr lock_id
I am pretty certain that I correctly pass from the spin code to the asm code when I do my cognew(@asmStart, @var). If I remove the lockclr in the ASM code, then the spin code never passes though the wait on the lockset. I did not test the other way around because I honeslty don't know if I have the proper assembly code.
If you deal with this problem, please give me your input.
Thanks,
F
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.