IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Doubt in Register storage


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 63
Location: India

PostPosted: Sat Aug 10, 2013 3:39 am
Reply with quote

Hi,

I am a beginner in Assembler.I had a doubt while learning assembler regarding registers.Here is my understanding about register and my question.Please correct me where I am wrong.

Register is a pointer stores address.Each register contains 4 bytes.(32 bits).
Base register will be storing address of program instructions and its displacements.Since register is 4byte in memory and it holds hexadecimal addresses maximum address values that can be hold by base register is
X'FFFFFFFF'.But one nibble (4bits) is for indicating the register.So,Maximum displacement allowed in base register is X'FFFFFFF'.

But actually it is said that one base register can hold maximum 4096 bytes of instructions.Which is X'FFF' and one nibble for register indicator so X'BFFF'.X'BFFF' occupies only 2 bytes then what will be there in other two bytes.I know I am missing some thing basically.But i could not find.Please help.

I have seen the listing also. there base address displacement was in 6 digits which adds me more confusion.Please clarify me.


Thanks,
Arun
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 12, 2013 2:37 am
Reply with quote

Hello,

One thing you should invest in is a Good beginners Assembler book. The one I've used most was written by Kevin McQuillan and is/was available from Mike Murach Publishing. I believe it is now an e-book - this is the second assembler Kevin wrote - this one with Anne Prince. His first book is out of print, but copies are around if one looks.

Another is to download a copy of the Principles of Operations manuals from IBM. This will tell you all of the detail you might want/need for every instruction.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Aug 12, 2013 5:00 am
Reply with quote

Quote:
Register is a pointer stores address.Each register contains 4 bytes.(32 bits).
Base register will be storing address of program instructions and its displacements.Since register is 4byte in memory and it holds hexadecimal addresses maximum address values that can be hold by base register is
X'FFFFFFFF'.But one nibble (4bits) is for indicating the register.So,Maximum displacement allowed in base register is X'FFFFFFF'.

But actually it is said that one base register can hold maximum 4096 bytes of instructions.Which is X'FFF' and one nibble for register indicator so X'BFFF'.X'BFFF' occupies only 2 bytes then what will be there in other two bytes.I know I am missing some thing basically.But i could not find.Please help.
Much of what you have posted is incorrect.

First, there are 24-bit addresses, 31-bit addresses, and 64-bit addresses possible on a z/OS system. 24-bit addressing came first, then 31-bit, then 64-bit. 24-bit addresses are indicated by the first bit (reading left to right) being zero; if that bit is 1 then you have a 31-bit address. 64-bit addressing won't be considered here since you are a beginner.

Second, 31-bit addresses can use all 31 bits (since the first bit of the 32 bits in the word is an indicator bit) -- there are no nybbles reserved for "register indicator". 24-bit addresses will not use any of the leftmost 8 bits of each 4-byte word. I leave it to you to compute the maximum possible 24-bit and 31-bit address.

Third, base registers may contain any valid address. HOWEVER, the offset from the base register may not exceed 4096. If the base register value is loaded at X'4F200000', then the maximum offset / displacement for that base register will be at address X'4F200FFF'.

Fourth, why 4096? Because 3 nybbles (12 bits) is what assembler instructions (going back to 1964 and the original S/360 system) allowed for displacements / offsets.

Fifth, when you assemble a program, on the left side you will see the machine code for each assembler instruction, the 4-bit base register for each operand of that instruction, and the offset (12 bits) for each operand.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts CICS vs LE: STORAGE option CICS 0
No new posts Insufficient Storage ABENDS & Debugging 7
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts is there an API to use cloud storage ... All Other Mainframe Topics 2
Search our Forums:

Back to Top