Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/21/05 06:59
Read: times


 
#90077 - why?
Responding to: ???'s previous message
hi,

Payam Soltany said:
We may initialize SP to 1FH or more preferably 2FH (Especially when 20H..2FH is needed for bit banging).
...when we needn't have more than some 128 bytes of internal RAM, it's a good practice to initialize SP to 7FH as suggested by Intel and thus "get rid of" indirectly addressing internal RAM(Upper 128), meanwhile freeing the lower 128 as an "easier" way of RAMing. What do you think?


I do not know which IDE/compiler you use, but the general suggestion is: leave this task for compiler and linker/locator. For example, in Keil assembler just do:
; allocate idata memory for stack area
?STACK		SEGMENT IDATA
		RSEG	?STACK
STACK:		DS	1

; load stack pointer
	MOV	SP,#(STACK-1)
That`s all. The idea is that Keil recognizes ?STACK segment name and places it at the end of all idata segments. As result, you always have all free idata memory used for stack area.
I hope other compilers have way like it above.

Regards,
Oleg

List of 21 messages in thread
TopicAuthorDate
initializing SP to 7FH            01/01/70 00:00      
   why?            01/01/70 00:00      
      To Oleg & Russell            01/01/70 00:00      
         To Mehdi            01/01/70 00:00      
         To Mehdi            01/01/70 00:00      
            why not            01/01/70 00:00      
               for example, please            01/01/70 00:00      
                  Oleg, why I do similar            01/01/70 00:00      
                  here they are            01/01/70 00:00      
                     well            01/01/70 00:00      
                        well well            01/01/70 00:00      
                           well, well - done            01/01/70 00:00      
                     tight SRAM - use C            01/01/70 00:00      
                        - or assembler            01/01/70 00:00      
   Stack pointer            01/01/70 00:00      
   external stack            01/01/70 00:00      
      why not?            01/01/70 00:00      
         SDCC            01/01/70 00:00      
   Re:initializing SP to 7FH            01/01/70 00:00      
   very old assemblers only            01/01/70 00:00      
      Let the assembler do the work!            01/01/70 00:00      

Back to Subject List