flat assembler
Message board for the users of flat assembler.
Index
> Linux > How do I print integers, not their ASCII equvalent? |
Author |
|
f0dder 22 Jul 2007, 16:48
You need to convert the integer to a string manually - use the age-old "divide and conquer" method, keep dividing by 10 and using the modulus until the source number is zero.
|
|||
22 Jul 2007, 16:48 |
|
rugxulo 25 Jul 2007, 02:17
|
|||
25 Jul 2007, 02:17 |
|
linux0id 26 Jul 2007, 09:00
Thanks all of you for your help! I am a noob in programming (just basic knowledge of FORTRAN), so it will take a a while to think through the code in those threads that rugxulo gave me.
|
|||
26 Jul 2007, 09:00 |
|
MCD 25 Oct 2007, 17:28
f0dder wrote: You need to convert the integer to a string manually - use the age-old "divide and conquer" method, keep dividing by 10 and using the modulus until the source number is zero. What you mean is not divide-and-conquer in a "usual" sense, it's a plain iterative algorithm, usually called something like "Horner number base" algorithm |
|||
25 Oct 2007, 17:28 |
|
f0dder 25 Oct 2007, 23:17
True, divide-and-conquer is more appropriately used to describe things like binary search. You do use division to conquer this task, though
|
|||
25 Oct 2007, 23:17 |
|
rob.rice 05 Dec 2007, 09:40
there is an example subroutine to do just this in the fasm source code
it's in the system.inc file the subroutine is labeled display_number: use the force read the source |
|||
05 Dec 2007, 09:40 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.