Assembly help
Zap-o
Posts: 452
Assembly, hum! - Learned it in college, but have not used it since then. Propeller has a type of assembly and before I ask please note that I have read all the material that I could find on this topic. My questions are:
Say I want to make part of this in assembly.
I want to know if I can use Assembly and other objects interchangeably. In the example I provided how would I attack the If statement in assembly and yet jump back in to spin and send the string "OK". I hope this makes since.
Maybe some one can kick start my exploration in assembly.
Say I want to make part of this in assembly.
Obj Serial : "FullDuplexSerial" Pub Start REPEAT If (serial.rxcheck == $30) serial.str(string("OK"))
I want to know if I can use Assembly and other objects interchangeably. In the example I provided how would I attack the If statement in assembly and yet jump back in to spin and send the string "OK". I hope this makes since.
Maybe some one can kick start my exploration in assembly.
Comments
If you want to execute assembly, it has to be copied into its own cog and executed on its own. It takes over 100us to copy an assembly program to a cog for execution no matter how big or small the program is, so it's mostly impractical to try and mix Spin and assembly. One of the forum members has been experimenting with special versions of the Spin interpreter that have a small area for copying small subroutines from hub memory to cog memory and executing them. In order to do this, some of the normal, but infrequently used Spin interpreter routines have been moved to hub memory where they are treated as overlays for this small area and the user can also have overlays. It takes a little time to copy these overlays from hub to cog memory, but less time than it takes to fill up the whole cog.
MagIO2, and I just got through (well not really totally done) on some assembly that deals with the problem you ask, so I'll take the part of the question Mike didn't address.
PASM (or Propeller Assembly) has a compare command "cmp". You can compare any two numbers and set "flags" if the numbers match. With the flag(s), you can decide what to do next.
I found learning to get the information in and out of assembly confusing, but there are members here who can help straighten you out on the details. I was real reluctant to learn PASM, but I find it is pretty easy to write the code itself. I actually find PASM to be easier than Spin, although it does take more commands (typically) to do the same task. It does take a little different method of thought with PASM.
I'm not sure about others, but I find writing everything in PASM to be somewhat of beyond necessary. I think I/O and some communication is needed in PASM, but I don't ever see myself writing any project in total PASM.
I don't know if I helped or not, but keep kicking it around. You will eventually program in PASM. I waited as long as possible, and came to a point it was necessary. I should have started way before I did.
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services