flat assembler
Message board for the users of flat assembler.
Index
> Main > format string for FASMLIB "printf" |
Author |
|
vid 24 Jan 2007, 13:57
maybe signed could be specified with "%-h"? Or other special char as prefix?
|
|||
24 Jan 2007, 13:57 |
|
flaith 24 Jan 2007, 14:43
that sounds very interesting,
for the signed numbers, i like the "%u" way ! BTW do you plan to add unicode too ? thx _________________ Je suis sur de 'rien', mais je ne suis pas sur du 'tout'. |
|||
24 Jan 2007, 14:43 |
|
vid 24 Jan 2007, 14:51
flaith: so you like "%d" and "%h" to print signed numbers by default?
about unicode, i am not sure yet. If it is supported widely on linux, i might think about it. |
|||
24 Jan 2007, 14:51 |
|
flaith 24 Jan 2007, 15:56
vid wrote: flaith: so you like "%d" and "%h" to print signed numbers by default? Well i like it, but i'm not sure that's the right way. I think it'll be better to use the "C" format _________________ Je suis sur de 'rien', mais je ne suis pas sur du 'tout'. |
|||
24 Jan 2007, 15:56 |
|
vid 24 Jan 2007, 17:41
Quote: I think it'll be better to use the "C" format nope. in C you have "int", "short", "long", and no idea how big they are. completely unusable in asm. |
|||
24 Jan 2007, 17:41 |
|
Tomasz Grysztar 24 Jan 2007, 19:18
I too would prefer the unsigned to be default.
And for specifying signed I would suggest the "i" letter (like in IMUL instruction): %id, %ih, etc. |
|||
24 Jan 2007, 19:18 |
|
vid 25 Jan 2007, 08:25
allright, here is newest proposal:
% can be followed by: - optional "0" to pad with zeroes - optional decimal padding size (eg. "%15d", "%08h") - optional "i" for signed (eg, "%id", "%ih") - optional "." and decimal number to specify number of decimal places for "f" (eg. "%.4f", "%04.5f") - optional "p" to say argument is POINTER to type (useful for bytes, words, qwords and tenbytes) followed by optional size modifier: - "b" as byte - "w" as word - "q" as qword (will not be supported yet) - "t" as pointer to ten-byte (80bit, double-extended precision floating, not supported yet) if none is specified, dword is default followed by type: - "d" for decimal number - "h" or "x" for hexadecimal number - "c" for char - "s" for constant string (without buffer length) - "S" for string buffer (2 dwords: string pointer, buffer length) - "f" for floating point value as decimal (will not be supported yet) what do you think about it? except "S" for string buffer, i like it |
|||
25 Jan 2007, 08:25 |
|
flaith 25 Jan 2007, 08:56
_________________ Je suis sur de 'rien', mais je ne suis pas sur du 'tout'. |
|||
25 Jan 2007, 08:56 |
|
revolution 25 Jan 2007, 10:36
I think to avoid having to learn another sting format layout it would be a good idea to keep the existing 'C' style as much a possible by only adding functionality and not redefining existing escape sequences. This makes code movement from one language to the other easier.
So much code is already written in 'C' we cannot go too far off the beaten track else we will get confused when reading the different codes. |
|||
25 Jan 2007, 10:36 |
|
vid 25 Jan 2007, 11:16
revolution: yes, i know this is a problem. But could you give me example how to keep up with C?
for example: - Decimal qword should be "ld" or "lld"? And what does "l" or "ll" say to assembly programmer? - How about dword / (pointed/double-pushed) qword / (pointed) tbyte floating point number? - Do you think signed decimals should be default, and "u" used for unsigned? - Do you think there is no need for signed hexadecimal output in assembly? These were main problems. And I just couldn't work out any way to merge C syntax and requirements of assembly code. |
|||
25 Jan 2007, 11:16 |
|
vid 25 Jan 2007, 11:19
revolution: yes, i know this is a problem. But could you give me example how to keep up with C?
for example: - Decimal qword should be "ld" or "lld"? And what does "l" or "ll" say to assembly programmer? - How about dword / (pointed/double-pushed) qword / (pointed) tbyte floating point number? - Do you think signed decimals should be default, and "u" used for unsigned? - Do you think there is no need for signed hexadecimal output in assembly? These were main problems. And I just couldn't work out any way to merge C syntax and requirements of assembly code. |
|||
25 Jan 2007, 11:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.