Always Include the PROGRAM Directive in Your Code
I have just started using the SXB today and I am very impressed. I have, however, come across a possible bug. This may be old hat to a lot of you, but this is what I came up with this evening:
>When declaring a subroutine using the...you guessed it the SUB syntax. The code jumps to the subroutine immediately following declaration. I am forced to declare the subroutine before I use it in the code, so its a catch 22. The fix for me was to insert a jmp statement to the main routine
\ JMP main ;<
The "fix"
TXBYTE SUB 1
main:
code and stuff
TXBYTE result
goto main
TXBYTE:
temp1 = __PARAM1 ' save byte to send
SEROUT RB.3, T115200, temp1 ' send the byte
RETURN
I followed the examples given in the help files. That is I declared the SUB just prior to the main and the actual subroutine was located below the main routine (past the goto main).
I am new to this and would really like to know if there are any other bugs floating around in the SXB. I think Parallax is awsome for releasing this great software.
JT
Post Edited (Miner_with_a_PIC) : 6/20/2005 7:52:31 AM GMT
>When declaring a subroutine using the...you guessed it the SUB syntax. The code jumps to the subroutine immediately following declaration. I am forced to declare the subroutine before I use it in the code, so its a catch 22. The fix for me was to insert a jmp statement to the main routine
\ JMP main ;<
The "fix"
TXBYTE SUB 1
main:
code and stuff
TXBYTE result
goto main
TXBYTE:
temp1 = __PARAM1 ' save byte to send
SEROUT RB.3, T115200, temp1 ' send the byte
RETURN
I followed the examples given in the help files. That is I declared the SUB just prior to the main and the actual subroutine was located below the main routine (past the goto main).
I am new to this and would really like to know if there are any other bugs floating around in the SXB. I think Parallax is awsome for releasing this great software.
JT
Post Edited (Miner_with_a_PIC) : 6/20/2005 7:52:31 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
JT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax