Login
Back to forumSee the full topicGo to last reply

Posted By

Csabo
on 2020-12-22
14:14:21
 Re: Optimize assembly function-call from BASIC

The GOSUB/RETURN slows down the code a lot and it's unnecessary. The more numbers there are in the POKEs, the slower the execution. You'd be best off using 4 zeropage variables that BASIC doesn't mind, e.g. $58-$5B (but don't quote me on those exact addresses). Your code then becomes POKE88,x1:POKE89,y1... etc.

But probably the best solution is to have the ML code load the values of those variables straight from where they are in the memory. Change x1 to something like "A%", so that the values will be stored as 16 bit numbers, and this way there would be no need for POKEs at all.



Back to top


Copyright © Plus/4 World Team, 2001-2024