Shop OBEX P1 Docs P2 Docs Learn Events
arrays in Assembly? — Parallax Forums

arrays in Assembly?

mike56mike56 Posts: 22
edited 2009-08-15 12:17 in Propeller 1
How do I fill an array in Cog memory using a loop in Parallax Assembly?

If I wanted to read from main memory, I could pass cognew(@myfunc,@myarray)

······· ·mov myarrayptr,par
········ mov Counter, #50
loop·· wrlong myarrayptr, mystuff
········ add myarrayptr,#1
········ djnz Counter,#loop

But in Cog memory, I can only move into a register not an address.

Basically, I want to do:
······· mov arrayptr,#myarray
······· mov Counter,#50
loop·· mov @arrayptr, mystuff
········add arrayptr,#1
······· djnz Counter,#loop

How do I do the "mov @arrayptr,mystuff" in assembly?

Comments

Sign In or Register to comment.