Subject: simh: h316 emu LDX instruction bug -- ea decoding performs indexing
Package: simh
Version: 3.8.1-2
Severity: normal
Tags: upstream squeeze sid patch

On the H316, the opcode for the LDX and STX instructions is the same.
The differentiation is made by setting or resetting the "do indexing"
bit of the instruction.

All instructions in the emulator use the Ea() routine to compute the
effective address to be addressed by the instruction.  There's no
way to tell Ea() that LDX and STX are special.  The case statement
block for these two instructions, in version 3.8-0, masked off the
"do index" bit before calling Ea().

Per an email conversation with upstream, this masking was inadvertently
removed in a code cleanup in the 3.8-1 release, and should reappear
in the 3.8-2 release.  ("...if I can ever find the time to get it out
the door.")

I've attached a patch which corrects the issue.  It might save somebody
some debugging time.

De

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=es_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages simh depends on:
ii  libc6                         2.11.2-2   Embedded GNU C Library: Shared lib

simh recommends no packages.

simh suggests no packages.

-- no debconf information


diff -ur simh-3.8.1/H316/h316_cpu.c simh-3.8.1-drb/H316/h316_cpu.c
--- simh-3.8.1/H316/h316_cpu.c  2008-11-21 20:12:32.000000000 -0500
+++ simh-3.8.1-drb/H316/h316_cpu.c      2010-11-01 20:15:54.000000000 -0400
@@ -614,13 +614,13 @@
         break;
 
     case 015: case 055:                                 /* STX */
-        if (reason = Ea (MB, &Y))                       /* eff addr */
+        if (reason = Ea (MB & ~IDX, &Y))                /* eff addr */
             break;
         Write (Y, XR);                                  /* store XR */
         break;
 
     case 035: case 075:                                 /* LDX */
-        if (reason = Ea (MB, &Y))                       /* eff addr */
+        if (reason = Ea (MB & ~IDX, &Y))                /* eff addr */
             break;
         XR = Read (Y);                                  /* load XR */
         break;



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to