Skip to content

Commit 82ce9ec

Browse files
committed
[assembler] Comment that evidence on overflow of P is contradictory.
There is contradictory evidence on how the top bit of P is handled when incrementing it. Our current implementation (following the Technical Manual) does not change it, but at least one part of the Users Handbook states the opposite thing.
1 parent 94b7b53 commit 82ce9ec

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

cpu/src/control.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,10 @@ impl ControlUnit {
852852
}
853853
}
854854
ProgramCounterChange::CounterUpdate => {
855+
// Discussion: does this change the top bit (2.9)?
856+
//
857+
// Reasons for the answer "no"
858+
// --------------------------
855859
// Volume 2 of the Technical Manual (section 12-2.3 "P
856860
// REGISTER DRIVER LOGIC") states, """Information can
857861
// be transferred into the P register only from the X
@@ -874,6 +878,28 @@ impl ControlUnit {
874878
// plugboard configurations. According to the
875879
// Technical Manual, page 12-6, change of seqeuence is
876880
// the only time in which P₂.₉ is altered.
881+
//
882+
//
883+
// Reasons for the answer "yes"
884+
// ---------------------------
885+
//
886+
// The Instruction Execution chart on page 3-71 of the
887+
// Users Handbook shows that the P register is updated
888+
// to P+1 (see top row of table) and there is a
889+
// reference to note 1. This note is on page 3073
890+
// (section 3-3.3) and it says:
891+
//
892+
// In all expressions P + 1, P + 2, sums are reducible 2¹⁸.
893+
// (777777 + 1) mod 2¹⁸ = 0.
894+
//
895+
// This seems to directly contradict section 12-2.3 of
896+
// the Technical Manual (which we referenced in the
897+
// "no" section above).
898+
//
899+
// This seems a clear statement that bit 2.9 is used
900+
// as the most significant bit. It also seems to
901+
// imply that if P=377777, P+1 will increment it to
902+
// 400000.
877903
let (_old_physical, old_mark) = self.regs.p.split();
878904
let new_p = self.regs.p.successor(); // p now points at the next instruction.
879905
let (_new_physical, new_mark) = new_p.split();

0 commit comments

Comments
 (0)