In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote: @Bean, To use TASKS RUN, the following setup is required: [code] '************************************************************************************************* 'Device Settings '************************************************************************************************* device SX28,OSCHS2 freq 20_000_000 id "TaskTest" stack 16 '************************************************************************************************* 'CON Section '************************************************************************************************* '************************************************************************************************* 'I/O Pins '************************************************************************************************* '************************************************************************************************* 'VAR section '************************************************************************************************* '************************************************************************************************* 'Interrupt Entry ($000) '************************************************************************************************* INTERRUPT nocode 115200 TASKS RUN,4 goto IsrStart '************************************************************************************************* 'Application Sub/Func/Task Declarations '************************************************************************************************* myTask TASK '************************************************************************************************* 'Reset Entry (page 0) '************************************************************************************************* PROGRAM Start '************************************************************************************************* 'Application Code '************************************************************************************************* Start: ' ------------------------------------------------------------------------------------------------ ' Initialization ' ------------------------------------------------------------------------------------------------ TASKS SET,0,myTask,10 'use taskslot 0 for myTask TASKS ENABLE MainLoop: ' ------------------------------------------------------------------------------------------------ ' Mainloop ' ------------------------------------------------------------------------------------------------ goto MainLoop '************************************************************************************************* 'Application Sub/Func/Task Code '************************************************************************************************* TASK myTask ENDTASK '************************************************************************************************* 'Interrupt Code (starts at last codepage) '************************************************************************************************* '{$ifdef SX18} ADDRESS $600 '{$endif} '{$ifdef SX20} ADDRESS $600 '{$endif} '{$ifdef SX28} ADDRESS $600 '{$endif} '{$ifdef SX48} ADDRESS $E00 '{$endif} '{$ifdef SX52} ADDRESS $E00 '{$endif} IsrStart: 'target address for GOTO in INTERRUPT returnint '************************************************************************************************* 'Application Data '************************************************************************************************* 'end of file [/code]TASKS RUN must be given prior to TASKS SET or there are compilation errors. I'd like to jump to the interrupt code leaving the largest amount of space for the SUB jumptable. Unfortunately, I cannot place TASKS RUN at IsrStart. My proposal is to leave TASKS RUN at the current position (after INTERRUPT keyword), but to place the code generated by TASKS RUN, when RETURNINT is encountered. That saves valuable codespace for the SUB jumptable (which also holds entries for TASK routines). I don't see any problems it would give for the code, other than that you must suspend some output until RETURNINT is encountered. regards peter ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=369104 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)