??? 11/21/06 09:39 Modified: 11/21/06 09:46 Read: times |
#128342 - Try this snippet? Responding to: ???'s previous message |
> the easy, obvious and completely bad way...
another bad way:) and untested as well: /* eventually use: unsigned char xdata * * as return type instead of unsigned int */ unsigned int get_eo_xiseg(void) __naked { __asm mov a,#s_XISEG ; start add a,#l_XISEG ; length mov dpl,a ; mov a,#(s_XISEG>>8) ; start addc a,#(l_XISEG>>8) ; length mov dph,a ; ret __endasm; } (Assuming XISEG is the last used xdata segment) Unfortunatly the linker does not output a symbol for the end of the segment (as Russ suggested ) so an addition is needed. Greetings, Frieder |