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:
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?
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?
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
bpl skip\@:
...
skip\@:
this is from memory, so I might be wrong. If all else fails, you can fall back to bpl *+n
Also, I recomment the ada forums for amiga democoding help :)
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... :/
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... :/
there arent a lot of posts, but plenty of coders do visit regularly and respond.
.skip ?
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
Thanks noname, that did the trick!
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. :)
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
damn.. layout totally fucked up...