AT91SAM9263 assembly code

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi there,

  I m a newbie in ARM assembly coding, could anyone kindly advise what the following code is doing? thanks.

 

__main
  MOV R8, #1
  MOV R9, #8
  MOV R10, #1
  MOV R11, #1
  MOV R12, #255
  AND R12, #(1<<3)
while
  LSL R8, R11
  MUL R10, R8,R10
  CMP R8,R9
  BLE while
  ADD R7, R10, R12
stop B stop
  END

Edinburgh

Last Edited: Fri. Jan 21, 2022 - 01:56 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No ARM9 forums here, as good as it gets.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Run it in an emulator and check, looks like it will be a constant computed in R7.

/Lars

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


js wrote:
No ARM9 forums here

As the link says, they moved to: https://www.microchip.com/forums/f540.aspx

 

As it's just plain ARM Assembly, there's ARM's own forums:

 

 

https://community.arm.com/f

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Fri. Jan 21, 2022 - 09:17 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the code supposed to make sense (it doesn’t look like it to me), or is this like a homework problem where you’re supposed to figure out the final register contents?

 

BTW, ARM9 and ARM Cortex assembly languages are about the same, or at least have subsets that are the same.  I’d expect that to assemble fine for a CM3.