Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
How do I use them? And why does Merth say they are bad?

(for brass)

jr z,{+}
;more code

djnz {-}

You use +'s and -'s, +'s when you'll be jumping forwards, and -'s when you'll be jumping back. If you need something more complicated, you can use ++, --, +++, ---, and so on, not just + and -.
Be aware that you have to enclose the label name in curly brackets when referencing it (as above)
There's also @, which you always use only one of, but you use it like {@}, {-1@}, or {4@}, with indices.
Merth'll have to say why he thinks they're bad Very Happy
I find them far too confusing. Brass, my assembler of choice, allows arbitrary label length, which works for me; I just create descriptive names for all of my labels. It makes my life so much easier when I need to look back at my code months or years hence, most recently in my work on Doors CS in creating DCS7.
That's my main issue with them. It's far better to have actual descriptive labels than to just have pluses and minuses all over the place.
merthsoft wrote:
That's my main issue with them. It's far better to have actual descriptive labels than to just have pluses and minuses all over the place.
Most heartily agreed. It's quite a shame that tanner is continuing to ignore our wisdom and experience and using local labels anyway, though. Sad
>.< I've only used one... And all it stood for was "cont."

Edit: And now it is gone

I also found that $+X are fun to use Razz For things like jumping over 1 byte instructions, or SMC. Just thought I'd bump to see what other's views on $+X are Smile
I don't have as big a problem with this, but I still strongly discourage it. Iambian uses this everywhere in Celtic III, and when I modify the instructions in the shadow of the jump, I have to edit (all the) jumps. Please just use labels.
(bah, beaten to the post by Kerm)

That's more being ultra-lazy when you don't want to define any sort of label. I'll use it occasionally when hacking up some SMC or for very short loops, but it's very easy to let it introduce insidious bugs.

I had some nasty/clever example of using local labels inside macros to enforce odd lookup-table things, but I can't find it right now..
I use it for things like: http://www.cemetech.net/forum/viewtopic.php?p=129385#129385 . Kerm, does Iambian use it for large jumps? Or is it small jumps like what I linked to? And I typically use Loop: for any kind of short loop. I hadn't thought of using jr $+X for macros before... I might have to see what I can do Razz
For short jumps, but I still end up editing little bits and forgetting to change them. I can understand them for macros; for anything else, I must punch you. Wink Tari++
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum