Compiler Issue
Dear JonnyMac and Bean,
I'm unsing latest version of SX/B (2.00.24)
I used JohnnyMac code to: PUT array2, array1(0) TO array1(15)
I tried your code and it worked fine. BUT when I pluged the code into my program it did NOT work. ONLY the first two bytes were changed!!!
(in my code, since I'm using many subs, I had to move my SUB definitions·inside the interrupt area (based on Bean's recommendations) because the compiler complained when I had them before the interrupt code.)
I checked the ASM code of my program and I found that the compiler translated the PUT command differently (outside my program and inside it)·!!
What do you think?
the full code is below
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (SamTheMan) : 6/8/2009 10:52:36 AM GMT
I'm unsing latest version of SX/B (2.00.24)
I used JohnnyMac code to: PUT array2, array1(0) TO array1(15)
I tried your code and it worked fine. BUT when I pluged the code into my program it did NOT work. ONLY the first two bytes were changed!!!
(in my code, since I'm using many subs, I had to move my SUB definitions·inside the interrupt area (based on Bean's recommendations) because the compiler complained when I had them before the interrupt code.)
I checked the ASM code of my program and I found that the compiler translated the PUT command differently (outside my program and inside it)·!!
What do you think?
the full code is below
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (SamTheMan) : 6/8/2009 10:52:36 AM GMT
Comments
FWIW, I recognize the names of all of those subs you're using because most of them come from programs I've written. You do not have too many, there is another problem.
1- I'm sorry if my big bold letters·was interpreted as SHOUTING
·· I was not trying to shout, I just wanted to make my point clear. (please accept my appology)
2-I removed the SUBs coding to make the text short and easy to read. ·and because these subs were mostly written by you, I thought there's no need to post the whole code of what you already know.
Anyway, here is the whole code:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (SamTheMan) : 6/8/2009 10:51:25 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
to answer your question check this:
http://forums.parallax.com/showthread.php?p=655596
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
So the answer is put your ISR code wherever you want (it's not a sub, btw, but an ISR) and GOTO following the INTERRUPT statement:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
SamTheMan -- can you ATTACH (rather than paste) both your SX/B program AND the compiled output (.src)?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
and the ASM part is:
get_Requests:··················· ;Sub get_Requests
· CLR tmp······················· ;·tmp=0
· MOV FSR,#Temp················· ;put temp,que(0) to que(15)
· MOV __PARAM1,FSR·············
· BANK $00·····················
· MOV FSR,#QUE+0··············· 'I think the problem is here
· MOV __PARAM2,IND·············
· MOV FSR,__PARAM1·············
· MOV IND,__PARAM2·············
· INC FSR······················
· MOV __PARAM1,FSR·············
· BANK $00·····················
· MOV FSR,#QUE+15·······'and here too·······
· MOV __PARAM2,IND·············
· MOV FSR,__PARAM1·············
· MOV IND,__PARAM2·············
· BANK $00
· RETP·························· ;endsub
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
What I think IS a problem, however, is using edge triggered interrupts with the serial stuff; sure one might logically assume that the very short interrupt wouldn't bother the serial stuff but why take a change; I'd use ISR-driven serial and poll the inputs as required during the ISR.
why the compiler produce an ASM code·for PUT different (inside my program) than outside it?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
THANK YOU !!!
The problem is a bug in the compiler.
In the "PUT temp, que(0) to que(15)" is that the word "to" must be in upper case to compile correctly.
I will fix this ASAP. In short the compiler evaluates the "to" as a comma. Changing "to" to "TO" will generate the correct code.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·
This issue has been fixed.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There is a fine line between arrogance and confidence. Make sure you don't cross it...
·
Dear JonnyMac, you owe me one (just kidding)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