Shop OBEX P1 Docs P2 Docs Learn Events
Assembly confusion — Parallax Forums

Assembly confusion

KenBashKenBash Posts: 68
edited 2007-02-19 12:38 in Propeller 1
I'm converting an old SX assembly language function into propeller code and I'm having some difficulty understanding· access of Main memory from assembly language.

· I've· written a simple test function to see if I can·modify·a main memory value:
·Passing the value location·to the assembly language routien, modifying it, then·putting
·the mofified value·back into main memory:

move
················· ·mov· mem, PAR
················· ·mov xat , #1
···············
·················· ·wrlong xat, mem
················· · call #pauseit
··················· ret
··
Pauseit····································· ' wait a moment for sync.
······················ nop················
Pauseit_ret······· Ret

I know it modifies the value because I get a change after·I run the assembly function.·

When I print the value·using text.dec· I get the value 1 printed on the screen with an additional bunch of "Garbage" on the screen.·· I've searched for an assembly language tutorial for the propeller but haven't been able to find the right thing.


I would like to:···· 1. · read a value from main memory.
························ 2.· incriment ( or anything ) this value
························ 3.· write it back to main memory so that it displays correctly
····························· using the text.dec· function.·

I'm also a bit fuzzy on·why a 32 bit processor is limited to a $1ff value in assembly language.·


I've got some great code running in Spin, but I want to compact·it·and speed up some motion control functions.

Can someone point me in the right direction for getting up to speed in·Propeller assembly?
I'd like to understand the register structure and such if the information is available in some organized form.


Thanks.

Ken Bash
···

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
" Anything worth doing... is worth overdoing. "

··············································· ( R.A.H. )
····································

Comments

  • KenBashKenBash Posts: 68
    edited 2007-02-18 19:00
    I won't say "Never mind" because there might be someone else out here looking for the same information with the same level of confusion.

    Often just the act of admitting your ignorance in front of "God and Everybody" sparks that next level of motivation that gets you where you need to go.

    Bean's link:

    http://forums.parallax.com/forums/attach.aspx?a=5975

    Is what I needed to get the assembly ball rolling.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    " Anything worth doing... is worth overdoing. "

    ··············································· ( R.A.H. )
    ····································
  • BTXBTX Posts: 674
    edited 2007-02-18 19:25
    Sorry try with some like this...

    ···· mov········ mem,par
    ···· add·········mem,#4
    ···· wrdlong··· xat,mem
    ···· add·········xat,#1




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.

    Envio editado por (BTX) : 2/18/2007 7:31:39 PM GMT
  • JamesxJamesx Posts: 132
    edited 2007-02-19 12:38
    Ken:

    This matter of passing parameters between Spin, ASM, and back and forth between cogs is actually a test. A test of how many things you can keep in your head at one time. I'm told most people can keep about 5 things consciously in their thoughts simultaneously. For me it's about one or two. My guess is that the guys that created this parameter passing method can handle 8 things at once.

    If you're limited like me, check out the second half of the sticky thread http://forums.parallax.com/forums/default.aspx?f=25&m=141093, and the big PDF in the "Propeller Tricks and Traps" sticky thread http://forums.parallax.com/forums/default.aspx?f=25&m=114128&p=1 This may shed some light on the subject.

    Jim C
Sign In or Register to comment.