How to Store and Restore R0 and R1?

High Level Assembler(HLASM) for MVS & VM & VSE

How to Store and Restore R0 and R1?

Postby utpalpal07 » Thu Jun 21, 2012 5:42 pm

Hi All,

I am new to assembler programming. Please tell me:

How to store and restore register R0 and R1 in a program?

Posts: 43
Joined: Wed Feb 08, 2012 12:02 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to Store and Restore R0 and R1?


Re: How to Store and Restore R0 and R1?

Postby steve-myers » Thu Jun 21, 2012 7:20 pm

Your question is more complex than you think.Why are you doing this? Are you saving them at the entry to a subroutine and restoring them just before you exit the subroutine?

Principles of Operation describes eight instructions you can use. They are in pairs: the instruction you use to save a register generally dictates the instruction you use to restore the register. Instruction pairs like BAKR/PR have usage implications that discourage their use for your intended purpose. I suggest you read Principles of Operation, obtain a book about Assembler language, or locate web sites that provide tutorial type information that others will provide the links for.

Four of the instructions require you to provide a place to use to contain the contents.

This web site is not intended for tutoials, which seems to be what you really need. You might try a Google search for "System/360 Assembler tutorial," though the pickings seemed very slim.
Global moderator
Posts: 1773
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 168 times

Re: How to Store and Restore R0 and R1?

Postby dick scherrer » Thu Jun 21, 2012 8:29 pm


Suggest you try here:

There are many bits of sample code. . .
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6308
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 90 times

Return to Assembler