Forum: ARM programming with GCC/GNU tools Jump tables for gcc-arm cross compiler

von Farhan (Guest)

Attached files:

Rate this post
0 useful
not useful
I would really appreciate if some one could tell me how to initiate jump 
tables for gnu arm assembler. I have written the below code at the end 
of my .s file. I have tried all sorts of things (using .align, .p2align, 
.long etc) but i can't get the _input_case_table to get the 4 byte 
addresses for str_help and str_sum. Assuming input starts at 0x100e4 
memory in the debugger, I have reproduced the 32 byte memory location 
following it.
 * --- Data follows ---

/* Let's pretend this command was entered by the user */
input:  .ascii "sum"
  .byte 0, 0, 0, 0, 0
  .ascii "HELP"
  .byte 0, 0, 0, 0
  .ascii "SUM"
  .byte 0, 0, 0

/* Recognized commands */
  .word  str_sum
  .word  str_help

Attached in file

I am using the gcc-4.6-linux-arm-gnueabi compiler tool chain. Using 
gdb-multiarch with architecture set to armv4.
I am still new to this so any guidance would be much appreciated.

To reiterate my question, im tyring to compile code for armv4 32bit 
processor mode. I know how alignment and 'DCD' statements work but for 
Keil Development tools only. I would really appreciate if some one could 
point me how to do the using the GNU assembler.

von Kindergärtner (Guest)

Rate this post
0 useful
not useful
Maybe try:
  .word  =str_sum
  .word  =str_help

von Marc P. (marcvonwindscooting)

Rate this post
0 useful
not useful
Did you find out?

Surprisingly, I use your style since years, successfully.
Most recently for LPC800:
        initialSP:      .word   0
        initialPC:      .word   _start+1

.global _start
The only difference is the presence of the labels.


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.