Re: A89: recursion question


[Prev][Next][Index][Thread]

Re: A89: recursion question





>here's how i think it goes with my current knowledge of asm:
>in _main: we move 1 to d0. then the value of d0 to stuff and stuff2. we jump
>to main_stuff_tests. we compare d0 with stuff.  it checks out so we jump to
>yes_stuff. there, we add 1 to stuff and jump back.  
  Here is it false, in fact you jump back to the rts in main
This is because Bcc instruction don't save a return adress before jumping.

_main:
>move.w      #1,d0
>move.w      d0,stuff
>move.w      d0,stuff2
>bsr            main_stuff_tests
You jump back HERE
>rts



Xavier VASSOR
---The Doors Team
E-mail:xvassor@mail.dotcom.fr
Doors Homepage: http://www.altern.org/doors
ICQ:10241721


Follow-Ups: References: