flat assembler
Message board for the users of flat assembler.

Index > Main > (Re)Learning FASM and programming

Author
Thread Post new topic Reply to topic
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 31 Oct 2011, 11:20
Hi,

I've been away for a while and am now getting back into programming again. I've been putting together my OS again and was trying to make a boot loader for a CD-ROM and was working on the checksum word type. I get an error with this:

Code:
dw ("Sm" + "id" + "dy")    


Error: value out of range.

However, not with this:

Code:
dw ("Sm" + "id")    


I assume it is wrapping out of bounds. How can I add up a group of words on compile such that I only get the resultant word value?
Post 31 Oct 2011, 11:20
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20335
Location: In your JS exploiting you and your system
revolution 31 Oct 2011, 11:26
Code:
dw ("Sm" + "id" + "dy") and 0xffff    
Post 31 Oct 2011, 11:26
View user's profile Send private message Visit poster's website Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 557
smiddy 31 Oct 2011, 12:08
Thanks!

EDIT: Dah! Smile It will come back to me, I hope. Very Happy
Post 31 Oct 2011, 12:08
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.