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

64 bit or 32 bit Register ?


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: Thu Jun 18, 2015 2:26 am
Reply with quote

Hi experts,

I am reading the book and it said System Z is 64 bit and have 16 64 bit GPRs . But when i look at the content of GPRs , it only shows something like 3B 9A D9 FE which is 4 byte (32bit) so why not 8 bytes (62 bit) ?

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: Thu Jun 18, 2015 3:44 am
Reply with quote

Jack – This is one of the strangest aspects of z/Architecture.

Like the book says, there are 16 64-bit “general purpose” registers.

Now, when the register is specified with a an old instruction, only the low order 32 bits of the register are used. In other words,

L 0,32(,15)

loads the 32-bits at the location in storage determined by adding 32 to the contents of register 15 into bits 32 through 63 (as it is worded in Principles of Operation) of register 0. Bits 0 to 31 of the register are not altered. Similarly, an instruction like AR 5,0 will only use bits 32 to 63 of the registers; bits 0 to 31 are not altered.

Most of the instructions that use all 64 bits of a register usually have a G in the instruction name. LG 0,32(,15) will load the 64 bits at the storage location determined by adding 32 to the contents of register 15 into register 0.

I've been using the TIMEUSED macro recently. For example -
Code:
         TIMEUSED STORADR=START,CPU=MIC,LINKAGE=SYSTEM
         ... Instructions
         TIMEUSED STORADR=END,CPU=MIC,LINKAGE=SYSTEM
         LG    0,END
         SG    0,START
         CVD   0,DWORK
         ED    EDMASK,DWORK
         ...
START    DC    FD'0'
END      DC    FD'0'
DWORK    DC    PL8'0'
EDMASK   DC    0C' NNNNNNNNN.NNNNNN'
         DC    C' ',7X'20',X'2120',C'.',6X'20'
The LG/SG instructions effectively calculate the number of microseconds required to execute the instructions between the two TIMEUSED macros. The CVD instruction converts the 32 bit value in bits 32 to 63 of register 0 to decimal. By writing the appropriate bytes in EDMASK after executing the ED instruction I can write a nice message like xxxxxxxx USED 2.74 CPU SECONDS.
Back to top
View user's profile Send private message
jackzhang75

Active User


Joined: 09 Jun 2014
Posts: 125
Location: US

PostPosted: Thu Jun 18, 2015 6:05 pm
Reply with quote

Hi steve,

Thanks for your answer. So like you said, if i use 64 bit insturction like LG

i should see the content of GPGs something like 64 bit
(XX XX XX XX XX XX XX XX )

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

Active Member


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

PostPosted: Thu Jun 18, 2015 8:03 pm
Reply with quote

Basically, yes, though it is usually formatted as hhhhhhhh_hhhhhhhh. I've never figured out why all 64 bits are formatted and just the low order 32 bits are formatted in places like the summary dump. But it usually seems to get it right!
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 How to display Register values using WTO PL/I & Assembler 3
No new posts Doubt in Register storage PL/I & Assembler 2
No new posts RETURN-CODE REGISTER Testing & Performance 2
No new posts Why single base register address to o... PL/I & Assembler 4
No new posts which string verb contains inbuilt ta... COBOL Programming 7
Search our Forums:

Back to Top