Request for help: variable related flow control issues, odd compile errors
CarlC
Posts: 29
I'm having a problem where named variables are apparently being pointed to important registers like PC or STATUS.
I think I've declared them properly with the DS directive, but I note that when I watch them in debug mode, they assume the same value as PC or STATUS reg's depending on the order that I declare my vars.
I'm stumped. It's causing me a lot of trouble as every time that I write to them, I screw up my program flow.
I also tried declaring my subroutine after my MAIN code so the subroutine code wasn't run right after INITIALIZE, but I kept getting compile errors: "Symbol <name> not declared". I don't know why this happens. My subroutine label is not indented and is not a reserved word.
Final question: What is the purpose of using the ORG directive to distribute blocks of code? I find that I have trouble assigning spaces for code and write code blocks that sometimes overlap. Why not just use labels for flow control and let the assembler assign memory for code without padding?
I think I've declared them properly with the DS directive, but I note that when I watch them in debug mode, they assume the same value as PC or STATUS reg's depending on the order that I declare my vars.
I'm stumped. It's causing me a lot of trouble as every time that I write to them, I screw up my program flow.
I also tried declaring my subroutine after my MAIN code so the subroutine code wasn't run right after INITIALIZE, but I kept getting compile errors: "Symbol <name> not declared". I don't know why this happens. My subroutine label is not indented and is not a reserved word.
Final question: What is the purpose of using the ORG directive to distribute blocks of code? I find that I have trouble assigning spaces for code and write code blocks that sometimes overlap. Why not just use labels for flow control and let the assembler assign memory for code without padding?
Comments
First cut and paste your blurtbyte subroutine between the end of the ISR and the begining of the initialization , you'll be able to compile it. Now look at the list file and you'll see where variables and program cose is. I'll look at the code later today, but first thing is first...it's gotta compile.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Bad spellers of the world untie!
· On line 221 you have "end" anything after "end" is not assembled/compiled
· I made that line a comment and it assembles/compiles fine.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
addendum to Mr. Bean:
*blllaahahahaa*....
duh, that was a dumb one. Thanks for that cuff up the head.
edit: It appears you are making some kind of GPIB interface ? Can you tell us what it is ?
I'm interested in doing GPIB myself.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
I'm still having the same problem of "buffer" being pointed to the PC.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
I forgot about that. So that's what ORG is for.
Thanks for helping out a novice. Actually, I'm supposed to be a mechanical engineer.
Thanks for your help Bean.
The SX blasts out a continuous stream of bytes which blows away my datalogger buffer in under a millisecond. Heh heh, the practical situation I'm working with doesn't do that, but it's funny to see in my test.