is there a support for 128 bit at 64 bit delphi?

Hi,

There is one bcd number has 20 digit. But it doesn't fit to 64 bit. It 
needs 66 bit to store :/ Anyway I need to convert this 20 digit number 
to hex format. I mean, input is 20 digit bcd number as string, output 
should be hexadecimal number as string.

What is the pratical way to do this?

Thank you.
0
Mehmet
2/22/2012 6:20:24 PM
embarcadero.delphi.non-tech 5933 articles. 1 followers. Follow

9 Replies
1028 Views

Similar Articles

[PageSpeed] 12

Am 22.02.2012 19:20, schrieb Mehmet Fide:
> Hi,
> 
> There is one bcd number has 20 digit. But it doesn't fit to 64 bit. It 
> needs 66 bit to store :/ Anyway I need to convert this 20 digit number 
> to hex format. I mean, input is 20 digit bcd number as string, output 
> should be hexadecimal number as string.
> 
> What is the pratical way to do this?
> 
> Thank you.


Hello,

I'd suggest you reask this question in the language group as you'll get
more answers over there:

embarcadero.public.delphi.language.delphi.win32

Follow up for NNTP readers set.

Greetings

Markus
0
Markus
2/22/2012 7:34:27 PM
> {quote:title=Mehmet Fide wrote:}{quote}
> Hi,
> 
> There is one bcd number has 20 digit. But it doesn't fit to 64 bit. It 
> needs 66 bit to store :/ Anyway I need to convert this 20 digit number 
> to hex format. I mean, input is 20 digit bcd number as string, output 
> should be hexadecimal number as string.
> 
> What is the pratical way to do this?
> 
> Thank you.

You can hack your way around Extended (80bits) type.
But that's simply too ugly.
0
arthur
2/23/2012 7:17:11 PM
"Mehmet Fide" <aa@off.net> wrote in message 
news:447740@forums.embarcadero.com...

> I mean, input is 20 digit bcd number as string

How is that different from a 20 digit number as a string?
0
Uffe
2/23/2012 7:38:37 PM
Uffe Kousgaard wrote:

> "Mehmet Fide" <aa@off.net> wrote in message
> news:447740@forums.embarcadero.com...
> 
> > I mean, input is 20 digit bcd number as string
> 
> How is that different from a 20 digit number as a string?

Indeed. I assume he has a string, not a BCD number. 

FWIW, for Mehmet: BCD means binary coded digit and it usually stores
one decimal digit (0..9) per nibble (4 bits), or two digits per byte.
The values $A..$F are simply never used.)

To turn that into a string you simply take each nibble and add Ord('0')
to it to get a Char. The top nibble of a Byte can be found by

  TopNibble := TheByte shr 4;

And the bottom nibble by:

  BottomNibble := TheByte and $0F;

http://en.wikipedia.org/wiki/Binary-coded_decimal

So decimal 123456 is either coded as $12 $34 $56 or reverse (small
endianness), i.e. $56 $34 $12.
-- 
Rudy Velthuis

"All propaganda must be so popular and on such an intellectual
 level, that even the most stupid of those toward whom it is
 directed will understand it ... Through clever and constant
 application of propaganda, people can be made to see paradise
 as hell, and also the other way around, to consider the most
 wretched sort of life as paradise."
 -- Adolf Hitler
0
Rudy
2/23/2012 9:29:37 PM
After serious thinking Rudy Velthuis (TeamB) wrote :
> Uffe Kousgaard wrote:
>
>> "Mehmet Fide" <aa@off.net> wrote in message
>> news:447740@forums.embarcadero.com...
>> 
>>> I mean, input is 20 digit bcd number as string
>> 
>> How is that different from a 20 digit number as a string?
>
> Indeed. I assume he has a string, not a BCD number. 
>
> FWIW, for Mehmet: BCD means binary coded digit and it usually stores
> one decimal digit (0..9) per nibble (4 bits), or two digits per byte.
> The values $A..$F are simply never used.)

Yes I know that, sorry for confusion. Because it is very easy to 
convert bcd numbers to string representations or vice-versa just by 
adding or subtracting 48, I’ve used this terminology which was a 
mistake actually. My input is as string not BCD :)
0
Mehmet
2/23/2012 10:06:39 PM
Mehmet Fide wrote:

