Patent ID: 7774763

Claim:
A method for forming a multi-tasking executable program, the method comprising: providing source code which includes a “jump to address” macro, a “breakout” macro, a main portion, and a set of task portions; compiling the source code into object code; and linking the object code into the multi-tasking executable program, the multi-tasking executable program having executable code which includes: a main section defined by the main portion of the source code; and a set of task sections defined by the set of task portions of the source code, each task section having (i) a “jump_to_address” section defined by expansion of the “jump_to_address” macro of the source code, and (ii) multiple entry points defined by multiple expansions of the “breakout” macro of the source code, and when the executable code is executed by a processor, the main section being configured to invoke each task section in a cyclical manner, and the “jump_to_address” section of each task section being configured to jump execution to one of the multiple entry points of that task section; wherein linking the object code into the multi-tasking executable program includes: generating, as the multi-tasking executable program, a single executable file containing the main section of the executable code and the set of task sections of the executable code in an integrated manner; wherein generating includes incorporating “breakout” instructions within each task section of the executable code, the “breakout” instructions (i) being defined by the multiple expansions of the “breakout” macro of the source code, and (ii) corresponding to “return” commands located ahead of entry point address labels in the “breakout” macro of the source code; wherein the breakout macro includes a unique label defined within a block local to the breakout macro; wherein linking further includes, at link-time, assigning addresses of the multiple entry points based on the unique labels within each expansion of the “breakout” macro; and wherein, when the executable code is executed by the processor, the “breakout” instructions of each task section are configured to break out of that task section and return execution to the main section.