2021-12-16 22:42:33 +01:00
|
|
|
#include<stdio.h>
|
|
|
|
#include<stdlib.h>
|
|
|
|
#include<time.h> /* Utilisé pour obtenir une adresse de démarrage aléatoire */
|
|
|
|
|
|
|
|
union mars_instruction {
|
|
|
|
long long instruction;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned char codeop;
|
|
|
|
unsigned char modea;
|
|
|
|
unsigned char modeb;
|
|
|
|
unsigned char align;
|
|
|
|
short int arga;
|
|
|
|
short int argb;
|
|
|
|
} mars;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[]){
|
|
|
|
|
|
|
|
union mars_instruction toto;
|
2021-12-17 16:38:22 +01:00
|
|
|
union mars_instruction didier;
|
2021-12-16 22:42:33 +01:00
|
|
|
|
2021-12-17 16:38:22 +01:00
|
|
|
toto.instruction = 216173890264694884;
|
2021-12-16 22:42:33 +01:00
|
|
|
|
2021-12-17 16:38:22 +01:00
|
|
|
didier.mars.codeop = 2;
|
|
|
|
didier.mars.arga = 2;
|
|
|
|
didier.mars.argb = 8;
|
|
|
|
|
|
|
|
printf("Long long int: %lld\n", didier.instruction);
|
|
|
|
printf("Argument b de toto: %d\n", toto.mars.argb);
|
2021-12-16 22:42:33 +01:00
|
|
|
|
|
|
|
}
|