View previous topic :: View next topic
|
Author |
Message |
jackzhang75
Active User
Joined: 09 Jun 2014 Posts: 125 Location: US
|
|
|
|
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
jackzhang75
Active User
Joined: 09 Jun 2014 Posts: 125 Location: US
|
|
|
|
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
|