Motore di ricerca datesheet componenti elettronici
  Italian  ▼
ALLDATASHEETIT.COM

X  

AN3348 Scheda tecnica(PDF) 6 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) 6 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
 6 / 10 page
background image
Functional incompatibilities
AN3348
6/10
Doc ID 018510 Rev 2
that was given to the function by the old tools and it won't work with the new ones.
Therefore, in normal cases users should avoid writing such a code and should change it to
specific inline assembly instructions.
3.2.2
C-inline assembly interaction
The user mustn't make any kind of assumptions regarding issues as register allocation,
variable storage location and code location.
All the interaction between the C and inline assembly should be done symbolically.
The following code example is a sure way to get into troubles:
tmp = accel_tbl[tmp];
#asm( alu a = d;
ram p <- start_period. )
Here the user assumed (based on old tools behavior) that tmp would reside in register d.
This code can be easily fixed to
asm{move a,tmp@Rn; ldm p,start_period};
For more details regarding inline assembly usage please look at the Inline Assembly
chapter in eTPU_Build_Tools_Reference.pdf.
3.2.3
Inline assembly functions
Many users have written functions which are fully implemented using inline assembly.
A few changes might be needed for these functions.
Let's take as an example this code sample and see how we change it into a standard and
safe code:
/*
fract24 mc_ctrl_pid( fract24 error,
mc_ctrl_pid_t *p_pid)
*/
#asm
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
1.
All inline assembly code should reside inside a function, so first we should uncomment
the function's prototype. We should also make sure that the function's name is the
name which is used in order to call this function. Notice that in many cases users used
to call a label at the beginning of the inline assembly but since label names are local
this won't work so now we'll have to call our function with the same name of this label.
The label itself might be redundant now if it is not referenced from within the function so
we can remove or comment it:
fract24 MC_CTRL_PID( fract24 error,
mc_ctrl_pid_t *p_pid)
{
#asm



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