title: PC out of valid memory range
body: <p>I'm trying to write an ARM Assembly program that opens and reads integers from a file. I am extremely new to ARM and do not think I fully understand whats going on here, any help would be greatly appreciated.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code> @ ========= Open file for reading =============================
   ldr r0,=inputFile        
   mov r1,#0       
   swi 0x6c          @ open file
   bcs InFileError       @ if cannot open file branch to InFileError 
   ldr r1,=InputFileHandle
   str r0,[r1]
  
   inputFile: .asciz "integers.dat"
   InputFileHandle: .word 0
  
   InFileError:
   ldr r1, =FileOpenErrorMsg
   swi 0x02 @ display error
   bal Exit
  
   FileOpenErrorMsg: .asciz "Error opening file."
  
   Exit:
   swi 0x68   @ close file 
  </code></pre>
  
  <p>This is what I get when I try to run in ARMSim#:</p>
  
  <pre><code>PC Out of valid memory range, address 00011400
  
  R0 :4140
  R1 :4172
  ... (all 0)
  R8 :37484
  ...
  R13 :21504
  R15 :70656
  </code></pre>