simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] 13-pre3 patch


From: Theodore A. Roth
Subject: Re: [Simulavr-devel] 13-pre3 patch
Date: Mon, 7 Jan 2002 13:21:04 -0700 (MST)

This is a bug in the LSR opcode handler. Here's the potential fix:

cat > LSR_cary_fix.patch <<EOF
Index: decoder.c
===================================================================
RCS file: /cvsroot/simulavr/simulavr/src/decoder.c,v
retrieving revision 1.11
diff -u -r1.11 decoder.c
--- decoder.c   29 Dec 2001 06:49:11 -0000      1.11
+++ decoder.c   7 Jan 2002 20:15:28 -0000
@@ -1790,7 +1790,7 @@
 
     byte sreg = avr_core_sreg_get( core );
 
-    sreg = set_bit_in_byte( sreg, SREG_C, C = (rd & 0xf) );
+    sreg = set_bit_in_byte( sreg, SREG_C, C = (rd & 0x1) );
     sreg = set_bit_in_byte( sreg, SREG_N, N = (0) );
     sreg = set_bit_in_byte( sreg, SREG_V, V = (N ^ C) );
     sreg = set_bit_in_byte( sreg, SREG_S, S = (N ^ V) );
EOF

With this I got 0, 0, 4, 0 output as expected. Once you verify that this 
is indeed the fix, I'll commit it to cvs.

Ted

On Sun, 6 Jan 2002, ken restivo wrote:

:)i was able to build 13-pre3, and gdb, no prob. the build system worked
:)cleanly and quietly. very cool.
:)
:)but i found a strange problem.
:)
:)this test program successively writes the bytes "0, 0, 7, 0" to PORTC,
:)whereas i was expecting it to write the bytes "0, 0, 4, 0".
:)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]