>  My input is as string not BCD :)

Then really try my Decimal type in my Decimals unit. You can directly
assign a string to it, and you can get its data using the GetBytes
function:

  const 
    HexChars: array[$00..$0F] of Char = '0123456789ABCDEF';

  ...

  MyDecimal := S;
  Bytes := MyDecimal.GetBytes;
  for I := 0 to 11 do
    Hex := HexChars[Bytes[I] shr 4] + 
           HexChars[Bytes[I] and $0F] + Hex;

  http://rvelthuis.de/zips/decimals.zip

-- 
Rudy Velthuis

Sausage Principle: People who love sausage and respect the law 
should never watch either one being made.
0
Rudy
2/23/2012 10:19:19 PM
Op 22-2-2012 19:20, Mehmet Fide schreef:
> Hi,
>
> There is one bcd number has 20 digit. But it doesn't fit to 64 bit. It
> needs 66 bit to store :/ Anyway I need to convert this 20 digit number
> to hex format. I mean, input is 20 digit bcd number as string, output
> should be hexadecimal number as string.
>
> What is the pratical way to do this?
>
> Thank you.

Check TBCD (FMTBCD)
I could not find examples.

20 digits in 66 bits is binary.
20 digits in 11 bytes is bcd (2 digits per byte + sign)

Ad Franse
0
Ad
2/23/2012 10:42:46 PM
Rudy Velthuis (TeamB) expressed precisely :
>   MyDecimal := S;
>   Bytes := MyDecimal.GetBytes;
>   for I := 0 to 11 do
>     Hex := HexChars[Bytes[I] shr 4] + 
>            HexChars[Bytes[I] and $0F] + Hex;
>
>   http://rvelthuis.de/zips/decimals.zip

Hi Rudy,

As I indicated on the delphi.win32, this unit worked for me directly. 
Thanks a lot again.

Mehmet.
0
Mehmet
2/23/2012 10:43:24 PM
Mehmet Fide wrote:

> Rudy Velthuis (TeamB) expressed precisely :
> >   MyDecimal := S;
> >   Bytes := MyDecimal.GetBytes;
> >   for I := 0 to 11 do
> >     Hex := HexChars[Bytes[I] shr 4] + 
> >            HexChars[Bytes[I] and $0F] + Hex;
> > 
> >   http://rvelthuis.de/zips/decimals.zip
> 
> Hi Rudy,
> 
> As I indicated on the delphi.win32, this unit worked for me directly. 
> Thanks a lot again.

Oh, cool. I hadn't seen the other reply.

-- 
Rudy Velthuis [TeamB]        http://rvelthuis.de

"Every day I get up and look through the Forbes list of the 
 richest people in America. If I'm not there, I go to work."
 -- Robert Orben
0
Rudy
2/24/2012 8:08:13 AM
Reply:

Similar Artilces:

Delphi 64 Bit released just in time for Windows to be 128 Bit ...
Ok - the title is a little provocative - but it might be close ;) This link is to an article the claims that the next Windows version will be 128 Bit. Which would be Win8 - and if not that version then definitely Win 9. http://arstechnica.com/microsoft/news/2009/10/microsoft-mulling-128-bit-versions-of-windows-8-windows-9.ars I realize that Delphi 64 bit should be out this year (or so I hope!) - and that the next windows is a few years away - but I hope the folks at Emb. are already planning for the 128 version when they do the 64 bit version... Bradley MacDonald brad_AT_tim...

SQL 8 support for 64 bit OS and 64 BIT OS, 64 BIT BUS Support, technical white paper, documentation, examples and success stories for SQL 8 if any please
SQL Anywhere Associates!! Is SQL 8 support 64 bit OS and 64 BIT OS, 64 BIT BUS Support, technical white paper, documentation, examples and success stories for SQL 8 if any please.... Thanks Vairam I believe that SQL Anywhere Studio is currently only released in a 32-bit format. TO the extent that 32-bit applications can run on a 64-bit OS, you can use ASA on a 64-bit system. -- Reg Domaratzki, Sybase iAnywhere Solutions Certified SQL Anywhere Associate Please reply only to the newsgroup ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm -> Cho...

