Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. struct myValues{ // define my structure
  2. int ptr2A; // pointer to first float
  3. float A;
  4. float B;
  5. float C;
  6. float D;
  7. float E;
  8. float F;
  9. }myValues;
  10.  
  11. struct myValues my_asm(int ptr2a, float A, float B, float C, float D, float E, float F); // Prototype for the ASM function
  12.  
  13. …code here to set values of A-F...
  14.  
  15. float* ptr2A = &myValues.A; //get the memory address where A is stored
  16. myValues.ptr2A = ptr2A; //put that address into myValues.ptr2A and pass to the ASM function
  17.  
  18.  
  19. // now call the ASM code
  20. myValues = my_asm(myValues.ptr2A, myValues.A, myValues.B, myValues.C, myValues.D, myValues.E, myValues.F);
  21.  
  22. mov r5, r1 // r1 has pointer to the first float A
  23. vdiv.f32 s3, s0, s0 //this line puts 1.0 in s3 for ease in debugging
  24. vstr s3, [r5] // poke the 1.0 into the mem location of A
  25. bx lr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement