0

I'm currently trying to place a for loop (which is not complete) inside of an if statement and I'm now receiving this error.

"Assembly_Lab_04.s", line 16 (column 3): Error: A1163E: Unknown opcode loop , expecting opcode or Macro

16 0000001c loop

 __main
    
    MOV R0, #0
    MOV R1, #3
    MOV R2, #15
    MOV R3, #0
    MOV R4, #0
    MOV R5, #0
    
    CMP R1, R2
    BLE goToIf

        loop
        ADD R4, R1, R2
        ADD R3, R3, R4
        CMP R5, R1
        ADDLE R0, R0, #1
        BLE loop

goToElse
    ADD R3, R1, R2
    
    END
Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • 1
    put labels like `loop` at the beginning of the line, no preceding spaces – Erik Eidt Mar 07 '22 at 17:10
  • 1
    Although many people will notice you're writing ARM assembly looking at your code, you have to specify what machine architecture you're dealing with. There is no just *assembly* language. – xiver77 Mar 07 '22 at 17:30
  • 2
    If that doesn't work, following the label with a `,` or a `:` might work, as in `loop,` or `loop:` – Erik Eidt Mar 07 '22 at 17:43
  • Related: [Error: A1163E Unknown Opcode R0, expecting opcode or Macro with instruction in the left column](https://stackoverflow.com/q/36253531) - seems the assembler that uses that error-number cares about indenting to distinguish label from mnemonic. – Peter Cordes Mar 07 '22 at 19:16

0 Answers0