flat assembler
Message board for the users of flat assembler.

Index > Windows > Printing numbers in Windows

Author
Thread Post new topic Reply to topic
Stancliff



Joined: 30 Jun 2024
Posts: 54
Location: Florida
Stancliff 30 Aug 2024, 17:12
I could use some advice or a couple of examples in fasm of converting binary numbers and displaying them in win32. Are there functions or macros that do this?
Post 30 Aug 2024, 17:12
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20339
Location: In your JS exploiting you and your system
revolution 30 Aug 2024, 23:55
What are you displaying to, a GUI window, the console, a file, a socket, to memory?

What base are you converting to?

Do you want to use inbuilt APIs like wsprintf or you want to write your own conversion code?

What numbers are you dealing with, 32/64 bit, arbitrary precision? Integer or float?
Post 30 Aug 2024, 23:55
View user's profile Send private message Visit poster's website Reply with quote
Stancliff



Joined: 30 Jun 2024
Posts: 54
Location: Florida
Stancliff 31 Aug 2024, 00:27
displaying to edit control.
base can vary, mainly 10 and hex.
inbuilt is easier to trust, but I have guidance for my own formatting code if I need to make my own.
In that case I would convert to a string and just print that.
32 bit int, signed and unsigned, might need float in a few months.
Post 31 Aug 2024, 00:27
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4042
Location: vpcmpistri
bitRAKE 31 Aug 2024, 09:04
This is probably the most requested topic on the board - dozens of threads regarding conversion between various units:

Most recent thread ...
https://board.flatassembler.net/topic.php?t=22978

Float
https://board.flatassembler.net/topic.php?t=9338

Hexadecimal
https://board.flatassembler.net/topic.php?t=9432

Searching the board sometimes is more effective through external search engines.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 31 Aug 2024, 09:04
View user's profile Send private message Visit poster's website Reply with quote
uu



Joined: 20 Jul 2024
Posts: 44
uu 31 Aug 2024, 09:11
ShowHex routine by the author of flat assembler himself, which is widely used in my programs.

https://board.flatassembler.net/topic.php?p=219984#219984
Post 31 Aug 2024, 09:11
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.