Hi
Indexing pins is not a totally safe thing to do with PBP. This is a "Extra feature" and works really great with some commands and not at all with others. I have had some really strange results using indexed pins and Pulsin. It would not be a big surprise if While was a no-no.
One other thing, please forgive me if I am wrong, are you sure you are using Interupt? When I look at your code. Unless it is in the interupt handler I would say you are polling the pin to get the status and generate a "software interupt". IF this is the case there are more efficient ways to do that is much faster and will save a ton of codespace.
if (porta.0 == 0) THEN
pin = 0 'set the number of the pin for the score managment (update_scores)
GOTO got_pin 'bypass
ENDIF
Will it work via a pointer
SYMBOL PORT_PIN = PORTA
while PORT_PIN.0[pin] = 0
Worth a try I guess, unable to test.
or a loop of
mybyte = portA
while mybyte.0(pin) = 0
By the way re: "You are right, bit shuffling and time wasting"
MOVE?BB PORTA, _B0
AND?BCB _B1, 00Fh, _B1
NCD?BB _B1, _B0
LABEL?L L00002
END
thats the size of the code in assembly using ncd added the "and" to remove msb
Last edited by sheepdog; - 9th October 2008 at 20:48. Reason: code shuffle
Bookmarks