View Full Version : Longmove question

01-23-2009, 09:53 PM
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.


Mike Green
01-23-2009, 10:46 PM
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[ ... ] to access the locations while you're filling them. If you pass the base address as BASE, you'd set a location with LONG[ BASE + i ] or some variation on that.

01-23-2009, 10:54 PM
Thanks Mike,

Once I get the base to the other object, is their anything different I would need to do in the assembly code?

01-23-2009, 10:56 PM
My assembly routine takes just the start address in par, and increments from there to fill the array!

Mike Green
01-23-2009, 11:58 PM
No, nothing special. Just pass the base address in PAR.

01-24-2009, 12:50 AM
Thanks again, and have a nice weekend!