Page 1 of 1

How to Store and Restore R0 and R1?

PostPosted: Thu Jun 21, 2012 5:42 pm
by utpalpal07
Hi All,

I am new to assembler programming. Please tell me:

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

Regards,
Utpal

Re: How to Store and Restore R0 and R1?

PostPosted: Thu Jun 21, 2012 7:20 pm
by steve-myers
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.

Re: How to Store and Restore R0 and R1?

PostPosted: Thu Jun 21, 2012 8:29 pm
by dick scherrer
Hello,

Suggest you try here:
http://www.simotime.com/indexasm.htm

There are many bits of sample code. . .