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

What's the +1 means in CLC FOUR,SIX+1 ?


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

Active User


Joined: 09 Jun 2014
Posts: 125
Location: US

PostPosted: Tue May 19, 2015 2:02 am
Reply with quote

Hi ,

I am looking at following program.

Code:
ONE      DC     C'ABCDE'
TWO      DC     C'12345'
THREE    DC     C'ABX1239'
FOUR     DC     C'ABC'
FIVE     DC     C'123'
SIX      DC     C' ABCD'
SEVEN    DC     C'BBC'


The DC statements shown above result in the following data (shown in character and hex) in storage:

A B C D E 1 2 3 4 5 A B X 1 2 3 9 A B C 1 2 3 A B C D B B C

C1C2C3C4C5F1F2F3F4F5C1C2E7F1F2F3F9C1C2C3F1F2F340C1C2C3C4C2C2C3

ONE TWO THREE FOUR FIVE SIX SEVEN


Why SIX+1 is C1C2C3 in following instruction ? What does +1 means ?
Code:
CLC FOUR,SIX+1


Thanks
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue May 19, 2015 3:06 am
Reply with quote

Remember what Base/Displacement means.

In

CLC FOUR,SIX+1

FOUR effectively tells the hardware to compute the address in storage where FOUR is located. SIX effectively tells the hardware to compute the address in storage where SIX is located, and then add 1 to that address.

Now, if you apply what I told you in the last paragraph, you should be able to figure out what the CLC is doing. Don't forget that CLC uses a length, which the Assembler also determined and inserted into the instruction.

Code:
000004 05C0                           4          BALR  12,0     
000006                                5          USING *,12     
000006 D502 C008 C00C 0000E 00012     6          CLC   FOUR,SIX+1
00000C 0500                           7          BALR  0,0       
                                                 ...
00000E C1C2C3                         8 FOUR     DC    C'ABC'   
000011 40C1C2C3C4                     9 SIX      DC    C' ABCD'


The rest you can figure out all by yourself. I don't know about the other responders, but I'm tired of telling you all the answers, and most likely doing your homework for you. You tell us, for a change.

Not only that, open up your Principles of Operation and you tell us what is in the first 4 bits of register 0 after the BALR 0,0 executes if the machine is running in AMODE 24.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue May 19, 2015 5:01 am
Reply with quote

steve-myers wrote:
Not only that, open up your Principles of Operation and you tell us what is in the first 4 bits of register 0 after the BALR 0,0 executes if the machine is running in AMODE 24.
Sorry. As worded this is a "trick" question in z/Architecture systems, and that was not my intent when I devised the question. By "first 4 bits" I meant bits 32 through 35 of the 64 bit register where bit 0 is the high order bit. This is the common meaning of bits 0 through 3 of the 32 bit register in System/360 through ESA/390 systems. Regardless of the system, the data in the bits is the same.
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 Licensed Materials & Restricted M... General Talk & Fun Stuff 10
No new posts Null Indicator value -2 means in Embe... DB2 2
No new posts Securely storing ftp password in acf2... CA Products 1
No new posts What Does "OC" Instruction ... PL/I & Assembler 7
No new posts What does % in file discription of EA... CA Products 3
Search our Forums:

Back to Top