| ??? 04/20/02 20:21 Read: times |
#21975 - RE: pros and cons of using an OS |
Why do you need scheduling ? Make a "work loop" call every task one after another and make all tasks - as a first - determine if they have anything to do and, if not, return immediately. If priority is required start the loop with the highest priority and make all tasks return to the top of the loop after processing if they went active. If time slicing/priority is it, have a loop counter this is an example adherence to assembly not attempted.
Counter = 0; WorkLoop: mov a,counter cjne a,#8,NotReset counter = 0 call prt 1 call prt 1 cjne counter,#2,NotTwo call prt 2 call prt 2 NotTwo: cjne counter,#4,NotFour call prt 2 call prt 2 call Prt3 call Prt3 NotFout: cjne counter,#6,WorkLoop call prt 2 call prt 2 jmp WorkLoop Erik |



