8a567a235f
supported with GCC 3.4+.
76 lines
2.2 KiB
Text
76 lines
2.2 KiB
Text
$NetBSD: patch-aa,v 1.7 2005/12/01 19:43:23 joerg Exp $
|
|
|
|
--- sim/ucsim/avr.src/arith_inst.cc.orig 2005-12-01 19:22:22.000000000 +0000
|
|
+++ sim/ucsim/avr.src/arith_inst.cc
|
|
@@ -51,7 +51,7 @@ cl_avr::cpi_Rd_K(t_mem code)
|
|
if (D & 0x80)
|
|
D|= ~0xff;
|
|
t_mem sreg= ram->get(SREG);
|
|
- (signed)result= (signed)D-(signed)K;
|
|
+ result= (signed)D-(signed)K;
|
|
res= result & 0xff;
|
|
|
|
sreg= sreg & ~(BIT_H|BIT_S|BIT_V|BIT_N|BIT_C|BIT_Z);
|
|
@@ -101,7 +101,7 @@ cl_avr::sbci_Rd_K(t_mem code)
|
|
if (D & 0x80)
|
|
D|= ~0xff;
|
|
t_mem sreg= ram->get(SREG);
|
|
- (signed)result= (signed)D-(signed)K-(sreg&BIT_C)?1:0;
|
|
+ result= (signed)D-(signed)K-(sreg&BIT_C)?1:0;
|
|
res= result & 0xff;
|
|
ram->write(d, res);
|
|
|
|
@@ -151,7 +151,7 @@ cl_avr::subi_Rd_K(t_mem code)
|
|
K|= ~0xff;
|
|
if (D & 0x80)
|
|
D|= ~0xff;
|
|
- (signed)result= (signed)D-(signed)K;
|
|
+ result= (signed)D-(signed)K;
|
|
res= result & 0xff;
|
|
ram->write(d, res);
|
|
|
|
@@ -237,7 +237,7 @@ cl_avr::cpc_Rd_Rr(t_mem code)
|
|
if (D & 0x80)
|
|
D|= ~0xff;
|
|
t_mem sreg= ram->get(SREG);
|
|
- (signed)result= (signed)D-(signed)R-(sreg&BIT_C)?1:0;
|
|
+ result= (signed)D-(signed)R-(sreg&BIT_C)?1:0;
|
|
res= result & 0xff;
|
|
|
|
sreg= sreg & ~(BIT_H|BIT_S|BIT_V|BIT_N|BIT_C);
|
|
@@ -287,7 +287,7 @@ cl_avr::sbc_Rd_Rr(t_mem code)
|
|
if (D & 0x80)
|
|
D|= ~0xff;
|
|
t_mem sreg= ram->get(SREG);
|
|
- (signed)result= (signed)D-(signed)R-(sreg&BIT_C)?1:0;
|
|
+ result= (signed)D-(signed)R-(sreg&BIT_C)?1:0;
|
|
res= result & 0xff;
|
|
ram->write(d, res);
|
|
|
|
@@ -389,7 +389,7 @@ cl_avr::cp_Rd_Rr(t_mem code)
|
|
R|= ~0xff;
|
|
if (D & 0x80)
|
|
D|= ~0xff;
|
|
- (signed)result= (signed)D-(signed)R;
|
|
+ result= (signed)D-(signed)R;
|
|
res= result & 0xff;
|
|
|
|
t_mem sreg= ram->get(SREG) & ~(BIT_H|BIT_S|BIT_V|BIT_N|BIT_Z|BIT_C);
|
|
@@ -438,7 +438,7 @@ cl_avr::sub_Rd_Rr(t_mem code)
|
|
R|= ~0xff;
|
|
if (D & 0x80)
|
|
D|= ~0xff;
|
|
- (signed)result= (signed)D-(signed)R;
|
|
+ result= (signed)D-(signed)R;
|
|
res= result & 0xff;
|
|
ram->write(d, res);
|
|
|
|
@@ -922,7 +922,7 @@ cl_avr::sbiw_Rdl_K(t_mem code)
|
|
K|= ~0x3f;
|
|
if (D & 0x8000)
|
|
D|= ~0xffff;
|
|
- (signed)result= (signed)D-(signed)K;
|
|
+ result= (signed)D-(signed)K;
|
|
res= result & 0xffff;
|
|
t_mem resl= res&0xff, resh= (res>>8)&0xff;
|
|
ram->write(dl+1, resh);
|