Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: nikitouzz on February 25, 2013, 01:42:56 pm
-
Hi in one programme in axe, i want wrtie this line :X-9??sub(XXX,r1,r2,r3,r4,r5,r6) when XXX is a routine in other programme compiled by the axe.
(I can't fusion the 2 programme)
-
And the question is ? <_<
-
sorry, "how to make this ?"
-
There are two ways : a simple way that actually works, and a very hard one I just thought about so I'm not sure if it works.
Simple way : follow the tutorial about my PageSwap axiom in the "Tutorials" sub-forum of Omnimaga. Yeah, I said "the easy way" ;D
And the very hard and experimental way : in the program where you define the function you want to use, follow these steps :- Create an appvar that will hold an address (one address for each function you want to use)
- Put in this appvar the addresses of each function (use the LLABEL function to have the address of a label) minus E9D93.
Then, run the program once, so the appvar holding the addresses is created.
Back to your original program, follow these steps :- Access to the apppvar at the beginning of the program
- Access to the program containing the functions you want to use
- To call a function, add the corresponding address holded by the appvar to the origin of the program holding the functions, and call the resulting address. It *should* work ;D
Here's a quick example of the last method :
:.HOLDFUNC
:
:GetCalc("appvADDR",2)->A
:LFunc1-E9D93->{A}r
:.other code
:
:Return
:Lbl Func1
:...
:End
:.USEFUNC
:Return!If GetCalc("appvADDR")->A
:Return!If GetCalc("prgmHOLDADDR")->B
:
:({{A}r+B}r)(parameters)
I'm absolutely not sure about it working or not, I thought I got mad or something. If it actually works, I'll write a tutorial about it ;D
And please other members that are reading this thing (if any), please explain your opinions, I'll need them and it'll also help Nikitouzz :P
-
O_o thanks there no exist one simple methode ?
-
Nope, as far as I know there are only these two methods (only one involving programs and not apps). But maybe I'm wrong, so you'd better point thepenguin77 or Runer112 to this topic.
-
If your main prog is an app, then there is a small hex code that can run programs directly. ;) http://ourl.ca/8800
It's pretty simple to set up, but ONLY works from an app. Your target prog can be an appvar, though.
-
i know but i can't use the app for the moment.
-
Why ?
-
Because I want put 1000/2000 bit into one programme for the routines and i don't make one app for 2000 bit max...
-
The link I posted was for the app to be the main program.
Also, you can "relocate" your code : copy the routine to a free RAM area (L1-L6) and then do (Lx)(args). Of course, they're limited in size but hey !, why won't we try it ? :P
-
sorry but i need one programme ^^
-
Use the method I said so. Even if it's a PITA, I can't think of any other solution :P
-
Why can't the two programs be combined? Unfortunately the OS doesn't really allow for programs to call routines in other programs, so there is no simple way to do it.
-
because i need 10-11 routine for X programme Xe[15,+oo[ and if i combin all the programm it's too large...
-
I repeat that there are no other options that the two I told you some posts ago -_-