-
Notifications
You must be signed in to change notification settings - Fork 0
Errors
A character not part of the character set has been reached. Makes sure you didn't mistype.
Example:
begin: ; § will trigger the L001 error mov §, 1
\a, \b, \f, \n, \r, \t, \v, \0
are the only escape sequences possible in a string. You can also escape the escape character \\
.
Example:
str: db "String\u" ; \u is not a valid escape sequence, and L002 will be triggered
0b, 0x, 0o, 0d
are the only valid prefix for numbers literals.
Example:
begin: mov @A, 0h1234 ; 0h is not a valid prefix, L003 will be triggered
This error happened when a character is not part of the base's set.
-
0b
must be followed by one or more0, 1
-
0o
must be followed by one or more0..7
-
0x
must be followed by one or more0..9, A..F
(case insensitive) -
0d
and numbers without prefix must be followed by one or more0..9
Example:
begin: mov @A, 0o8552 ; 8 is not part of octal's character set, so L004 is triggered mov @A, 0x22GG ; G is not part of hexadecimal's character set
The identifier following @
must be a register name: A..L, SP, BP, PC, FG
(case insensitive).
Example:
begin: mov @r, 1337 ; r is not a register, so L005 is triggered
Floating numbers can only be in base 10. This error can also happen if you put two points or if the number starts or end by a point.
Example:
begin: mov @a, 0x2.3 ; not in base 10 mov @a, 0d12.23.45 ; multiple points mov @a, .2, 0., 0d.1 ; starts/end by a point
After a prefix, you must write a number.
Example:
begin: mov @a, 0x ; no number after the prefix, so L007 is triggered
After a @
, you must writes a register.
Example:
begin: mov @, 0x1 ; no register after '@', L008 is triggered
The instruction is not part of the set of instructions. You can get the list of instructions here.
Example:
begin: movv @a, @b ; movv is not a valid instruction
After a comma, you need an expression.
Example:
begin: mov @a, @b, ; trailing comma is not allowed
You must continue on a new line after a label declaration.
Example:
begin: mov @a, @b ; not allowed
This directive is not part of the directive list, you can find the list here.
Example:
# something ; something is not valid
Alignment directive must be followed by a number power of 2.
Example:
# align 5 ; 5 is not a power of 2 # align oops ; oops is not a number
Strings can only appear in the data section, you can, however, use characters literals as numbers in expressions (1 + "a"
or 1 + 'a'
).
Example:
begin: mov @a, "hello world" ; string not in data section mov @a, "ok" + 2 ; string expression
Registers cannot appear in constant expressions. Constants expression are used as a displacement, as an argument, and in the data section.
Example:
data: db @a ; error, register in data section begin: inc @a + 2 ; error, register in constant expression lea @a, [@b + @c] ; error, register in displacement