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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/07/07 14:24
Read: times


 
#146731 - There may be a way out after all ...
Responding to: ???'s previous message
The regular toolchains from any vendor may not allow you to do this natively.

This is how it was done in the days of DOS/CPM based systems with limited memory.

You have the basic OS structure with fixed entry points(hooks) to various functions that your applications may need to access/handle the peripherals. This will be a fixed table of fixed hooks(pointers to functions who are placed at fixed addresses).

The application would then call these hooks at run time; of course, since they are at fixed addresses, it does not matter to the linker building the application.

Examine this

Your core driver (permanently resident) has these functions
0000 - pointer to LCD function(void)
0002 - pointer to Keyboard function(void)
...
...
000x - pointer to some other function(void)

LCD_function:
Kbd_function:
Other_function:

The application works something like this.
You may need to pass parameters in a set of global registers to / from the functions since the functions will be void of parameters and return values.

I am not 100% sure of the syntax shown below, but I use it as a guide to illustrate what I am saying.

#define  LCD_Hook  (*(code *)0000)
#define  KBD_Hook  (*(code *)0002)

main()
{
  LCD_Hook;    // call the lcd routine
  while (1)
  {
    Kbd_Hook;  // call the keyboard scanner
  }
}

I have given a divergent view, but I do hope it will be helpful.

Jerson


