[SOLVED] Unexpected characters at end of line

Issue

This Content is from Stack Overflow. Question asked by Dylan de Hoyos

I Writing a code that loops 1000 times in assembly language, although I keep getting these errors:

main.s(48): error: A1137E: Unexpected characters at end of line
main.s(53): error: A1137E: Unexpected characters at end of line
main.s(55): error: A1163E: Unknown opcode endloop , expecting opcode or Macro
".SimpleProject.axf" - 3 Error(s), 0 Warning(s).

Here is an Example of my code:

MOV R0, #1, i = 1;
startloop   
    cmp R0, #1000
    BGT endloop
    ADD R1, R1, R0
    ADD R0, R0, #1, i++;
    B startloop
    endloop



Solution

Try changing the erroneous line to:

MOV R0, #1

Clearly i = 1; was supposed to be a comment, but you accidentally typed a comma instead of whatever comment character is supported by your assembler. Read the documentation of your assembler to learn comment syntax.


This Question was asked in StackOverflow by Dylan de Hoyos and Answered by David Grayson It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?