Shop OBEX P1 Docs P2 Docs Learn Events
Destination indexing question — Parallax Forums

Destination indexing question

User NameUser Name Posts: 1,451
edited 2011-06-02 22:37 in Propeller 1
When using self-modifying code to store an array of longs, is this the customary way to increment ddddddddd?
	...
label	mov	0-0, data
	add	label, dest_inc
	...
	...
dest_inc	long	%10_0000_0000

Or is there some super slick way that I don't know about? The manual seems rather mute on the entire topic.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-06-02 20:35
    No, you've got it right.

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2011-06-02 20:43
    There is a gotcha, that if you self modify immediately before the label your modifying it won't work the way you might think... basically you need an additional instruction to separate the self-modification from the label being modified or else it won't propagate until the next iteration.
  • User NameUser Name Posts: 1,451
    edited 2011-06-02 20:46
    Thanks, Phil!
    There is a gotcha, that if you self modify immediately before the label your modifying it won't work the way you might think... basically you need an additional instruction to separate the self-modification from the label being modified or else it won't propagate until the next iteration.

    Right. In this case my intent was to increment the destination in anticipation of the next use of the indexed move.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-06-02 22:37
    You can also define
    dest_inc    long     1<<9
    
Sign In or Register to comment.