List of 119 messages in thread
TopicAuthorDate
USING EXTERNAL RAM AS CODE MEMORY            01/01/70 00:00      
   no need            01/01/70 00:00      
      MMC ...            01/01/70 00:00      
         Let him do what he wants!            01/01/70 00:00      
            did I say not to?            01/01/70 00:00      
            how to?            01/01/70 00:00      
               But how?            01/01/70 00:00      
                  well,            01/01/70 00:00      
                     end of wrong stick!            01/01/70 00:00      
                        already stated            01/01/70 00:00      
                           I see            01/01/70 00:00      
   How will you load the RAM?            01/01/70 00:00      
   I agree with some here            01/01/70 00:00      
      What's pretty handy is BBRAM            01/01/70 00:00      
         True, but            01/01/70 00:00      
      double-post ... sorry!            01/01/70 00:00      
      A little tidy-up            01/01/70 00:00      
         there is a way ... in fact, several ...            01/01/70 00:00      
            and appears to have lost interest            01/01/70 00:00      
               APOLOGIES AND CLARIFICATION            01/01/70 00:00      
                  answer            01/01/70 00:00      
                     Why 32K?            01/01/70 00:00      
                        Erik's Answer            01/01/70 00:00      
                     FURTHER HELP NEEDED.            01/01/70 00:00      
                        Yes, of course!            01/01/70 00:00      
                           the Basics implementation            01/01/70 00:00      
                              TC?            01/01/70 00:00      
                              Please explain            01/01/70 00:00      
                                 Binary executable format?            01/01/70 00:00      
                                    Still not got it!            01/01/70 00:00      
                                       order of intel hex file            01/01/70 00:00      
                                          records in Intel Hex file not necessarily in order            01/01/70 00:00      
                                             YES THE RECORDS ARE NOT IN SEQUENCE            01/01/70 00:00      
                                                Not strange at all            01/01/70 00:00      
                                 Good question...            01/01/70 00:00      
                                    Binary executable            01/01/70 00:00      
                                       I don't think you were            01/01/70 00:00      
                                          Elaboration requested.            01/01/70 00:00      
                                             GOT it, no elaboration required            01/01/70 00:00      
                                             That's it            01/01/70 00:00      
                        I'm sorry, but            01/01/70 00:00      
                        .            01/01/70 00:00      
                           here is a link to a free 8051 assembler.            01/01/70 00:00      
                           Pardon?            01/01/70 00:00      
                              I didnt mean it that way.            01/01/70 00:00      
                                 Still lost            01/01/70 00:00      
                                    I HAVE TO DEAL WITH HEX CODE            01/01/70 00:00      
                                       Additionaly            01/01/70 00:00      
                                          Duplicate post!            01/01/70 00:00      
                  Some comments            01/01/70 00:00      
         I'm using simple terms            01/01/70 00:00      
            @ Mike Stegaier            01/01/70 00:00      
            Not true            01/01/70 00:00      
               FLASH ROM and EEPROM            01/01/70 00:00      
                  Literal or idiomatic            01/01/70 00:00      
                     here's why            01/01/70 00:00      
                        .            01/01/70 00:00      
                           oh yes, it is            01/01/70 00:00      
                              ...            01/01/70 00:00      
   double post, please ignore            01/01/70 00:00      
   KISS            01/01/70 00:00      
   Similar project            01/01/70 00:00      
   Additionaly            01/01/70 00:00      
      You really need to study some basics first!            01/01/70 00:00      
         Apology            01/01/70 00:00      
      Make it simple...            01/01/70 00:00      
   Dynamic linking            01/01/70 00:00      
      Not on an 8051!            01/01/70 00:00      
         But i have to find a way            01/01/70 00:00      
            Bootloader            01/01/70 00:00      
            tri-processor?            01/01/70 00:00      
            You are where you are            01/01/70 00:00      
               Brand new product            01/01/70 00:00      
         There may be a way out after all ...            01/01/70 00:00      
            I don't think so?            01/01/70 00:00      
   Processor Not my choice            01/01/70 00:00      
   How to use external EEPROM AT24C16A with P89C51RD2            01/01/70 00:00      
   ANDY is right jerson but Thanks :)            01/01/70 00:00      
      Thinking laterally            01/01/70 00:00      
         good idea!            01/01/70 00:00      
            Some sort of P-Code Interpreter            01/01/70 00:00      
   Comments            01/01/70 00:00      
      Really Bad idea!            01/01/70 00:00      
         Misunderstanding            01/01/70 00:00      
            why, oh why?            01/01/70 00:00      
            No - that is still a really bad idea!            01/01/70 00:00      
               Is it Still a bad idea????????            01/01/70 00:00      
                  Use the Linker            01/01/70 00:00      
                     Got it Andy.            01/01/70 00:00      
      Summary needed            01/01/70 00:00      
         Required Summary            01/01/70 00:00      
            somethingt does not jive            01/01/70 00:00      
            something else does not jive            01/01/70 00:00      
               Yes i have 3 processors            01/01/70 00:00      
            Why only 32K            01/01/70 00:00      
               32k is fine but do suggest some IC's            01/01/70 00:00      
                  -2 for help?            01/01/70 00:00      
                     Still don't get it!            01/01/70 00:00      
                  don't be silly            01/01/70 00:00      
                     Thanks ERIC!!!!            01/01/70 00:00      
      comments            01/01/70 00:00      
         What a revelation, I bet most did not know that            01/01/70 00:00      
         ???            01/01/70 00:00      
            THANKS ANDY, you are a real CHUM            01/01/70 00:00      
            my explanation            01/01/70 00:00      
               who on earth, in his right mind ...            01/01/70 00:00      
               You need to think more carefully before you write            01/01/70 00:00      
         Data compression, point taken            01/01/70 00:00      
   CHECKSUM COMPLETED            01/01/70 00:00      
      Time for a new thread?            01/01/70 00:00      
   CONTROLLER SPEEDS/ MISMATCH CRYSTAL??????            01/01/70 00:00      
      Don't ignore the datasheet!            01/01/70 00:00      
         Through a pin/bit complementing program            01/01/70 00:00      
            who gives a hoot            01/01/70 00:00      
            Obviously will be less than the crystal frequency!            01/01/70 00:00      
               Only Complement instruction            01/01/70 00:00      
                  Complement Only?            01/01/70 00:00      
                     Can't be just a single instruction!            01/01/70 00:00      
                        GOT THE POINT.            01/01/70 00:00      

Back to Subject List