Author Topic: print a number  (Read 23188 times)

nobody

  • Guest
print a number
« on: December 20, 2007, 06:40:59 PM »
hello,
i'm wondering how to simply print a number on the screen !
-first when it's in a register
-second when it's in memory (in .bss i suppose)

nobody

  • Guest
Re: print a number
« Reply #1 on: December 21, 2007, 01:03:46 AM »
> hello

Wrong forum.

> -first when it's in a register

Set up a limit (maybe 999 for start), set up a string buffer, fill it with "000" , start trying to subtract 100's from the register, for every successful subtraction increase the digit in your buffer, when 100's are done, move to 10's, finally just copy the 1's ;-)

> -second when it's in memory (in .bss i suppose)

Load into a register ?

nobody

  • Guest
Re: print a number
« Reply #2 on: January 02, 2008, 08:36:18 PM »
Here is an example of how to do this.  Hope it helps!

http://www.xs4all.nl/~smit/exdec.zip

nobody

  • Guest
Re: print a number
« Reply #3 on: January 02, 2008, 11:24:04 PM »
> Here is an example of how to do this.

YES. Works. It had some MA$M junk inside, however -> fixed:

http://www.file-pasta.com/file/1199315912.6563_NEWEXDEC.ZIP

Note the 7-times smaller EXE size (COM would be even smaller) - the war on bloat must go on :-D