On 6/8/2014 11:32 AM, Charles Kerr wrote: > I have been trying how to find a way to do a relative branch (from the > current instruction pointer) for a branch.
You can read the program counter into a register, add an offset, and then use a plain jump (to the register contents), but the quick-branch instructions are already relative. > I have something like this: > > .macro SETBIT > .mparam reg,bit,lab,lab2 > QBBC lab, BYTE_VALUE,bit > SET r30, 14 > QBA lab2 > lab: > CLR r30,14 > lab2: > > What I would like to do is on the first QBBC, provide a relative label (so > I don't have to pass a unique name to the macro. The same for QBA lab2. > > On a PIC one can do a $+#, where $ is the current instruction pointer, and > the # is is the number of instructions to jump forward (or backward if > negative). Is something like this possible? I'm not sure why you don't just put the labels inside the macro, where they will be local in scope (see 5.3.3.1.1 "Defining a Macro" in the PRU Reference Guide). If that doesn't solve your problem, perhaps a bit more code would help to exhibit the particular issue you're trying to overcome. -- Charles Steinkuehler [email protected] -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
