Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/14/04 12:38
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#72462 - RE: Assembly in KEIL
Responding to: ???'s previous message
I take it that you are doing most of your project in C, but that you wish to add in some assembly language.

You can insert assembly language anywhere in your C code using pragma ASM and ENDASM. All you need to do is to mark the options for files with assembly as 'Generate Assembly SRC File' and 'Assemble SRC File'.

Inserting assemble in the midst of C code is, however, generally depricated because of all the problems it can cause. It is usually better to write discrete assembly language functions that can be called from C.

You can do this by writing a C function that consists entirely (or nearly entirely) of in-line assembler. This function should be in a separate file from your main source code.

You can find a whole bunch of examples here:

http://www.programmersheaven.com/search/li...9%2Ehtm%3F

This method has the advantage that the C compiler will sort out all the calling rules, naming conventions etc. for you, this can save a lot of work.

You may find it convenient to take the SRC files generated by the compiler and then to discard the original C files. The assembly language files can be included in a Keil project very easily.

And, of course, it is all there in the manual...

List of 10 messages in thread
TopicAuthorDate
Assembly in KEIL            01/01/70 00:00      
   RE: Assembly in KEIL            01/01/70 00:00      
   RE: Assembly in KEIL            01/01/70 00:00      
      RE: Manuals            01/01/70 00:00      
   Assembly Examples            01/01/70 00:00      
   Help for Keil C51 Code external memory            01/01/70 00:00      
      RE: Help for Keil C51 Code external memory            01/01/70 00:00      
         RE: Help for Keil C51 Code external memory            01/01/70 00:00      
            RE: Help for Keil C51 Code external memory            01/01/70 00:00      
      RE: Help for Keil C51 Code external memory            01/01/70 00:00      

Back to Subject List