[Simh] H316 LDX instructin

Adrian Wise adrian at adrianwise.co.uk
Tue Oct 26 14:10:26 EDT 2010


I'm not very familiar with simh, but I am with the 316.

>      PC     C A       B       X       ea     IR
>    <snip>
>      01023  0 000314  000000  000001         OTA 4
>      01024  0 000314  000000  000001  01023  JMP 1023
>      01023  0 000314  000000  000001         OTA 4
>      01025  0 000314  000000  000001  01013  JMP* 1022
>      01013  0 000314  000000  000001  01036  LDA 1036  [000001]
>      01014  0 000001  000000  000001         AOA
>      01015  0 000002  000000  000001  01036  STA 1036  [000001]
>      01016  0 000002  000000  000001  01035  CAS 1035  [000007]
>      01021  0 000002  000000  000001  01003  JMP 1003

This next line looks "surprising" to me. The computed EA ought to be 
01036, not 01037. Since LDX ans STX share an opcode, and are 
differentiated by the index bit that indicates indexing in all *other* 
instructions, and it has the value '1' for LDX, I think this is a bug.

I'm pretty sure that I have seen this reported before (a long time ago 
by Philipp Hachtmann IIRC).

>      01003  0 000002  000000  000001  01037  LDX 1036  [000003]
>      01004  0 000002  000000  000003  01031  LDA 1026,1  [153717]
>    <snip>

> So, someone please hit me with a clue-by-four?  Or tell me I've found an
> actual bug?

I think it is a simh bug. Looks like the LDX is indexing, which it 
should not.

If you send me source code I'll run it on my simulator and let you know 
whether that fixes the issue.

It might also be worth mentioning that this is an extremely cumbersome 
code sequence for incrementing the index register. It is usually done 
with "IRS 0". If you arrange the loop to go from -N to -1 the skip that 
IRS does as it increments from -1 to 0, when you get to the end of the 
string, can escape from a loop.

regards

Adrian




More information about the Simh mailing list