Created
October 12, 2017 00:47
-
-
Save Sleepful/ef185476ffd6e50332c54d9309c32fef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Hello World program */ | |
#include<stdio.h> | |
#include "structs.h" | |
main() | |
{ | |
int a = 3; | |
printf("Hello World %d \n", a); | |
arqui* r; | |
r = initArqui(); | |
a = getIR(r); | |
printf("Hello World %d \n", a); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include "structs.h" | |
typedef struct instructionRegister | |
{ | |
int instr; | |
} iRegister; | |
typedef struct arqui_s | |
{ | |
iRegister IR; | |
} | |
arqui; | |
arqui* initArqui() | |
{ | |
arqui *s = malloc(sizeof(arqui)); | |
iRegister r; | |
r.instr = 0; | |
s->IR = r; | |
return s; | |
} | |
int getIR(arqui* s) | |
{ | |
int a = s->IR.instr; | |
return a; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct arqui_s arqui; | |
arqui* initArqui(); | |
int getIR(arqui*); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment