What is the intended purpose of the Hex Branch instruction on the IBM System/32

58 Views Asked by At

Does anyone know the intended use of the Hex Branch instruction on the IBM System/32?

In case there is a clever reader who doesn't know the System/32, Hex Branch substitutes the high nybble of the low byte of the Micro-instruction Address Register (MAR, the program counter) with a 4-bit immediate value in the instruction. It then substitutes the low nybble of the low byte of the instruction address register with either the zone or numeric portion of a either the high or low byte of a register.

From SY31-0346-4 5320 Theory Diagrams, Fifth Edition (May 1977)

This instruction operates as a 16 way unconditional branch. Either the zone or digit portion of either the high or low byte of the selected register is used to replace bits 12-15 of MAR. Bits 8-11 of MAR are replaced by the bit settings of MAR'.

(MAR' is 4 bits taken from the instruction. Note that IBM labels bits left to right, so 01234567.)

From the description, it would appear that this instruction is intended to be used with zoned decimal values. In a zoned decimal value, the low nybble of a byte contains a numeric value 0-9, the high nybble of the one's position represents the sign of the multi-digit decimal number. There are multiple values for both positive and negative, but the preferred values are 0b1111, for positive, and 0b1101, for negative. The zone value of the digits in other than the one's position is not considered.

Because this is an absolute jump, it seems that the programmer would need to know the address of the instruction to know where the branch is going to resume, but perhaps that's handled by the assembler.

As an example, suppose MAR contains 0x1234, and WR2 contains 0xF5D6 (-56). After

HBZ 7,WR2(L)

MAR would contain 0x127D.

What would be the point of that? How would you know what instruction was at that address?

1

There are 1 best solutions below

1
Marco Polo On

These System/32 instructions in the Theory of Operations manual are for the "CSP" - the Control Storage Processor. In effect, they are the actual instructions used to write the "microcode" that was then used to interpretively execute the user-visible S/32 instruction set of the "MSP" - the Main Storage Procesor, that was the same as the IBM System/3, and what was used by the IBM RPG-II and COBOL compilers; MSP and CSP was also used on the S/34 and S/36 processors -- the CSP side ran the SSP operating system, and the MSP ran the user's COBOL or RPG-II applications. (Note that S/34 and S/36 FORTRAN and BASIC actually ran with the "scientific instructions" that ran with different microcode loaded on the CSP.)

If you examine all of the IBM manuals available for S/3, S/32, S/34, and S/36 on Bitsavers, you can get a better idea ... the S/34 and S/36 assembler language manuals and "Scientific Instructions" manuals are there, too. Hope that helps.