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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/12/05 19:21
Read: times


 
#84870 - Linked!
Responding to: ???'s previous message
I said:
If the assembler is intended to be called from 'C', it must be written according to the 'C' Compiler's calling convention. As we have already determined that this was not written for Keil C51, it is highly unlikely that the Assembler meets this criterion...! :-(

Yes, that was it!

The provided assembler does not match Keil's naming conventions, so it does not link with the objects built by Keil's C51.

What I did was:

1. Create a "dummy" file, modulator.c, with "skeletons" for the required objects:
/*
* Andy Neil, Antronics Ltd.
* Modulator.C
* Comments: Keil C51 definitions corresponding to the definitions in
*           the Modulator.asm file from Philips in support of their
*           Application Note AN10210, "Using the Philips 87LPC76x 
*           microcontroller as a remote control transmitter"
*/

// Data "objects"
unsigned char    system;
unsigned char    command;


// Code "objects"
void RC5_Init(void)
{
   // No code here - just want to get interface, names, etc right!
}

void Send_RC5(void)
{
   // No code here - just want to get interface, names, etc right!
}

2. Build this using the SRC directive to create a Keil A51 Assembler source file, modulator.src.
The generated modulator.src shows the necessary names etc to link with the Keil C51 object files; they are:
?DT?MODULATOR        SEGMENT DATA   
         PUBLIC command
         PUBLIC system
         RSEG   ?DT?MODULATOR
         system:   DS   1
         command:   DS   1

?PR?RC5_Init?MODULATOR                   SEGMENT CODE 
	PUBLIC	RC5_Init
	RSEG  ?PR?RC5_Init?MODULATOR
RC5_Init:
         ;Body of RC5_Init follows unchanged

?PR?Send_RC5?MODULATOR                   SEGMENT CODE 
	PUBLIC	Send_RC5
	RSEG  ?PR?Send_RC5?MODULATOR
Send_RC5:
         ;Body of Send_RC5 follows, 
         ;with references to _system and _command changed.

3. Modify the supplied modulator.asm as shown above.

Now it all builds!


List of 32 messages in thread
TopicAuthorDate
Philips sample code/Keil problems            01/01/70 00:00      
   Why don't you ask Philips?            01/01/70 00:00      
      Re: Why don't you ask Philips?            01/01/70 00:00      
         Re: Ask Philips?            01/01/70 00:00      
            Re: Ask Philips?            01/01/70 00:00      
               Link            01/01/70 00:00      
                  Re: useful App Note            01/01/70 00:00      
                     87 89            01/01/70 00:00      
                        Re: 87 89            01/01/70 00:00      
               Tasking.            01/01/70 00:00      
                  Re: Tasking            01/01/70 00:00      
                     Keil?            01/01/70 00:00      
                        Re: Keil            01/01/70 00:00      
                           Linking            01/01/70 00:00      
                              Linked!            01/01/70 00:00      
                                 Re: Linked            01/01/70 00:00      
                                    Linking            01/01/70 00:00      
                  Re: Tasking            01/01/70 00:00      
         reply            01/01/70 00:00      
   Dunfields or Tasking?            01/01/70 00:00      
      Tasking            01/01/70 00:00      
   2D Array problem            01/01/70 00:00      
      Compiler can deduce size.            01/01/70 00:00      
         can, but doesn't have to!            01/01/70 00:00      
            Fully Bracketed Initializers            01/01/70 00:00      
               Ask Keil            01/01/70 00:00      
               C99 vs. C90            01/01/70 00:00      
         Compiler deducing array size            01/01/70 00:00      
            Tasking Compiler deduces array size!            01/01/70 00:00      
               Which Array?            01/01/70 00:00      
                  That Array!            01/01/70 00:00      
                     One More Test            01/01/70 00:00      

Back to Subject List