title: Placing subroutines in separate files in arm assembly using the keil IDE
body: <p>I am new to ARM Assembly programming using Keil 4, I have been trying to assemble two subroutines in assembly files. One of the subroutines calls the other.</p>
  
  <p> </p>
  
  <p>Calling (Branching) a subroutine placed within the same file works, but, if one subroutine is placed in a separate file the following error message comes up</p>
  
  <p></p>
  
  <p><code>file2.s(8): error: A1163E: Unknown opcode SUBROUTE , expecting opcode or Macro</code></p>
  
  <p>The code is appended below</p>
  
  <p><strong>FILE 1</strong><br>
  ;; Directives
           PRESERVE8
           THUMB
           UNIFIED  </p>
  
  <pre><code>      AREA    RESET, DATA, READONLY
        EXPORT  __Vectors
        __Vectors 
        DCD  0x20001000     ; stack pointer value when stack is empty
        DCD  Reset_Handler  ; reset vector
        ALIGN
  
      AREA    MYCODE, CODE, READONLY
      IMPORT SUBROUTE 
      ENTRY
      EXPORT Reset_Handler 
      Reset_Handler
  
                   MOV R1, #0x0A      ; Set loop counter
                   MOV R0,#00         ;intilaize resultant register
  
        loop1 CBZ R1,FINISH       ; if loop counter = 0 then exit the loop
        BL     SUBROUTE
        B loop1           ; next loop         
        FINISH    B FINISH            ; keep looping 
        END                   ; end of program
  </code></pre>
  
  <p><strong>FILE 2 :</strong></p>
  
  <pre><code>  AREA   subroutine, CODE, READONLY
            EXPORT SUBROUTE
   SUBROUTE   ADD R0,R1           ; Addition opertaion
              SUB R1, #1          ; loop counter decrement
              BX lr
              END
  </code></pre>