flat assembler
Message board for the users of flat assembler.

Index > Windows > PUSH/POP Problem

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
I mean without itoa.. I've tried this code but doesn't seems to work. something like
Code:
asdf db 10
mov dword [asdf],ecx    

but I get smile icons or something like that instead of 1, 2, 3, 4.. isn't there any way like this ?
Post 25 Sep 2010, 08:04
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
Overflowz wrote:
I mean without itoa.. I've tried this code but doesn't seems to work. something like
Code:
asdf db 10
mov dword [asdf],ecx    

but I get smile icons or something like that instead of 1, 2, 3, 4.. isn't there any way like this ?
The CPU does not have any instruction for converting a binary number into ASCII text.
Post 25 Sep 2010, 08:09
View user's profile Send private message Visit poster's website Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
eh Sad Ok. I'll think something like that later. Thanks for reply. Smile
Post 25 Sep 2010, 08:21
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
revolution wrote:
The CPU does not have any instruction for converting a binary number into ASCII text.
Well, it have fbstp. The rest is almost trivial. Wink
Post 25 Sep 2010, 08:55
View user's profile Send private message Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
Can you write little example of that please ? Razz
Post 25 Sep 2010, 09:44
View user's profile Send private message Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
I'll make new thread. with apposite name.
Post 25 Sep 2010, 09:51
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
baldr wrote:
revolution wrote:
The CPU does not have any instruction for converting a binary number into ASCII text.
Well, it have fbstp. The rest is almost trivial. Wink
I not so sure that BCD to ASCII conversion would be any easier than direct binary to ASCII.
Post 25 Sep 2010, 10:31
View user's profile Send private message Visit poster's website Reply with quote
Nameless



Joined: 30 Apr 2010
Posts: 95
Nameless
@windwakr: mannnnnnnnn............. I LOVE YOUR COMMENTING <3

another API for the stubborn Razz
Code:
invoke wsprintf, itdb, "%d", eax
    
Post 25 Sep 2010, 13:07
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
Nameless wrote:
@windwakr: mannnnnnnnn............. I LOVE YOUR COMMENTING <3

another API for the stubborn Razz
Code:
invoke wsprintf, itdb, "%d", eax
    
wsprintf is also a cdecl function. You need to use cinvoke there also.
Post 25 Sep 2010, 13:11
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
revolution wrote:
I not so sure that BCD to ASCII conversion would be any easier than direct binary to ASCII.
Consider these:
  • Sign is already isolated.
  • You can do it bytewise.
  • It can handle up to 64 bits at once.
Not the fastest, probably.
Post 25 Sep 2010, 13:44
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
The odd/even nibble thing and the leading zero detection are tricky to get right.
Post 25 Sep 2010, 13:56
View user's profile Send private message Visit poster's website Reply with quote
Overflowz



Joined: 03 Sep 2010
Posts: 1046
Overflowz
Yeh, I need stdcall function only Sad
Post 25 Sep 2010, 14:16
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17714
Location: In your JS exploiting you and your system
revolution
Overflowz: Is this your homework?
Post 25 Sep 2010, 14:35
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.