flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > An awful-looking [DISPLAYINT] (Share)

Author
Thread Post new topic Reply to topic
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 01 Feb 2015, 10:45
Code:
macro displayint y {
  local x
  x = y
  if x < 0
    x = -x
    display '-'
  end if
  irp t,10000000000000000000,1000000000000000000,100000000000000000,10000000000000000,1000000000000000,100000000000000,10000000000000,1000000000000,100000000000,10000000000,1000000000,100000000,10000000,1000000,100000,10000,1000,100,10 \{
    if x >= t
      display (x/t) mod 10 + 48
    end if
  \}
  display x mod 10 + 48
}        
[/code]
Post 01 Feb 2015, 10:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20405
Location: In your JS exploiting you and your system
revolution 02 Feb 2015, 03:21
I had a problem with this:
Code:
displayint not 18446744073709551615
An awful-looking [DISPLAYINT] (Share).asm [5] displayint [4]:
    x = -x
error: value out of range.    
Post 02 Feb 2015, 03:21
View user's profile Send private message Visit poster's website Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 674
l4m2 02 Feb 2015, 04:19
revolution wrote:
I had a problem with this:
Code:
displayint not 18446744073709551615
An awful-looking [DISPLAYINT] (Share).asm [5] displayint [4]:
    x = -x
error: value out of range.    

So you'd better make it a special case if you need this value
Post 02 Feb 2015, 04:19
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.