SQL 8 support for 64 bit OS and 64 BIT OS, 64 BIT BUS Support, technical white paper, documentation, examples and success stories for SQL 8 if any please
SQL Anywhere Associates!! Is SQL 8 support 64 bit OS and 64 BIT OS, 64 BIT BUS Support, technical white paper, documentation, examples and success stories for SQL 8 if any please.... Thanks Vairam Is there any particular 64 bit OS that you are interested in hearing about? - Mark VS Vairam wrote: > > SQL Anywhere Associates!! > Is SQL 8 support 64 bit OS and 64 BIT OS, 64 BIT BUS Support, technical > white paper, documentation, examples and success stories for SQL 8 if any > please.... > > Thanks > > Vairam WINDOWS all flavours...

Excel 64-bit and Delphi 32-bit
Hi, Any known issues with using Excel 2010 64-bit with a Delphi 32-bit app (Delphi 2009) My app uses the ExcelXP TExcelApplication object and nothing real fancy. I basically opens Excel, gets a list of all the ranges, and then updates the cells. It works fine with Excel 2007 but I have one customer who is reporting problems and he has Excel 2010 64-bit. Also, is there a way for my app to determine if Excel is 32 or 64-bit so that I can log an appropriate message. -- Bob Small I think one the main points of the new Delphi 64-bit compiler was that it was required to be able...

Delphi 64 bit / Future Direction of Delphi
I am responding to the various requests for 64 bit and the discussion about the future direction of Delphi. I have a small company - we write software for new and used auto dealerships - sales and finance - coming out with accounting now and parts and service in the next few years. Our customers don't care about 32 bit vs 64 bit, etc. They want me to provide simple and convenient solutions to make their jobs easier. We have stuck with Delphi 5 for many years - I should have upgraded 5 years ago but it did the job. We are now in the early stages of a significant up...

