Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site tekcrl.UUCP Path: utzoo!linus!decvax!decwrl!pyramid!hplabs!tektronix!tekcrl!patc From: patc@tekcrl.UUCP (Pat Caudill) Newsgroups: net.arch Subject: Addressing modes (conditional branches) Message-ID: <546@tekcrl.UUCP> Date: Sun, 23-Feb-86 11:53:38 EST Article-I.D.: tekcrl.546 Posted: Sun Feb 23 11:53:38 1986 Date-Received: Wed, 26-Feb-86 07:07:11 EST Distribution: net Organization: Tektronix, Beaverton OR Lines: 45 . .. . ... . (line eater kibbles) The use of a stored branch as the way to effect a conditional jump is not new. In "First Draft of a Report on the EDVAC", John von Neumann, Sec 11.3 discribes the conditional 'branching' facilities of the EDVAC. Some background, the EDVAC's ALU (arithmetic organ) had three registers. I and J were inputs and O was output. Numbers were loaded to I with the previous value in I shifting to J. When an operation was performed the result appeared in O. There were operations which allowed I or J to directly go to O, and O to I. The conditional operation transfered the contents of I or J unchanged to O depending on the previous value in O. To conditionally branch to one of two locations the inputs would be loaded with two jump instructions the correct one taken as the result and stored in memory then jumped to. (often the clever programmer would arrange the store address to be the next location. For example: if ( a < b ) then goto L1 else goto L2 ; would code up a: (my own notation, von Neumann's is very cryptic, and I dont have the Greek alphabet on this terminal) LD A LD B SUB ; - LD #JMP+L1 LD #JMP+L2 COND ; s STO L3 L3: JMP L3 Turing for the Pilot-ACE ( I think, look in Early British Computers from Digital Press for more details)just had an instruction which set a negative accumulator to zero or 1 depending on its sign. He suggested for a conditional branch: lbl1 * condition + lbl2 * (1-condition) + jmp -> nextInstr We now look down on self modifying code, but at that time it was considered a great step forward. Ahh, those were the good old days. Tektronix!tekcrl!patc