flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Displaying decimal numbers during assembly time |
Author |
|
edemko 28 Jun 2010, 09:42
Code: format binary as 'txt' times 30: db 'good luck - ',(%/10) mod 10 + '0',(%/1) mod 10 +'0',10 |
|||
28 Jun 2010, 09:42 |
|
revolution 28 Jun 2010, 09:46
edemko wrote: (%/1) |
|||
28 Jun 2010, 09:46 |
|
edemko 28 Jun 2010, 10:49
%======>
hohe |
|||
28 Jun 2010, 10:49 |
|
Tomasz Grysztar 28 Jun 2010, 20:34
|
|||
28 Jun 2010, 20:34 |
|
revolution 28 Jun 2010, 20:53
Tomasz Grysztar wrote: RTFM |
|||
28 Jun 2010, 20:53 |
|
Tomasz Grysztar 28 Jun 2010, 21:19
revolution wrote: There, I fixed it for you. |
|||
28 Jun 2010, 21:19 |
|
edemko 03 Jul 2010, 15:01
Code: ;display 13,10 ;ShowDec %t macro ShowDec value*{ local .value .value = value if .value and $80000000'00000000 <> 0 display '-' .value = not .value + 1 end if display '0'+(.value/1000000000000000000)mod 10,\ '0'+(.value/0100000000000000000)mod 10,\ '0'+(.value/0010000000000000000)mod 10,\ '0'+(.value/0001000000000000000)mod 10,\ '0'+(.value/0000100000000000000)mod 10,\ '0'+(.value/0000010000000000000)mod 10,\ '0'+(.value/0000001000000000000)mod 10,\ '0'+(.value/0000000100000000000)mod 10,\ '0'+(.value/0000000010000000000)mod 10,\ '0'+(.value/0000000001000000000)mod 10,\ '0'+(.value/0000000000100000000)mod 10,\ '0'+(.value/0000000000010000000)mod 10,\ '0'+(.value/0000000000001000000)mod 10,\ '0'+(.value/0000000000000100000)mod 10,\ '0'+(.value/0000000000000010000)mod 10,\ '0'+(.value/0000000000000001000)mod 10,\ '0'+(.value/0000000000000000100)mod 10,\ '0'+(.value/0000000000000000010)mod 10,\ '0'+(.value/0000000000000000001)mod 10 ;for revolution purposes :b } |
|||
03 Jul 2010, 15:01 |
|
revolution 03 Jul 2010, 16:30
edemko wrote:
edemko wrote: ;for revolution purposes :b |
|||
03 Jul 2010, 16:30 |
|
revolution 04 Jul 2010, 02:19
edemko wrote:
Code: macro ShowDec value*{ local .value .value = value if .value and $80000000'00000000 <> 0 display '-' .value = not .value + 1 end if display '0'+(.value/1000000000000000000)mod 10,\ '0'+(.value/0100000000000000000)mod 10,\ '0'+(.value/0010000000000000000)mod 10,\ '0'+(.value/0001000000000000000)mod 10,\ '0'+(.value/0000100000000000000)mod 10,\ '0'+(.value/0000010000000000000)mod 10,\ '0'+(.value/0000001000000000000)mod 10,\ '0'+(.value/0000000100000000000)mod 10,\ '0'+(.value/0000000010000000000)mod 10,\ '0'+(.value/0000000001000000000)mod 10,\ '0'+(.value/0000000000100000000)mod 10,\ '0'+(.value/0000000000010000000)mod 10,\ '0'+(.value/0000000000001000000)mod 10,\ '0'+(.value/0000000000000100000)mod 10,\ '0'+(.value/0000000000000010000)mod 10,\ '0'+(.value/0000000000000001000)mod 10,\ '0'+(.value/0000000000000000100)mod 10,\ '0'+(.value/0000000000000000010)mod 10,\ '0'+(.value/0000000000000000001)mod 10 ;for revolution purposes :b } ShowDec 1 shl 63 Code: C:\Documents and Settings\We Are The Borg\Our Documents>fasm ShowDec.asm flat assembler version 1.69.14 (165436 kilobytes memory) -922337203*(+,))+(0( 1 passes, 0 bytes. See here for a version that works. |
|||
04 Jul 2010, 02:19 |
|
edemko 04 Jul 2010, 06:09
Code: ;cool: if number<0 ;that is (if number and $80000000'00000000), that is (if BT number,63) ;cool: number=number-10000000000000000000 ; 18 446 744 073 709 551 615 ;- 10 000 000 000 000 000 000 ;= 08 446 744 073 709 551 615 ;cool: number=-number ;better then my (number = not number +1) :^ ShowDec: Code: _ fix (9'223'372'036'854'775'808/ __ fix )mod 10+'0' /* display _ 1'000'000'000'000'000'000 __ display _ 1'000'000'000'000'000'00 __ display _ 1'000'000'000'000'000'0 __ display _ 1'000'000'000'000'000 __ display _ 1'000'000'000'000'00 __ display _ 1'000'000'000'000'0 __ display _ 1'000'000'000'000 __ display _ 1'000'000'000'00 __ display _ 1'000'000'000'0 __ next errors come, how does fasm divide? */ display _ 1'000'000'000 __ display _ 1'000'000'00 __ display _ 1'000'000'0 __ display _ 1'000'000 __ display _ 1'000'00 __ display _ 1'000'0 __ display _ 1'000 __ display _ 1'00 __ display _ 1'0 __ display _ 1 __ |
|||
04 Jul 2010, 06:09 |
|
revolution 04 Jul 2010, 06:22
edemko wrote: number=-number ;better then my (number = not number +1) negative / positive = negative This has been split into a separate topic. Originally from here. |
|||
04 Jul 2010, 06:22 |
|
edemko 04 Jul 2010, 10:53
I wish fasm getting next operators before next release: shl/shr performing unsigned, sal/sar - signed, idiv/div - respectively as the CPU does. There will be no arguments of principles. Tomasz take me serious this time as mostly i'm not. Tomasz i hope. I hope. It's cool you are not a MS or any other company - easy to ask. Life.
|
|||
04 Jul 2010, 10:53 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.