Re: Binary to decimal

From: Phil Carmody (thefatphil_demunged_at_yahoo.co.uk)
Date: 06/10/04

  • Next message: JasmineCorp: "Re: Binary to decimal"
    Date: 10 Jun 2004 20:25:44 +0300
    
    

    "JasmineCorp" <webmaster@jasminecorp.net> writes:
    > Hi,
    >
    > I am new to assembly.
    >
    > I need to convert Qword number stored in a memory location into human
    > readable decimal value so that I can print the number to console.
    >
    > How to do that?
    >
    > For example
    > hex representation of the q word data is
    > 3E 5C 63 02 00 00 00 00
    >
    > Assembly code should convert it to decimal and print 40066110 on the screen.
    >
    > I am using 16 bit registers.

    Yuk!

    The easiest method is to load it as an integer into the FPU, and
    write it out as BCD. Converting from BCD to decimal is trivial
    after that.

    Outputting it is OS dependent.

    Phil

    -- 
    1st bug in MS win2k source code found after 20 minutes: scanline.cpp
    2nd and 3rd bug found after 10 more minutes: gethost.c
    Both non-exploitable. (The 2nd/3rd ones might be, depending on the CRTL)
    

  • Next message: JasmineCorp: "Re: Binary to decimal"

    Relevant Pages

    • Re: [PHP] Tool for programmer team
      ... coordination with different tools to help out. ... tasks, in particular, are any of tasks 5-8 dependent upon any of tasks 1-4? ... and as 'bugs' towards the release of a development cycle. ... everything as a bug, because then youll get trapped in a horrible realm ...
      (php.general)
    • Re: LibTomMath forked [SSE2 addons]
      ... > The point of me trying out SSE2 was two fold. ... 1st bug in MS win2k source code found after 20 minutes: ...
      (sci.crypt)
    • Re: Softwarepatents in the EU
      ... > inject your code into a routine for which you don't have the source. ... 1st bug in MS win2k source code found after 20 minutes: ...
      (alt.lang.asm)
    • Re: Patching in code
      ... > execution path at runtime, so that I don't have to call functions? ... I have various implementations of a particular ... 1st bug in MS win2k source code found after 20 minutes: ...
      (comp.lang.asm.x86)
    • Re: Syscall problem
      ... Sommers" writes: ... >> the problem is that my program produces a segmentation fault but I ... 1st bug in MS win2k source code found after 20 minutes: ...
      (alt.lang.asm)