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

Why single base register address to only 4K?


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

New User


Joined: 19 Feb 2010
Posts: 27
Location: India

PostPosted: Fri May 06, 2011 8:20 am
Reply with quote

Hello,

Single base register can address more than 4K as well. Then why in assembler it can point up to 4K only.

Can anybody help me to get the answer?

Thank you in advance.

-Vijay
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri May 06, 2011 10:17 am
Reply with quote

actually, the register only points at 1 bytes.
the offset part of the instruction
allows you to address memory in either direction of the 'byte addressed by the register'.

how many bytes are there in an instruction for the offset?. what is the max positive or negative value that can be represented?
Back to top
View user's profile Send private message
sandeep chopra

New User


Joined: 28 Aug 2008
Posts: 11
Location: Noida

PostPosted: Fri May 06, 2011 12:11 pm
Reply with quote

Maximum displacement 12 bits can take is 4095 (FFF). So we need second register if you need to go further for which displacement will start from zero. You will get out of base message if u define a label which is having displacement more than 4095 from starting of program means from where u have given base.
Back to top
View user's profile Send private message
Harsh Pawar

New User


Joined: 04 Jun 2008
Posts: 25
Location: Noida

PostPosted: Tue May 31, 2011 4:59 pm
Reply with quote

Any variable used in assembler program should have addressability.
If you see the instruction format and it is a type of instruction which uses storage then that storage should have addressability.
Example :

MVC is a SS type instruction. For every S (storage) we should have 2 bytes.

BDDD where B = base register (1-F) so it requires 4 bits for B.
DDD = Displacement 4 + 4 + 4 = 12 bits.

So lets say you are using register 12 for your base address , then B= C (C is in hex so in decimal it is 12).

Now what maximum value can DDD = 12 bits address ? 2power 12 = 4096.

This is how we got this 4 K limit for a program.

Please note that you may use multiple base addressability to make a program which is bigger then 4K.

Regards,
Harry
Back to top
View user's profile Send private message
nigelosberry

New User


Joined: 06 Jan 2009
Posts: 88
Location: Ggn, IN

PostPosted: Wed Jun 01, 2011 10:45 am
Reply with quote

It will be better if you try to visualize yourself why only 4096 bytes can be addressed USING a single base register.

To start with, you can have a look at the explicit format of an SS1 type instruction and see what are all the different components assembled in that instruction's object code and what each of them is meant for.

This is one of the very basic questions(and has been asked before a few times). In future please use the "search" option of the forum before putting any new question on board.
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 Routing command Address SDSF to other... TSO/ISPF 2
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Submit multiple jobs from a library t... JCL & VSAM 14
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts Merge 2 lines based on Space from a S... DFSORT/ICETOOL 5
Search our Forums:

Back to Top