Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Doubt in Register storage

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Doubt in Register storage
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

Site Director


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

PostPosted: Mon Aug 12, 2013 2:37 am    Post subject:
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: 8002
Location: Bellevue, IA

PostPosted: Mon Aug 12, 2013 5:00 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts GETMAIN / FREEMAIN versus STORAGE OBT... steve-myers PL/I & Assembler 8 Wed Feb 01, 2017 1:45 am
No new posts Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm
No new posts How storage is calculated for AN-Edit... Raghu navaikulam COBOL Programming 2 Wed Mar 09, 2016 3:51 pm
No new posts How can amount of the Storage Usage b... esduman61 CICS 6 Wed Mar 09, 2016 1:19 pm
No new posts CEE0813S Insufficient storage was ava... kishpra COBOL Programming 18 Mon Nov 09, 2015 8:37 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us