| Motore di ricerca datesheet componenti elettronici |
|
AN3348 Scheda tecnica(PDF) 7 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3348 Scheda tecnica(HTML) 7 Page - STMicroelectronics |
|
7 / 10 page ![]() AN3348 Functional incompatibilities Doc ID 018510 Rev 2 7/10 MC_CTRL_PID: /* Inputs: */ /* register a ...... error */ /* register diob ... p_pid */ /* Limit error to range <MIN24, MAX24> */ if V == 0 then goto MC_CTRL_PID_I, flush. if N == 0 then goto MC_CTRL_PID_I, no_flush. … #endasm } 2. The function's prototype is a very important feature that was quite disregarded by the old tools. The prototype contains information regarding the function which is used by the caller function in order to create a correct and safe code which would not destroy local variables which are used in the caller function. That is why it is very important to create a full prototype for the function. In this function we can see that the function expects the arguments to be passed through registers a and diob. This information should be in the prototype. Now the comments which describe that are also redundant and we can remove them: fract24 MC_CTRL_PID( register_a fract24 error, register_diob mc_ctrl_pid_t *p_pid) { #asm /* Limit error to range <MIN24, MAX24> */ if V == 0 then goto MC_CTRL_PID_I, flush. if N == 0 then goto MC_CTRL_PID_I, no_flush. … #endasm } 3. Since this is a pure assembly function and we don't want the compiler to generate any prologue and epilogue to it and do not perform any optimizations inside it, we should add it as an attribute to the function. If the function does not contain an rtn instruction at it's end and you want the compiler to generate it you can use attribute no_save_registers instead of pure_assembly. 4. Since the function is having also a hidden argument which is the flags (V and N at the first two lines of the function) we should add also this information into the function's prototype so that the optimizer would know that flags are important to this function so flags generation in the caller function should not be optimized away: __attribute__((expects_flags)) __attribute__((pure_assembly)) fract24 MC_CTRL_PID( register_a fract24 error, register_diob mc_ctrl_pid_t *p_pid) { #asm /* Limit error to range <MIN24, MAX24> */ if V == 0 then goto MC_CTRL_PID_I, flush. if N == 0 then goto MC_CTRL_PID_I, no_flush. … #endasm } |
|
|
Link URL |
| Lei ha avuto il aiuto da alldatasheet? [ DONATE ] |
Di alldatasheet | Richest di pubblicita | contatti | Privacy Policy | Collegamento alla scheda tecnica | scambio Link | Ricerca produttore All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |