??? 05/24/10 09:39 Read: times |
#176146 - seems you feed SDCC with a Keil specific header file Responding to: ???'s previous message |
Well this is probably a FAQ.
Keil specific header files typically contain lines like: sfr P0 = 0x80; /* Port-0 */ this produces the somewhat expected (C'ish) result (and the somewhat unexpected result if you are familiar with Keil's notation) of assigning the value 0x80 to P0. > mov 29h,#80h (For SDCC there is no specific address given for P0 so locates all those variables in the header file at consecutive addresses in data memory. Which is what you are seeing in your disassembled code) Compiler agnostic header files had on this forum f.e. been discussed here: http://www.8052.com/forumchat/read/116161 SDCC manual 3.4.1.7 "sfr / sfr16 / sfr32 / sbit" says: ... Please note, if you use a header file which was written for another compiler then the sfr / sfr16 / sfr32 / sbit Storage Class extensions will most likely be not compatible. Specifically the syntax sfr P0 = 0x80; is compiled without warning by SDCC to an assignment of 0x80 to a variable called P0! Nevertheless with the file compiler.h it is possible ... |