Motore di ricerca datesheet componenti elettronici
  Italian  ▼
ALLDATASHEETIT.COM

X  

AN3348 Scheda tecnica(PDF) 7 Page - STMicroelectronics

Il numero della parte AN3348
Spiegazioni elettronici  Porting eTPU code to eTPU compiler
PDF  10 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Produttore elettronici  STMICROELECTRONICS [STMicroelectronics]
Homepage  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN3348 Scheda tecnica(HTML) 7 Page - STMicroelectronics

Back Button AN3348 Datasheet HTML 2Page - STMicroelectronics AN3348 Datasheet HTML 3Page - STMicroelectronics AN3348 Datasheet HTML 4Page - STMicroelectronics AN3348 Datasheet HTML 5Page - STMicroelectronics AN3348 Datasheet HTML 6Page - STMicroelectronics AN3348 Datasheet HTML 7Page - STMicroelectronics AN3348 Datasheet HTML 8Page - STMicroelectronics AN3348 Datasheet HTML 9Page - STMicroelectronics AN3348 Datasheet HTML 10Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 7 / 10 page
background image
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
}



Html Pages

1 2 3 4 5 6 7 8 9 10


Scheda tecnica Scarica

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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