A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / AsmOne label syntax

 

Author Message
sdw
Member
#1 - Posted: 22 Jun 2013 20:25
Reply Quote
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:


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?
skp
Member
#2 - Posted: 22 Jun 2013 22:12 - Edited
Reply Quote
Hey sdw, try the following thing: move your inner REPT code in a macro and change the label skip by skip\@ then in your REPT simply call the macro...
sdw
Member
#3 - Posted: 23 Jun 2013 00:44
Reply Quote
Ah yes, thank you, that worked fine!
Raylight
Member
#4 - Posted: 23 Jun 2013 13:40 - Edited
Reply Quote
sdw:
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...)

Glad to hear! :-)

...just a optimization thought... If you want to work with bytes and have a register to spare, perhaps this would be slightly faster?

                       ; >=0       <0
;
sub.b d1,d0 ; 4 4
spl d2 ; 6 4
and.b d2,d0 ; 4 4
; 14(3/0) 12(3/0)


..compared to:

      sub.b   d1,d0    ;  4        4
bpl .skip ; 10 8
eor.b d0,d0 ; - 4
.skip ; 14(3/0) 16(3/0)


I haven't coded A500 for ages so I might very well be missing something here, but if not it should save 4 cycles in the "underflow" case. :-)

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0