🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.folklore.computers
Article #540

Re: Revenge

#540
From: Nicholas J. Simicich
Date: Thu, 21 Dec 1989 14:39
31 lines
1961 bytes
In article <11212.664...@mts.rpi.edu> Greg_d...@mts.rpi.edu
(Commander Krugannal) writes:

 >     One program segment I have never tried, but supposedly works
 >   on at least the IBM 3081D, is the statement BALR 12,12.
 >   This instructs the assember to branch to 12 and load the value
 >   of 12 and exucute it. Well, the command 12 is BALR, so this 
 >   essentially tells itself to BALR to itself, and excute what is
 >   there, which is a BALR and you get the picture. :-)

Technical correction: The above is totally wrong. The instruction does
not branch to 12, it branches to the address contained in register
twelve, which could be anything, anywhere.

It saves the address of the next instruction into register 12, so that
a subroutine can branch to it.

Now, on VM/CMS, the address in register 12 at entry point to a routine
happens to be the beginning address for the routine.  So if this is a
single instruction program it will branch to itself at least once.  I
think, though, that it will then branch to the following instruction.

The original intention seemed to be to construct an endless loop.
There is nothing magical or uninterruptable about such a loop
(especially this one, although the execute on the 7094 was
interesting), and I leave it as an exercise for the reader to
construct one in their favorite high level language or assembler.


-- 
Nick Simicich --- uunet!bywater!scifi!njs --- n...@ibm.com (Internet)
Technical Details
Message-ID: <1019@scifi.UUCP>
Path: mbox-mo1.pugleaf.net!gmdzi!unido!mcsun!uunet!bywater!scifi!njs
References: <11212.664.forumexp@mts.rpi.edu>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!gmdzi!unido!mcsun!uunet!bywater!scifi!njs
From: njs@scifi.UUCP (Nicholas J. Simicich)
Newsgroups: alt.folklore.computers
Subject: Re: Revenge
Message-ID: <1019@scifi.UUCP>
Date: 21 Dec 89 14:39:31 GMT
References: <11212.664.forumexp@mts.rpi.edu>
Reply-To: njs@scifi.UUCP (Nicholas J. Simicich)
Organization: Nick Simicich, Peekskill, NY
Lines: 31
Posted: Thu Dec 21 15:39:31 1989
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit