Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int teta (75);
- int main(){
- struct Incidencia {
- char carretera [8];//8
- int km;//2
- char problema[128];//128
- };//138
- Incidencia i[]={
- {"NII",2,"atasco"},
- {"A18",69,"nieve"},
- {"A152",115,"meteorito"}
- };
- int km(0) ,size (sizeof (Incidencia));//140
- char a[128],b[128];
- int deslplazamiento(8);
- __asm__(
- "INICIO :"
- "nop \n\t"
- /*ojo si trabajas en 32 64 ebx debe ser rbx edx rdx .... !*/
- "lea (%[entrada]),%%ebx\n\t"/* carga la direccion de base de i de struct incidencia */
- "mov %3,%%edx \n\t"/* carga el valor %3 size en el registro %edx */
- "mov 8(%%edx,%%ebx,1),%2 \n\t"/* accede a km tras los 8 char de carretera*/
- :"=g"(a) , "=g"(b),"=g"(km) ,"=m" (size),"=c" (deslplazamiento)/* %0 %1 %2 %3 %4 */
- :[entrada]"r"(i) /* %5*/
- );
- cout<<"size "<<size<<endl;
- cout<<km<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement