Re: Re: Where do I start?

Mike Schwab <[email protected]> Wed, 26 May 2010 22:05:54 -0500
Newsgroups gmane.comp.emulators.turnkey-mvs
Message-ID <[email protected]>
On Wed, May 26, 2010 at 6:24 PM, Rick Fochtman <[email protected]> wrote:
>
>
>  -------------------------------<snip>-------------------------
> For Example: A base register is a register holding an address that is modified by an index or indexes to form a pointer. Usually a base register points to the zero'th array element or the first element in a buffer. A changeable index is added to the base register to access other parts of the buffer or elements in the array.
>
> Right?
> --------------------------------<unsnip>--------------------------
> Close, but no cigar. Your program establishes addressability to ALL its labels by establishing a base register. This way, the base address can be added to the various displacement addresses in your program so that your branch instructions, for example, go to the correct main storage address. Since the largest address value that can be in an instruction is, in most cases, 4096, you need to establisgh a base so that your program can be loaded anywhere in main storage. You might find more information under "Addressing" in the PoPs manual. (Principles of Operations). Take a look at $TGET, that I sent you. Start from the CSECT statement and look from there through the " LR  R1,R2  " instruction. for entry linkage, and from the " LR R1,R13 " through the " BR R14 " for the exit linkage. In the entry linkage, you can see where I define the base register.
>
> Assembler is like no high-level language you know; many of the concepts and requirements are completely new to ANY high-level language programmer.
>
> We REALLY need to talk. :-)
>
> Rick
Some instructions do not allow index register, because that particular
instruction uses those bits for something else.  MVC (move character)
is one instruction you probably will want to use in this program and
uses those bits for the lenght.  MVI uses those bits for the Immediate
operand.  So best to use one register for the input buffer address and
one for the output field address.

--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?