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

Back to Subject List

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


 
#94283 - here is not PC
Responding to: ???'s previous message
hi,

Spencer Lee said:
What does the below mean?
mydata segment data
Reg mydata

What are the advantage of declaring a segment of memory in a small 2k assembly program?


You have not specified the IDE you work with so maybe my answer will be related to Keil mostly.

It seems you have been confused with segment meaning. Indeed, on PC there is term "memory segment". Due historical reasons (16-bit addresses) such segments are used for expanding of memory with segment registers CS/DS/SS/ES.
But for MCU the meaning is different. Here, segment is part of modular program development process. Segments helps to structurize program and its data, make debugging easy etc.
Generally, the usage of segments is not depended on how small or big a program is. Even if you have declared no one segment, anyway assembler assumes at least one default segment.

Now the answer about what is this
     mydata segment  data
         Reg mydata
First of all, I think it must be RSEG, not "Reg". Always do copy-paste when public code, please.
Here the DATA memory segment is declared. Then in the program some bytes of this type of memory are reserved (at lines DS xx).
Hope it helps.

By the way, for memory expanding, Keil uses term "banking".

Regards,
Oleg

List of 6 messages in thread
TopicAuthorDate
Understanding Code Segments Vs Org            01/01/70 00:00      
   What Assembler?            01/01/70 00:00      
      what assembler            01/01/70 00:00      
   here is not PC            01/01/70 00:00      
      [OT] - x86 Segments            01/01/70 00:00      
      here is not PC            01/01/70 00:00      

Back to Subject List