forked from erickwb/trabralho_arquitetura_2021_2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_things.c
43 lines (29 loc) · 862 Bytes
/
show_things.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "header.h"
void Mostra_Registrador(int registradores[]){
printf("\n####################### Registradores ########################\n");
for(int i = 0; i < 8; i++){
printf("R%d ",i);
printf(" %d \n",registradores[i]);
}
}
void Mostra_CPSR(char CPSR[]){
printf("\n####################### CPSR ########################\n");
for(int i = 0; i < 9; i++){
printf("%c",CPSR[i]);
}
printf("\n");
}
void Mostra_memory_data(char buffer1[], FILE *file){
printf("\n####################### Memoria de programa ########################\n");
if(file == NULL){
printf("Nao e possivel abrir o arquivo:");
getchar();
exit(0);
}
while (fgets(buffer1,12, file) != NULL){
printf("%s", buffer1);
}
}