I need function who will read string from specific memory (code, idata, xdata memory)!
It will be used for display driver, that means the main program can't see functions from dipspaly driver only main functions of display driver!
Preciously I need 3 functions: 1 for string in code, 1 for string in idata and 1 for string in xdata. Or help with existing I have - I dont know how it working.
int _wr_str_d(uint d) { int j; uchar k; _clr_scr(); kursor=7; pozicija=-1; j=0; while ((k=*(uchar idata *)(d+j))!='\0') { _wr_char(k); j+=1; } return 0; }
Code are same for 3 functions diference are in name of memory. Main program dont call function direkt. he only call DisplayHandler(int p, int n) where is p - number assigned to function, n - are parameter.
So you do not want to use a generic pointer?
You want to use memory specific pointers then?
uchar *aPointer; //generic pointer uchar idata *iPointr; //idata pointer uchar xdata *xPointr; //xdata pointer uchar pdata *pPointr; //pdata pointer
Like that?
But then you're back to having to write a separate function for each memory area, aren't you?
Surely, you either need to be memory-specific, or you need to be generic? You can't have it both ways!