Re: [cc65] branch inside .repeat?

From: thefox xofeht <thefox1aspekt.fi>
Date: 2012-10-22 21:29:08
On Mon, Oct 22, 2012 at 10:15 PM, Stefan Wessels <swessels@email.com> wrote:
> I can't see anything in the documentation about having a branch inside a repeat block. I did try a .local to no avail.  > Is it possible to do something like this?

There are several ways to solve this. I'll give you a couple of
solutions, there are probably more.

1) Put an anonymous scope inside the .repeat block:

.repeat 10, i
  .scope
    bcc label
    label:
  .endscope
.endrepeat

2) Generate the label dynamically based on i:

.repeat 10, i
  bcc .ident( .sprintf( "label_%d", i ) )
  .ident( .sprintf( "label_%d", i ) ):
.endrepeat

-thefox
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Oct 22 21:29:20 2012

This archive was generated by hypermail 2.1.8 : 2012-10-22 21:29:23 CEST