Hi Can someone tell me how does XDATA works? I got the code below but i do not understand how can a simple code like #define Port_D XBYTE [0xFFA0], define Port D and what input or output goes to which bit?See the code below #define Port_D XBYTE [0xFFA0] // bit 0: switch S1 // bit 1: switch S2 // bit 4: LED D1 // bit 5: LED D2 Thanx for the help
I imaging there must be some address decoding logic in your circuit which is organised so that some switches and LEDs appear at address 0xFFA0. You need to read up on 'memory mapping'. When you read/write a byte to/from address 0xFFA0 the bits in that byte should correspond to those defined in the comments. Stefan