flat assembler
Message board for the users of flat assembler.

Index > Main > value out of range (macro)

Author
Thread Post new topic Reply to topic
randomdude



Joined: 01 Jun 2012
Posts: 83
randomdude
Code:
local ..char,..count
        ..count = 0
        repeat size
                load ..char byte from start+%-1
                ..char = ..char + ..count
                ;if ..char > 255
                ;        ..char = 255
                ;end if
                store byte ..char at start+%-1
                ..count = ..count + 1
        end repeat     


how can i allow ..char + ..count to overflow without popping up that error? Embarassed
Post 17 Feb 2013, 18:56
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17661
Location: In your JS exploiting you and your system
revolution
Perhaps using AND will work for you?
Code:
..char = (..char + ..count) and 0xff    


Last edited by revolution on 17 Feb 2013, 19:58; edited 1 time in total
Post 17 Feb 2013, 19:15
View user's profile Send private message Visit poster's website Reply with quote
randomdude



Joined: 01 Jun 2012
Posts: 83
randomdude
perfect!! thanks Very Happy
Post 17 Feb 2013, 19:33
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.