Author Topic: ARM assembler syntax query  (Read 1214 times)

0 Members and 1 Guest are viewing this topic.

Offline AussieBruceTopic starter

  • Regular Contributor
  • *
  • Posts: 77
  • Country: au
ARM assembler syntax query
« on: March 30, 2022, 09:17:26 am »
Hi,  I'm wading through a heap of system assembler files to sort out an IRQ problem on an ARM-7 target. Included is the following, they look like memory allocations.  I can't find any reference to the 'b', is it shorthand for 'byte'? In fact, from the module context these should be  exception/interrupt vectors,  more than 8 bits. What do these lines do?

undef_handler:
  b undef_handler
 
swi_handler:
  b swi_handler
 
pabort_handler:
  b pabort_handler
 

 

Offline retiredfeline

  • Frequent Contributor
  • **
  • Posts: 572
  • Country: au
Re: ARM assembler syntax query
« Reply #1 on: March 30, 2022, 09:20:40 am »
Maybe branch unconditionally, i.e. handlers are infinite loops?
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
Re: ARM assembler syntax query
« Reply #2 on: March 30, 2022, 09:21:03 am »
“B” is “branch” (unconditional)
You are looking at tiny little default interrupt handlers that are short infinite loops.
 

Online abyrvalg

  • Frequent Contributor
  • **
  • Posts: 852
  • Country: es
Re: ARM assembler syntax query
« Reply #3 on: March 30, 2022, 09:35:12 am »
To clarify a bit: on ARM7 the vector table doesn’t hold addresses (unlike Cortex-M etc), the CPU jumps right into the table and each entry is a single instruction (so it is typical to use either “B real_handler” or “LDR PC, =real_handler”).
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16367
  • Country: fr
Re: ARM assembler syntax query
« Reply #4 on: March 30, 2022, 05:36:48 pm »
Maybe branch unconditionally, i.e. handlers are infinite loops?

Yes. This is not maybe, this is for sure.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9988
  • Country: us
Re: ARM assembler syntax query
« Reply #5 on: March 30, 2022, 05:46:01 pm »
Sometimes you will see something like:

b 1b

This is a branch to the label 1 backward

b 1f is a branch to label 1 forward

https://stackoverflow.com/questions/27353096/1b-and-1f-in-gnu-assembly
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf