Maarten, Thank you very much for your valuable comments. I was looking at _your_ library functions at the moment... :-)
> > - in assembler functions, either inline or externally linked, the assumption > > is, that no register may be trashed. Correct? > > This is correct for naked functions or inline assembly > inside non-naked C functions with surrounding C > statements. > > If however you write a function completely in assembly > and start its name with an underscore, you can make a C > prototype (without the underscore) for it and call it. > The caller will save the registers around the call > (unless you use --callee-saves). This is great. Where is the docs? :-) I mean chapter 3.13, this should be in bold as the first line, shouldn't it. OK OK I know this is OS so I am supposed to update it myself... OK, please tell me how. > > Also if you use inline assembly inside a non-naked C > function without any C statements I doubt any register > will be used. Best check the generated asm though. > I don't understand. Is it not my choice what resources will I use in MY inline-assembly functions? > > - on the other hand, DPTR, ACC, B may be freely thrashed (provided the > > return type is void). Correct? > > Yes, these are at your disposal. > Thank you, it's very generous. :-) I think this should go into the docs, too. > > - therefore, for a register intensive application, I'd like to swap register > > banks as a least processing-expensive solution. My assumption is, that in > > the declaration, I'd add the "using" attribute (with the appropriate bank > > number), together with "naked". I assume, that I still need to provide the > > switching code upon entry/exit on my own; but the compiler is aware that the > > register bank is in usage and will not assign it to iram/dram/stack or > > otherwise. Correct? > > Yes, that's correct. If you do not use naked the > switching will be done for you (by the caller!). > Oh, very convenient. An another line into the docs... Thank you for your help again. Jan ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user