flat assembler
Message board for the users of flat assembler.

Index > Main > Value out of range for '\r' and undefined symbol h suffix

Author
Thread Post new topic Reply to topic
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 03 Nov 2020, 11:15
Hi.

Problem 1:

This line gives me "value out of range." error:
Code:
mov al, '\r'    


I was pretty sure fasm would escape that and put the byte value. But I get that error. Does that really don't work as I expected?

----

Problem 2:

This gives me "undefined symbol 'AA55h'." error:
Code:
dw AA55h    

But 1.2.4 Numerical expressions section says we can use h sufix.

_________________
Sorry if bad english.
Post 03 Nov 2020, 11:15
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20446
Location: In your JS exploiting you and your system
revolution 03 Nov 2020, 12:15
If you want to use the CR character then type it like this:
Code:
mov al,13 ;ASCII CR    
All numbers must start with a digit 0-9. When you have hex numbers then do this:
Code:
dw 0xaa55 ;0x prefix
dw 0aa55h ;h suffix    
Post 03 Nov 2020, 12:15
View user's profile Send private message Visit poster's website Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 03 Nov 2020, 12:27
Oh, ok. Thanks! (sad about the \n tho Sad )
Post 03 Nov 2020, 12:27
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20446
Location: In your JS exploiting you and your system
revolution 03 Nov 2020, 12:39
Teehee wrote:
(sad about the \n tho Sad )
fasm never interprets the contents of strings for any reason. You get exactly what you type.

If you want a longer string with terminating characters then:
Code:
db 'Text string',0xd,0 ;CR and zero termination    
Post 03 Nov 2020, 12:39
View user's profile Send private message Visit poster's website 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.