Shop OBEX P1 Docs P2 Docs Learn Events
Longmove question — Parallax Forums

Longmove question

bambinobambino Posts: 789
edited 2009-01-23 17:50 in Propeller 1
I have a routine in assembly that fills a 2000 long section of ram with data. it works fine as long as the routine is in the same object the array is declared in!· I want to now move the routine to an object, but keep the array in the top object.
Is this still possible using longmove? Or does the operation just create another array in the new object!
What I am dreaming is that passing the address of the start of the array to the new object, and then putting this in par to the assembly routine, will allow my code to continue as normal and write to the array in the top object.

Thanks!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-23 15:46
    LONGMOVE copies data from one location in memory to another. It sounds like that's not what you want to do.

    It sounds like you want to have the array in one object, but have the code to fill it in another object. In that case, you want to pass the address of the array to the routine that will fill it with data. In that routine, you'll use LONG[noparse][[/noparse] ... ] to access the locations while you're filling them. If you pass the base address as BASE, you'd set a location with LONG[noparse][[/noparse] BASE + i ] or some variation on that.
  • bambinobambino Posts: 789
    edited 2009-01-23 15:54
    Thanks Mike,

    Once I get the base to the other object, is their anything different I would need to do in the assembly code?
  • bambinobambino Posts: 789
    edited 2009-01-23 15:56
    Sorry,
    My assembly routine takes just the start address in par, and increments from there to fill the array!
  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-23 16:58
    No, nothing special. Just pass the base address in PAR.
  • bambinobambino Posts: 789
    edited 2009-01-23 17:50
    Great,
    Thanks again, and have a nice weekend!
Sign In or Register to comment.