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
" ... how can a simple code ... " just because something looks simple doesn't stop it from being powerful. Often the simplest solutions are the best! " ... define ... what input or output goes to which bit?" The code you showed does not define individual bits - they are just comments to inform (or remind) you what the individual bits do. The actual functions of the individual bits are defined by the wiring in your target hardware.