programming advice
thegoat001
Posts: 4
So I have about 1.5KB of code for my bs2sx and while I'm not really concerned about speed...I'm using two program slots, can anyone tell me if the bs2 would execute faster if I split the code 50/50 in slot 0 and 1? I'd imagine it takes time for the stamp to move from slot 0 to 1, but if not, would it be better to go ahead and use all 8 program slots and divide the code up equally? Currently I have 70% of the code in slot 0 and 30% in slot 1. It should be noted that the program runs all the way through slot 0 before running all the way through slot 1 and does not jump back and forth to specific parts of the code.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Besides, isn't 300 uSec like 10 times the normal 30 uSec execution time of a "GOSUB" or something?
I stand by my "it will run slower if you make lots of "RUN" calls"
I agree that crossing slots will take more time. Marginally slower in the aggregate when there is only an occasional slot switch.
It takes the BS2sx about 100 microseconds to execute a GOTO and longer for a GOSUB. A simple command like HIGH 0 takes about 55 microseconds on the BS2sx. The 300 us for RUN does not account for any additional branching within the new slot. Simply:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com