From: Sandeep D. <sa...@dd...> - 2000-07-19 16:21:15
|
Hi Robert, Tasking Compiler has an option to use the external ram as a psuedo stack, SDCC has a similar option (--xstack) however be aware that this option is not well tested, but once we have this option working correctly I think porting an RTOS should be very difficult. The xstack pointer in SDCC is _SPX. Sandeep -----Original Message----- From: sdc...@li... [mailto:sdc...@li...]On Behalf Of Dafni & Robert Berger Sent: Tuesday, July 18, 2000 9:55 PM To: sa...@us... Cc: sdcc-user mailing list Subject: [Sdcc-user] virtual stack pointer Hi Sandeep, As you might know I am trying to port uCOS. Among other things I need to save the context of the current task when there is a task switch performed. I did this with the Tasking Compiler and in Assembly it is something like: ; Save current task context ; ; PCL, PCH have already been pushed by lcall/interrupt ; push psw push acc push b push dpl push dph ; push ar0 push ar1 push ar2 push ar3 push ar4 push ar5 push ar6 push ar7 ; ; -------------------------------- ; Save CC51 Virtual Stack Pointer ; push __SP push __SP+1 ; -------------------------------- ; push sp To push standard 8051 registers should be straight forward, but I don't know if there is and how I can push the "virtual stack pointer" in SDCC. What is a virtal stack pointer for Tasking ? For _reentrant functions, a virtual stack is used in external RAM. Automatics and parameters are all accessed using a virtual stack pointer register, allocated as a 16-bit pointer in direct addressable internal RAM (label __SP). Do I need to push anything else depending on the memory model to save the context of a task in SDCC? Just for explanation: A task switch works just like returning from an interrupt service routine, so before I need to save the context manually. regards, Robert Dafni & Robert Berger Pharmacist & Embedded Systems Engineer Stratigou Rogakou 24 15125 Polydrosso - Maroussi Athens Greece Tel, Fax.: ++30 1 6847881 email: da...@ho... http://users.hol.gr/~dafniz/ _______________________________________________ Sdcc-user mailing list Sdc...@li... http://lists.sourceforge.net/mailman/listinfo/sdcc-user |