We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Microcontroler AT 89S8253 is equiped with 2K on chip EEPROM. This is mapped to X data space. There is feature Page Mode Write, having possibilities to write 32 byte segment in one cycle. Can I force compiller to define variables in this space inside 32Bytes segments? It means to block compiler put long variables over border. For example one byte of INT at 0x1F and second at 0x20. How to block it. Best regard Jaro
You may use the ORG statement in absolute segments to do that. For example the statement below generates effectively a 16-byte alignment.
ORG ($ + 15) AND 0FFF0h
See: http://www.keil.com/support/man/docs/a51/a51_st_org.htm
Thank for your answer. That solution is clear, but still asking me to take care about variables. My idea was put this work on compiler
You can use the at keyword of the C51 compiler to specify a location for a variable. Note that you cannot do this and specify an initializer at the same time.
You can also use linker directives to locate your variables, which is the more traditional way to do so. See the SEGMENTS directive, or CODE / XDATA / DATA / etc for BL51.
If you don't care about locations of individual variables, then perhaps the easiest thing do to is put all of your EEPROM variables into one .c file, so that they all appear in a single segment, and then tell the linker where you'd like that segment to appear. You also might declare a struct to match the layout of your EEPROM area.