Univac 1050 Emulator diagnostic bugs

10 views
Skip to first unread message

sboy...@gmail.com

unread,
Apr 9, 2025, 4:28:26 PMApr 9
to Univac Emulators
I have been going crazy trying to figure out why one of the original Univac memory tests wouldn't run. It turns out there was a bug in the memory test which caused a jump to an invalid address.

When you call a subroutine on the 1050, the return address gets stored into the address field of the first instruction in the subroutine and control gets passed to the second instruction in the subroutine. To return from the subroutine you jump to the first instruction in the subroutine.

The manual clearly states that the first instruction in the subroutine must be a jump instruction without an index register. Well, guess what? The dolt who coded this memory test tried to use an index register on the instruction. This, of course, added an offset to the return address sending the emulator into la-la land.

Removing the index register from the instruction fixed the problem.

You would think that someone would have noticed this and fixed it back in the 60's.

SHEESH!

Andy Fowler

unread,
Apr 10, 2025, 8:04:11 AMApr 10
to sboy...@gmail.com, Univac Emulators

Well done .


--
You received this message because you are subscribed to the Google Groups "Univac Emulators" group.
To unsubscribe from this group and stop receiving emails from it, send an email to u9200-emulato...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/u9200-emulator/e70e9308-a650-4840-8ac6-c465656bef61n%40googlegroups.com.

Patrick Barron

unread,
Apr 10, 2025, 5:27:29 PMApr 10
to Univac Emulators
Do you have any evidence that the diagnostic actually ever ran correctly on real hardware?  Just wondering if it's one of those cases where the hardware documentation says the hardware behaves one way, but the actually manufactured hardware actually behaves in a different way....

--Pat.

sboydlns

unread,
Apr 10, 2025, 6:03:45 PMApr 10
to Patrick Barron, Univac Emulators
There is no evidence one way or the other. But, if you think about it, the hardware writes the program counter into the jump instruction at the beginning of the subroutine. The program counter is the absolute address of the next instruction. So, unless your were intentionally trying to return to an address other than the one following the subroutine call you would have no reason to modify the return address using an index register.

Besides, an examination of the code reveals what was going through the programmers head.

At some point the program is copied to another location in memory. This new location is loaded into X1. All memory references, including jumps, in the moved piece of code are done using the index register, kind of like a relocation register. So, when he tries to return from the subroutine he naturally tries to use the index register for that jump. This has the effect of adding the index register to the return address twice since the index was already included in the program counter when the subroutine was called.

I don't see how it could have ever worked.

Sent from my Galaxy
--
You received this message because you are subscribed to the Google Groups "Univac Emulators" group.
To unsubscribe from this group and stop receiving emails from it, send an email to u9200-emulato...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages