Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"spim: (parser) syntax error on line [...]" where i used the label .byte

When I'm programming in assembly and use the label .byte, I have a problem executing it with Qtspim. I tried to change the position or the value, but the problem persists and, probably, is the label.

The error reply was on line 3. At the end of the label you find the parser.

main:

.data
  v    : .byte 2,0,0,0,4,0,0,0
  array: .byte 2,0,0,0,3,0,0,0,5,0,0,0,7,0,0,0,11,0,0,0,13,0,0,0,17,0,0,0,19,0,0,0

[..] # other code

When I change the directive .byte to .space the problem does not occur.

How could I resolve it?

like image 472
Andrea Avatar asked Oct 31 '22 04:10

Andrea


1 Answers

The issue is that at least QtSpim requires the arrays to have space after the commas. So this will work just fine:

.data
v:  .byte 2, 0, 0, 0, 4, 0, 0, 0

Just remember to add a space after each value.

The reason for this is that the parser QtSpim uses allows the use of a comma or a dot as decimal separator. So it is confused about your definition unless there is a space to separate.

This would be allowed for defining a float:

flo:  .float 2,2
like image 114
Sami Kuhmonen Avatar answered Nov 15 '22 12:11

Sami Kuhmonen