We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm using the uVision2 8051 eval version trying to see if it's worth leaving my normal asm enviroment. Natualy I have some asm functions that I would like to take with me, but I need to figure out how to call my asm functions. I have three different senearios that are quiet common among my routines, and I'm looking for help to integrate the two worlds of programming. This is how I would like the C code to look: unsigned char portbit unsigned char databyte unsigned char stream[8] bit Reset(portbit) byte DataIO(portbit,databyte) void DataOut(portbit,databyte) The asm works like this: Reset returns true or false in carry, and accesses a certan output bit. DataIO both sends and returns data in the accumulator. It, too acesses a port bit. DataOut is basically the same as the above, but it returns nothing. It will however change the contens in the stream. In other words... How do I make sure that the C routines communicates using the accumulator and carry. I'm looking forward to hear what to do. Regards, Flemming Steffensen
Well the first thing to do is, of course, read the manuals! I think the section Interfacing C Programs to Assembler might be appropriate? ;-) Note that all the manuals are on the CD, and accessible via the 'Books' tab in the uVision Project window. Also try a search of this forum, and the Support Knowledgebase
Flemming, The easiest way to create interfaces to asm subroutines from Keil C is to write the subroutine as a C function and have the compiler generate assembler code. Then remove the gut of the pittiful assembler routine the compiler generated and insert your code there. hilsen fra USA Erik
Tak Erik, I'll try it your way! Regards,
Hi Andrew, I've not recieved any manuals with the eval release of uVisuion2 I have. Where are they available? I allready tried a search in this forum, but apparently "C", "asm", "assembler" and "function" are stripped from any search string, making it a hard to search for item. But thanks for your input anyway. Regards.
As I said before, Note that all the manuals are on the CD, and accessible via the 'Books' tab in the uVision Project window. https://www.keil.com/demo/cdrom.asp If you downloaded your demo, I think there's an option to download with or without manuals.
Note that the Forum & Knowledgebase searches are separate: The link for the Forum search is to the left of the page; The link for the Knowledgebase search is at the top of the page.