XML for Delphi XE6 32-bit/64-bit
I am looking for a straight-forward no frills XML library or component that allows me to easily form an XML file and to parse it easily as a means to transfer text (could be long and lengthy) information back and forth between applications. I would appreciate any recommendation of such a resource. Or maybe XML is not a good option for my application? Thanking you all in advance. Andy Andy wrote: > I am looking for a straight-forward no frills XML library or component > that allows me to easily form an XML file and to parse it easily as a > means to transfer text (co...

Does the next version of Delphi supports 64 bits or...
....does the next version of Delphi only contain a parallel threading library? Hi Okkie, > ...does the next version of Delphi only contain a parallel threading library? I guess we'll know when The Roadmap (tm) gets updated ;-) Groetjes, Bob Swart -- Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi CodeGear Technology Partner -- CodeGear RAD Studio Reseller (BeNeLux) Delphi Win32 & .NET books on Lulu.com: http://stores.lulu.com/drbob42 Personal courseware + e-mail support http://www.ebob42.com/courseware Blog: http://www.drbob4...

No native 64-bit support in Delphi 2010
I just noticed that quality central shows the bug report requesting native 64 bits support (yes the one with almost 1000 votes) as closed: http://qc.embarcadero.com/wc/qcmain.aspx?d=7324 Now that is great news... Uuuh, well, that is until you read the resolution: "Deferred to Next Rel". Codegear's CEO was not lying when he told us that native 64-bit support is not the top priority anymore. And can someone with privileges please reopen it. Jan Derk Jan Derk wrote: > I just noticed that quality central shows the bug report requesting > native 64 bits s...

32 bit Delphi Active X Control on 64 Bit machines
I'm using BDS 2006 and created a very simple Active X control ( COM ) ocx file that does nothing but return a string in a property. Placing the control on a .net application that contains a label reflecting the property builds and runs beautifully in 32 bit Windows Vista. Moving the application to Windows 7 64 bit fails. Debugging shows it doesn't even get to initialization. Is it possible to use COM through syswow64? <Steven Davis> wrote in message news:225825@forums.embarcadero.com... > I'm using BDS 2006 and created a very simple Active X control > ( COM ) ...

Running 64 bit console application from a 32 bit Delphi GUI app?
I want to improve the usability of a 64 bit command line program so it can be handled by fairly inexperienced users. For this I need a normal Delphi program to have data specifiers etc, which in the end results in a command file for the console application. This is no big deal. The problem is the following: ------------------------------ 1) Can I start the 64 bit console app in Windows7X64 using the CreateProcess API like I am used to for 32 bit applications? Or are 64 bit programs different? 2) And if that is possible, can I somehow snatch what it sends to standard out (the co...

64 bit cpu // 64 bit Os version // 64 bit powerbuilder?
Hi guys, Does anyone know if Powebuilder is available in 64 bit? Kind regards A 64-bit version of PB does not (yet) exist. -- HTH Arnoud Url: http://www.gloriant.be Also check out my PB Reference site : http://www.pbinfo.be "Gunther Huygens" <ghuygens@be.xrt.com> wrote in message news:eoSjDRaCDHA.331@forums-1-dub... > Hi guys, > > Does anyone know if Powebuilder is available in 64 bit? > > Kind regards > > > > Since there are no OS Windows 64 bits, i wonder how it could be possible. Since there is a 64 bi...

Occasional errors with 32-bit Delphi 7 application on Windows 7 64-bit
Hi, I have a 32-bit Delphi 7 application which was deployed on some machines with Windows 7 64-bit. The application occasionally displays errors such as: "Error reading ppDBText37.Border.Color: Invalid property value" or "Error reading Label24.Font.Ch: Property Ch does not exist" (here the name "Charset" was apparently truncated to "Ch") I checked how those properties are declared on the form where the errors occurred, and all seems ok: - First form (where "Error reading ppDBText37.Border.Color: Invalid property value" occurs): ...

Call 64bit dll's function from 32 bit delphi code on 64 bit OS
Is there any way or trick to call a function in 64 bit DLL from Delphi code? Any hardware manufacturer must compile their device drivers into 64bit code for 64 bit OS. So for example, graphic driver from NVidia is compiled to 64bit code for 64bit OS. Question is how to load 64 bit dll from 32 bit delphi code and call such function? I hope somebody has already dealing with that. Thanks > is how to load 64 bit dll from 32 bit delphi code and call such function? http://msdn.microsoft.com/en-us/library/aa384249(VS.85).aspx http://blogs.msdn.com/oldnewthing/archive/2008/10/20/9...

Web resources about - is there a support for 128 bit at 64 bit delphi? - embarcadero.delphi.non-tech

Legged Squad Support System - Wikipedia, the free encyclopedia
The Legged Squad Support System ( LS3 ) is a DARPA project for a legged robot which could function autonomously as a packhorse for a squad of ...

ACT Greens support reforms to 'clunky' energy efficiency ratings system
Greens MLA Shane Rattenbury has backed calls from Canberra architects for a bolstered energy efficiency ratings system in the ACT.

Facebook Begins Adding Support for Apple Live Photos
Facebook has begun rolling out support for Apple Live Photos to some users of its iOS application . TechCrunch reported that some Facebook users ...

Facebook begins to roll out support for Live Photos on its iOS app
Facebook has begun to roll out support for Live Photos in its popular iOS app . The news was first reported by TechCrunch . Live Photos, which ...

J.K. Rowling supports black Hermione Granger
Rowling has thrown her support behind the casting of black actress Noma Dumezweni as Hermione Granger

Trump’s support stronger than you think
According to an experiment by the Morning Consult, Trump's numbers need more explanation. It's not why they're so high. It's why they're so low. ...

Facebook adds support for Live Photos — but there’s a catch
A few months after Apple birthed Live Photos into existence with the release of the iPhone 6s, Facebook is catching on to the idea. The social ...

CWA Throws Its Support Behind Bernie Sanders -
In an unsurprising move, the Communications Workers of America (CWA) says that it's throwing its support behind Bernie Sanders for President. ...

Jessa (Duggar) Seewald Leans on Husband Ben for Support During Difficult Labor See the Clip
Jessa (Duggar) Seewald Leans on Husband Ben for Support During Difficult Labor See the Clip

Nvidia fixes G-Sync refresh rate bug, adds VR SLI support to OpenGL
Nvidia launched its updated 361.43 drivers yesterday, with a bug fix for high-refresh rate monitors and new VR support for SLI in OpenGL.

Resources last updated: 12/23/2015 12:21:18 PM