pouët.net

Go to bottom

Anyone remembers AsmOne syntax?

category: code [glöplog]
 
So, I've been doing some coding in good-old Asmone on the Amiga 500 for the first time in years (or rather decades almost...)

Having a bit of trouble recalling the syntax of how stuff is done though, and I can't find any manual online.

Right now I'm struggling with labels inside REPT blocks. I'm not even sure if there is a solution for this:

Code: REPT 20 move.b (a0)+,d0 sub.b d1,d0 bpl skip eor.b d0,d0 skip: move.b d0,(a1)+ ENDR


As it is now, I ofcourse get 20 redifinitions of skip, and it won't compile. Using local variables won't help either, since a non-local variable is needed before it is allowed to assign it again.
Is there a way to get around this?
added on the 2013-06-22 14:01:19 by Sdw Sdw
isnt it:

bpl skip\@:
...
skip\@:


this is from memory, so I might be wrong. If all else fails, you can fall back to bpl *+n
added on the 2013-06-22 15:42:01 by xeron xeron
Also, I recomment the ada forums for amiga democoding help :)
added on the 2013-06-22 15:44:17 by xeron xeron
Thanks xeron!
Unfortunately the label\@ syntax didn't work either.
The *+ would work if I knew how many bytes instructions take, but it seems a bit more complicated with the many modes etc. on the 68000 compared to 6502 or Z80 that I'm more accustomed to!

I will give the ADA forums a try, but from what I see the forums doesn't see much activity there... :/
added on the 2013-06-22 20:22:49 by Sdw Sdw
there arent a lot of posts, but plenty of coders do visit regularly and respond.
added on the 2013-06-22 20:55:24 by xeron xeron
.skip ?
added on the 2013-06-22 22:07:02 by maytz maytz
Xeron was right, but it works for macros only. So wrap it into a macro and rept that.

Code: Snip Macro move.b (a0)+,d0 sub.b d1,d0 bpl \@skip eor.b d0,d0 \@skip: move.b d0,(a1)+ Endm REPT 20 Snip ENDR
added on the 2013-06-22 22:08:22 by noname noname
Thanks noname, that did the trick!
added on the 2013-06-23 00:44:23 by Sdw Sdw
Quote:

The *+ would work if I knew how many bytes instructions take


Since you're using AsmOne it is quite easy to get the size of a certain instruction, let AsmOne calculate it. Just create a label (f.e. start), add your instruction(s) and create a 2nd label (f.e. end), then assemble and in AsmOne's command line enter ?end-start and AsmOne will print the size of the code between the 2 labels.

In other news, use moveq #0,d0 instead of eor.b d0,d0. :)
added on the 2013-06-23 22:34:57 by StingRay StingRay

or without branch at all:

Code: REPT 20 move.b (a0)+,d0 sub.b d1,d0 sne d2 and.b d2,d0 move.b d0,(a1)+ ENDR


added on the 2013-06-24 16:53:03 by lsl lsl
damn.. layout totally fucked up...
added on the 2013-06-24 16:53:45 by lsl lsl

login

Go to top