Skip to content
Snippets Groups Projects
Commit 2a1c0925 authored by Israel Barreto Sant'Anna's avatar Israel Barreto Sant'Anna
Browse files

Put sign on converted hexadecimals

parent f75149aa
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,8 @@ int main(){
}
c = getc();
}
//If it's a negative hex make it a negative integer as well
n = 0x8000&n ? (int)(0x7FFF&n)-0x8000 : n;
print(n);
//while(!Putc(c)); // Wait till there's space on queue
}
......@@ -114,15 +116,12 @@ void initUd(){
char getc(){
char c;
if(Ud.nrx > 0){
// print(1);
// print(Ud.nrx);
disableInterr();
c = Ud.rx_q[Ud.rx_hd];
Ud.rx_hd = (Ud.rx_hd+1)%16;
disableInterr();
Ud.nrx--;
enableInterr();
}else{
//print(2);
c = EOF;
}
return c;
......@@ -136,9 +135,9 @@ int Putc(char c){
}
if(Ud.ntx > 0){
disableInterr();
Ud.tx_q[Ud.tx_tl] = c;
Ud.tx_tl = (Ud.tx_tl+1)%16;
disableInterr();
Ud.ntx--;
enableInterr();
sent = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment