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 10:00
Modified:
  03/21/05 10:07

Read: times


 
#90090 - To Mehdi
Responding to: ???'s previous message
hi,

Mehdi said:
If you put stack after defined Bytes
Ex:
dyta equ 48h
stack equ 49h
then you can't use upper bytes comfortably?


Hmm, caanot understand what you asked about exactly, but what I wish to say:
All these
var1 EQU xx
var2 EQU xx
etc
are not good idea. Manual absolute definitions and memory allocations make programming hard - you have control addresses, overrun cases, sanity check etc. When you add a new variable, you must check other definitions, change all EQUs above this address et cetera.
Good assemblers, like Keil, allow us dynamical method for locate data segments. You are free of thinks about where and what is placed. You just ask assembler to locate variables in desired memory type (data, xdata, bdata, idata and so on). Then assembler locates them all itself, checks for overrun cases and memory borders, puts stack at the top of all idata variables (with ?STACK segment). And even you modify your code and add new variables then you may not even think how rest variables change thier locations and where stack is placed in.
Summary: I suggest to drop EQU for memory allocations if your assembler has a feature like I described above. Trust me, this makes programming easy very well.

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