ajout des types + union pour compil
This commit is contained in:
29
lfo.c
Normal file
29
lfo.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#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;
|
||||
|
||||
toto.mars.codeop = 2;
|
||||
toto.mars.arga = 2;
|
||||
toto.mars.argb = 8;
|
||||
|
||||
printf("%llx\n", toto.instruction);
|
||||
|
||||
}
|
Reference in New Issue
Block a user