View previous topic :: View next topic
|
Author |
Message |
Husna
New User
Joined: 02 Jun 2006 Posts: 49
|
|
|
|
Hi all,
How data (-123) will be stored in COMP3. Any of you please let me know the same? |
|
Back to top |
|
|
lucky.rohith Currently Banned New User
Joined: 06 Aug 2006 Posts: 10
|
|
|
|
Hi Husna,
In comp-3 data wil be stored in HEXA DECIMAL FORMAT.
The sign is stored in the last nibble i.e last 4 bits. |
|
Back to top |
|
|
Husna
New User
Joined: 02 Jun 2006 Posts: 49
|
|
|
|
Hi Rohith,
Thanks for the reply. Actually, I would like know how the -123 value will be allocated in HEXA DECIMAL FORMAT? Please let me know clearly? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi husna,
It will be 6FFF
0123 |
|
Back to top |
|
|
Husna
New User
Joined: 02 Jun 2006 Posts: 49
|
|
|
|
Hi Guptae,
Could you please let me know clearly? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi husna,
It will be '60F1F2F3'
Correction r welcome.- |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Husna,
If you comp-3 field is defined as, say PIC S9(3) COMP-3 then the hex value of the field will be x'123D'. If your field were defined as PIC S9(4) COMP-3 than the hex value would be x'00123D'.
lucky.rohith is correct about the sign. In COMP-3 , or packed decimal, a sign of 'C' is positive, 'D' is nigitive, and 'F' is unsigned'.
Dave |
|
Back to top |
|
|
|