This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Assembler references for STM32F103

Hi Guys, can someone point me in the right direction for assembler programming on the STM32F103. I've been programming ATmega chips for years now in Assembler and now have started on ARM. I just love the instructions like this ADD R0,R0,R1 So easy :)

So any assembler references, listing etc would be much appreciated.

Also, how would I go about switching bits on ports ON & OFF?

On ATmega the syntax is
SBI PORTD,PD1 ; SetBit - turns on bit 1 on port D
CBI PORTD,PD1 ; ClearBit - turns off bit 1 on port D

btw, I'm not a C programmer.

Thanks guys
Pete

Parents
  • Hi Guys, can someone point me in the right direction for assembler programming on the STM32F103.

    The same way as on all ARMs, basically. Which is: you almost certainly you don't want to do that. While it would, of course, be possible to program an ARM in assembly, actually doing so would be a excercise in self-inflicted pain in the lower back.

    ARMs are whole lot more complex than the chips you've been using so far. It takes different tools to use them efficiently. Assembly is no longer one of those tools.

Reply
  • Hi Guys, can someone point me in the right direction for assembler programming on the STM32F103.

    The same way as on all ARMs, basically. Which is: you almost certainly you don't want to do that. While it would, of course, be possible to program an ARM in assembly, actually doing so would be a excercise in self-inflicted pain in the lower back.

    ARMs are whole lot more complex than the chips you've been using so far. It takes different tools to use them efficiently. Assembly is no longer one of those tools.

Children
  • lots of good material on the internet for the educated people who have sufficient competence to write assembler for the arm. you know, instead of the people who just say things like "don't do it" because they are not smart enough to do it themselves. would recommend the book "the definitive guite to the cortex-m3" and on line documents at arm.com

    if you think you can and you are prepared to look and study then you already jumped the first hurdle.

    good luck.

  • Hi Guys, Assembler is not difficult at all. It's just setting registers, just like C and loops, macro's etc, just like in C, it's just written in a different syntax. What I am doing is video generation and I need to count every clock cycle. If your one clock cycle out of time then the video screen will either flicker or jump. You can't count clock cycles in C. The C compiler has it's own routines and I can't use them for video generation.
    Don't get me wrong, C is a damn good language but not for me.
    I'd rather write a programming language called "BASIC" (heard of it?)in ARM assembler and use that instead of C.

    I've also found that ARM assembler and even Thumb is very similar to the old Acorn and Archimedes computers, so I dug up my old Acorn computer from the cupboard and started doing a little assembler on that. Being an old 6502 assembler programmer from the 80's I find that ARM is pretty easy but I guess it's really up to the individual to take on an assembler project using the ARM Cortex M3 CPU.

    And BANDON, hehehehe, your absolutly right :)

    Oh, and thanks everyone for your support.

    Pete

  • Indeed.

    So the answer to your question, "how would I go about switching bits on ports ON & OFF?" has nothing specifically to do with Assembly.

    For that, you need to study ST's RM0008 Reference manual - which gives detailed descriptions of all the STM32F103xx peripherals and their registers...