*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
/* Push ACC first, as when restoring the context it must be restored
* last (it is used to set the IE register). */
push ACC
/* Push ACC first, as when restoring the context it must be restored
* last (it is used to set the IE register). */
push ACC
ao_cur_task->stack_count = stack_len;
stack_ptr = (uint8_t __data *) AO_STACK_START;
save_ptr = (uint8_t __xdata *) ao_cur_task->stack;
ao_cur_task->stack_count = stack_len;
stack_ptr = (uint8_t __data *) AO_STACK_START;
save_ptr = (uint8_t __xdata *) ao_cur_task->stack;
/* Find a task to run. If there isn't any runnable task,
* this loop will run forever, which is just fine
/* Find a task to run. If there isn't any runnable task,
* this loop will run forever, which is just fine
stack_ptr = (uint8_t __data *) AO_STACK_START;
save_ptr = (uint8_t __xdata *) ao_cur_task->stack;
while (stack_len--)
*stack_ptr++ = *save_ptr++;
stack_ptr = (uint8_t __data *) AO_STACK_START;
save_ptr = (uint8_t __xdata *) ao_cur_task->stack;
while (stack_len--)
*stack_ptr++ = *save_ptr++;