3

Given that there are simple and easy to learn/use MCU devices such as those offered by Arduino, Particle, TI (MSP430 series), Microchip (PIC16 series) does it make sense to teach ALP to computer science engineering (CSE) students or for them to learn it?

The way many of my peers and I learnt to use MCU was by actually writing embedded C code and playing around with MCU offering of the companies mentioned above. While some were hobby projects, many were application oriented. Nowhere did we use ALP to configure the MCU.

How does it benefit them to learn the basics of assembly level programming as part of their engineering curriculum? Is there something I'm not accounting for which assists students to learn this subject better?

Scott Seidman
  • 29,274
  • 4
  • 44
  • 109
  • 2
    By ALP I guess you mean assembly level programming, you should add that as soon as you use the abbreviation. I had to read until the end to find out what ALP means. I'd write: "...learn ALP (Assembly Level Programming) in today's..." – Bimpelrekkie Apr 02 '19 at 09:56
  • 1
    For a CS degree, where students may never actually do any embedded programming at all, it's a valid question to ask. Most universities here in the US have moved away from C towards C++ and other languages in their 100 and 200 level CS degree classes, anyway. However, for a CE degree (probably similar to what you mean by CSE) where embedded work is very likely, I think assembly is an essential component. – jonk Apr 02 '19 at 11:03
  • Knowing, from top to bottom, how the computer is controlled, is quite good for confidence building **AND** for contriving (designing) complete computer systems. Thus any embedded system designer will see the bigger picture, because of more complete architectural understanding. – analogsystemsrf Apr 02 '19 at 12:47
  • good discussion in [this question, which juxtaposes assembly and C](https://electronics.stackexchange.com/q/321609/7036) – Nick Alexeev Apr 02 '19 at 14:52
  • Sarcastically, I call C, dirty assembler since many C instructions translate into single assembler instructions. It is hard to know what you will need in a career, so engineering schools try to give you a smattering of the technology of the day. Education proves capability, not ability. If you end up as an embedded programmer, I guarantee you will know assembler even if you never actually directly use it. – StainlessSteelRat Apr 02 '19 at 20:42

1 Answers1

8

Not knowing assembly is just fine UNTIL you have to debug something non trivial.

Interrupt trampolines, interrupt entry and exit stubs, missing memory barriers before cooking off a DMA transfer, compiler bugs, compiler just plain being 'hard of thinking', are all things that are easily tractable if you can read the assembler output (And very hard to debug if you cannot).

I would note that it pretty much does not matter which assembly language you learn, they are mostly pretty similar.

Sooner or later your students are going to have to write a linker script (Maybe as part of some custom boot code), and vector tables and relocations are easier to explain in the context of assembly language.

Also, it is not uncommon to build little special purpose 'CPUs' in a HDL to do some toy stuff in an FPGA or ASIC that is just a little too complex to be easily tractable as a classic small Moore or Meeley machine. Being able to design the opcodes for these really needs the designer to have written assembly language.

I would argue that teaching some minimal assembler first makes C pointers very easy, being as they look kind of like register indirect addressing, and pointer == address register is not wildly wrong.

Dan Mills
  • 17,266
  • 1
  • 20
  • 38