Patent GB-1166645-A (GB)
Title: Apparatus for Performing Character Operations
IPC: G06F9/355
Filed: 1966-10-03
Abstract: 1,166,645. Data processing. DIGITAL EQUIPMENT CORP. 3 Oct., 1966 [1 Oct., 1965], No. 44134/66. Heading G4A. In electronic digital data processing apparatus, an instruction specifies an operation and the address of a byte pointer word, the byte pointer word comprising first, second and third numbers specifying respectively the position of a byte in a data word, the length of (number of digits in) the byte, and the address in memory of the data word, first, second and third registers being provided for these numbers respectively, logic control means responding to the sign of the difference between the first and second numbers and either storing the difference in the first register or changing the number in the third register by one digit and storing n minus the second member in the first register, where n is the number of digits per word. The digits are bits and the position of the byte is indicated as the number of bit positions between its right-hand end and the right-hand end of the data word. The instruction also specifies the accumulator to be used in the operation. Instructions as above facilitating operations on bytes are: (A) increment byte pointer, which alters the byte pointer word so that it points to the next byte, (B) load byte, which extracts the specified byte from the specified data word and positions it at the right-hand end of an arithmetic register, (C) deposit byte, which inserts a byte present at the right-hand end of the arithmetic register into the specified byte position in the specified data word, (D) combination of (A) and (B), (E) combination of (A) and (C). Instruction (A) requires one sequence consisting of an address cycle, a fetch cycle and an execution cycle. The other instructions each require two such sequences. Incrementing of the byte pointer, when required, is done in the first sequence, as is formation of a mask word in instructions (B)-(E). Actual loading and depositing of a byte is done in the second sequence. Increment byte pointer. The length field of the byte pointer word is subtracted from the position field using a step counter and if the result is non-negative, this result replaces the position field in the byte pointer word. If the result is negative, the address field of the word is incremented by one and the position field is set to " word length minus byte length ". The byte pointer word is then returned to memory. Formation of mask word. The length field is inserted into the step counter which is then complemented. Ones are shifted into the righthand end of the accumulator register with counting up of the step counter until the latter reaches zero. Hence the accumulator register holds a sequence of ones equal in length to the byte at its right-hand end, and zeros elsewhere. Load byte-second sequence.-The data word is transferred from a memory buffer (into which it was read from memory) into the arithmetic register, and the mask word in the accumulator register is transferred into the buffer register. The step counter, which holds the position field, is complemented, and then counted up to zero with shift-in of zeros into the left-hand end of the arithmetic register so that the byte is finally positioned at the right-hand end of the arithmetic register. The mask word in the memory buffer is now added into the arithmetic register. Deposit byte-second sequence.-The data word is read from memory into the memory buffer. The byte to be deposited in it is at the righthand end of the arithmetic register and the mask word is in the accumulator register. The position field in the step counter is complemented, then counted-up to zero with shift of zeros into the right-hand end of the arithmetic register and accumulator register, so that the byte and mask sequence of ones are aligned with the required byte position in the data word. The arithmetic register bits are complemented. The memory buffer receives the contents of the accumulator register while the latter receives the OR of the contents of the two registers. Those bit positions in the arithmetic register corresponding (in position) to zeros in the memory buffer are set to zero. The contents of the accumulator register are set into the memory buffer. The bits of the arithmetic register are complemented. Those bit positions in the memory buffer corresponding to zeros in the arithmetic register are set to zero. This leaves the data word, with the new byte inserted, in the buffer register, whence it can be returned to memory. Interrupt.-One programme can interrupt another if of higher priority and this can occur after either address-fetch-execution sequence of a two-sequence instruction. Two flip-flops are in the reset state during the first sequence of an instruction and in the set state during the second (if any). On interrupt, the state of the second flip-flop is saved, together with other programme status, and on return to the interrupted programme, this state is reloaded into the flip-flop. The flip-flops control the production of " increment operation " (i.e. referring to incrementing the byte pointer word) and " not increment operation " control signals in response to the instruction decoder in the first sequence of an instruction. A two-sequence instruction, if interrupted between the sequences, is performed again (both sequences) except that due to the second flip-flop any incrementing of the byte pointer word done previously (in the first sequence) will not be repeated. References are made to Specifications 1,166,646 and 1,166,647.