flat assembler
Message board for the users of flat assembler.

Index > Main > [solved] Undefined symbol

Author
Thread Post new topic Reply to topic
AE



Joined: 07 Apr 2022
Posts: 29
AE
Can you tell me what is causing these strange compiler errors
undefined symbol B8h (C3h)
Code:
Bad   db B8h, C3h ; Errors
Good  db 184, 195 ; Same values with no errors    


Last edited by AE on 10 Apr 2022, 22:55; edited 3 times in total
Post 10 Apr 2022, 22:48
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18591
Location: In your JS exploiting you and your system
revolution
Code:
db 0B8h, 0C3h    
All numbers have to start with a digit 0-9.

If you start with a letter a-z then it is a label.
Code:
B8h = 12345 ; label name "B8h"    
Post 10 Apr 2022, 22:51
View user's profile Send private message Visit poster's website Reply with quote
AE



Joined: 07 Apr 2022
Posts: 29
AE
Got it, Thanks Smile
Post 10 Apr 2022, 22:54
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7999
Location: Kraków, Poland
Tomasz Grysztar
Interestingly, if you used fasm 1.0, that code would be assembled correctly (but you would be missing a whole lot of other features). The earliest versions of fasm expected hexadecimal digits in upper case, with "h" modifier in lower case, and a leading decimal digit was not necessary. For example "Ah" would be considered a number, while "ah" was a register. It was a bad design and I changed it starting with 1.04 release (the same one that introduced the PE output format).
Post 11 Apr 2022, 14:59
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 466
Location: Ukraine
Overclick
revolution wrote:
Code:
db 0B8h, 0C3h    
All numbers have to start with a digit 0-9.

If you start with a letter a-z then it is a label.
Code:
B8h = 12345 ; label name "B8h"    

Or like this
Code:
db 0xB8, 0xC3    
Post 11 Apr 2022, 15:21
View user's profile Send private message Visit poster's website Reply with quote
AE



Joined: 07 Apr 2022
Posts: 29
AE
Overclick wrote:

Or like this
Code:
db 0xB8, 0xC3    

Indeed, Thx!
Post 11 Apr 2022, 17:33
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 541
Location: Russia
macomics
or
Code:
db $B8, $C3    
Very Happy
Post 11 Apr 2022, 18:58
View user's profile Send private message Reply with quote
AE



Joined: 07 Apr 2022
Posts: 29
AE
macomics wrote:
or
Code:
db $B8, $C3    
Very Happy

Yea, I don't use it for a rather silly reason - the syntax highlighting in sublime4 breaks Very Happy


The package that I use
Post 11 Apr 2022, 19:08
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1026
Location: Belarus
DimonSoft
Tomasz Grysztar wrote:
Interestingly, if you used fasm 1.0, that code would be assembled correctly (but you would be missing a whole lot of other features). The earliest versions of fasm expected hexadecimal digits in upper case, with "h" modifier in lower case, and a leading decimal digit was not necessary. For example "Ah" would be considered a number, while "ah" was a register. It was a bad design and I changed it starting with 1.04 release (the same one that introduced the PE output format).

Hmmm. At the same time many people consider a programming language being case-insensitive a bad design. Like those Pascal/Delphi haters. So, why is case-insensitivity “bad” for identifiers but “good” for integer literals, especially when they get mixed with identifiers? IT worldwide need a great review.

AE wrote:
Yea, I don't use it for a rather silly reason - the syntax highlighting in sublime4 breaks

If a tool doesn’t work right, I throw out the tool. Although I once saw a C coding style guide where the rule of indentation or curly braces’ placement was explained by the existence of some auxiliary tool that screwed up if the author didn’t follow the rule suggested. IT worldwide need a great review.
Post 12 Apr 2022, 08:36
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18591
Location: In your JS exploiting you and your system
revolution
Python indentation is not optional, it is a requirement.
Post 12 Apr 2022, 09:02
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.