From: | Roger Beausoleil |
Date: | 25 Nov 95 at 13:03:35 |
Subject: | Re: Indirect Gosub |
On 12-Aug-99, Tony Rolfe wrote:
>On Sat, 25 Nov 1995 17:22:07 +0500 Roger Beausoleil said:
>> Hi Tony,
>>
>> You should write something like this following with the help of the
>Asm
>> to Use the Indirect Gosub:
>>
>> WbToScreen 0
>> Window 0,0,0,320,200,$140F,"",1,0
>>
>> SubCallRoutine.l = ?Routine_1
>>
>> Main:
>> Movem.l D0-D7/A0-A6,-(a7)
>> GetReg A0, SubCallRoutine
>> JSR (A0)
>> Movem.l (A7)+, D0-D7/A0-A6
>>
>> if SubCallRoutine <> 0
>> Bra Main
>> Endif
>>
>> Mousewait
>> end
>Yes, Roger that worked perfectly.
>Two things I don't understand
Hi Tony,
>1. In this text you saved and restored registers, but in the example
>you did not. The example code works fine (as far as I can tell).
>Is it really OK to not save the registers?
A. Saving the registers is the best and safety way, at least for register a3
to a6, because Blitz use thoses registers for its own applications... and it
is safe too for your own.
>2. The Blitz reference manual says the you should only use GetReg
>with data registers. Is this another case of the manual getting it
>wrong or is a0 a special case?
B. The Blitz manual got somes mistakes as you should already know... you can
use GetReg/PutReg for every registers.
>Thanks again for your help
>--
>Tony Rolfe
>Amiga 2000, 68030/25, 1+4Mb
>www.shoalhaven.net.au/edgewater
>---------------------------------------------------------------------
>To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
>For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie