forked from erickwb/trabralho_arquitetura_2021_2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdates_things.c
38 lines (29 loc) · 833 Bytes
/
updates_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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "header.h"
void Atualiza_CPSR(int registradores[],char CPSR[], int Ld){
if((registradores[Ld] & 0x80000000) == 0x80000000){ //and para descobrir se o sinal do bit 31 esta em nivel alto
CPSR[0] = 'N';
}else{
CPSR[0] = 'n';
}
//verifica se o resultado da operação e 0
if(registradores[Ld] == 0){
CPSR[1] = 'Z';
}else{
CPSR[1] = 'z';
}
//verificaca o valor da carry flag
//ideia and
//ideia compara lm com o valor do shift
}
void Copia_conteudo(char origem[], char buffer1[], char buffer2[]){
for (int i = 3; i < 7; i++){
buffer1[i-3] = origem[i];
}
for (int i = 7; i < 11; i++){
buffer2[i-7] = origem[i];
}
// printf("%s \n", destino);
}