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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/09/07 16:55
Read: times


 
#130516 - similar concept to MAC routines, locking to binary
Responding to: ???'s previous message
you might also have a look at how the Multiply Accumulate Unit would be accessed here:

"MACROs for using the MAC unit on c8051f12x devices"
http://www.cygnal.org/ubb/Forum10/HTML/000014.html

The handling of the MAC unit there is probably similar to what you have to do on your device:


- Setting mode
- Setting up some (16 bit) arguments in SFR
- Starting engine
- insert some NOPs until stuff is done
- expect 32 bit result in SFR (or some ready bit)


By the use of macros you can avoid considerable overhead (loading arguments, procedure call, .., return) and have better control anyway.



A note on binary only libraries: As long as your code just implements functionality like the one outlined above there should be NONE.

Why? Let's look at your original post with respect to binary objects: your C code would lead to ?C?LLDPTR being linked. I'm pretty positive that this would not give the result you expect (the mcs51 architecture does not support SFR access by pointer). This is a very simple problem and single stepping through the code could immediately pin down the problem, but this certainly is nothing that you'd want to do for more complex code.
So even your short (about 10 lines blank stripped) C code is affected by a binary only object and seems to have hindered yourself (and caused additional work (at least for readers of this forum to whom I hereby apologize))

Why again? Also your code handles Interrupt Enable (with restoring EA to its previous state) and needs overhead to do so.
How do you know that the programmer does not always know the previous state of EA and thus can get away with simply clearing/setting EA?
Or that he has handled IRQ locking on a higher level?
Or he rather wants to use the IRQ mask for locking?
Or that he can do without IRQ locking at all because the program flow guarantees there is no conflict?
Or that in his case IRQs are reenabled too early (after setting up the engine but before reading the result)
Or that he f.e. only needs to touch the high byte of the argument between two subsequent runs of the engine?

Maybe I have misread your previous postings but: If you want to enable programmers to make the most of your device then locking to a binary only interface seems a bad idea.

Greetings,
Frieder

List of 35 messages in thread
TopicAuthorDate
Code transform from A51 -> C51 Keil            01/01/70 00:00      
   I don't think so, I'm afraid            01/01/70 00:00      
   there is NO WAY you can do that. C does not, in a            01/01/70 00:00      
      You are right I can't be sure            01/01/70 00:00      
         API            01/01/70 00:00      
            The problem is with the API development...            01/01/70 00:00      
               Welcome to the world of cross-platform development            01/01/70 00:00      
                  Use A51 compiled object files in SDCC...            01/01/70 00:00      
                     Did you say what you mean?            01/01/70 00:00      
                        Yes I was actualy meaning GENERATED...            01/01/70 00:00      
                  About inventing time in make...            01/01/70 00:00      
                     Inventing            01/01/70 00:00      
                     well, since you hide your e-mail (the 8052 e-mail            01/01/70 00:00      
                        Please, please could you send it?            01/01/70 00:00      
                     Unix utilities for Windows            01/01/70 00:00      
                        SDCC paths            01/01/70 00:00      
               The 'C' preprocessor            01/01/70 00:00      
               if you use a sensible approach it is easy            01/01/70 00:00      
                  I don't know about 'easy'...            01/01/70 00:00      
         HLL's are for people who are too lazy ...            01/01/70 00:00      
            re: HLLs are for people            01/01/70 00:00      
               what\\\'s He-Man?            01/01/70 00:00      
                  Def: He-Man            01/01/70 00:00      
            ยต-controllers are for people who are too lazy ...            01/01/70 00:00      
               I don't want to discuss about HLL's effyciency            01/01/70 00:00      
               Oops            01/01/70 00:00      
                  dyslexics untie!            01/01/70 00:00      
            30% to 90%?            01/01/70 00:00      
               Neil, I kind of agree            01/01/70 00:00      
   You can be sure it does.            01/01/70 00:00      
   Code transform from A51 -> SDCC            01/01/70 00:00      
      This is also a thing I missed..            01/01/70 00:00      
         similar concept to MAC routines, locking to binary            01/01/70 00:00      
   is it possible ?            01/01/70 00:00      
      yes            01/01/70 00:00      

Back to Subject List