Saturday, January 12, 2008

Re: [oopic] Subroutine addressing

m.lisowski wrote:
> Can anyone explain how to find a subroutine address for branching
> using SCP? All the old posts are outdated with V6 of the compiler...
>
>
> --
> Mike
>
>
Mike

To find the address of a subroutine, display the compiled code listing
by pressing Crtl - F4.
Search the code for the name of the subroutine where the line begins with:

L[number].Proc.Begin ;This.[sub name]

the first line which is prefixed with a C beneath this text is the
address of the subroutine.

A typical example of the address line would be:

C0103:000 ; 0

The address in this case is 103

The SCP code to branch to this sub would be \0103JY or \[node]103JY

Be aware that any changes to your Oopic code above the sub routine in
question will result in the address changing.
For this reason I have found it best to place the subs I wish to branch
to under the object declarations and above the Main sub.

Here is a simple program with a subroutine called Flash1 which can be
branched to at address 63
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Test_Word As oWord
Dim Pot_1 As oA2D10(1,1)
Dim Bus1 As oBus
Dim Led As oDIO1(24,0)
Dim i As Byte

Sub Flash1()
For i = 0 To 11
Led = Not Led
Delay = 100
Next i

End Sub


Sub Main()

Call Setup

End Sub

Sub Setup()

Bus1.Input.Link(Pot_1)
Bus1.Output.Link(Test_Word)
Bus1.Operate= 1


End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Hope this helps

Ian


Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

No comments:

Post a Comment