Question:
Best standalone hardware platform to learn embedded programming using assembly language?
2013-10-18 12:01:50 UTC
I've been programming for around two years now, and having used a number of high-level languages such as VB, C++, C# and JavaScript, my curiosity about what goes on at the hardware level is increasing (fuelled by my interest in retro games and the development processes for early consoles). So... I've decided I want to learn some assembly language. Having done some assembly language using a PIC microcontroller while I was in college, I'm aware that assembly programming is difficult, cryptic and largely without purpose in an age where programming has evolved to much higher levels of abstraction. So I'm not here asking for advice on whether or not I should learn assembly language.

Rather than hoping to put my assembly knowledge to work in development, I'm interested in learning general, transferable concepts which will help to make me a "better programmer".

My question is, what do people think is the best stand-alone platform for learning assembly language? I'm planning on buying some type of microcontroller to learn on, and I want to make a good choice that will fit my level of experience.


My goals are:

> gain some transferable knowledge of the basic concepts of low-level programming which are common to most assembly languages

> The language I choose must be widely-used (eg. ARM, 68k, MASM) or at least similar enough so the basic concepts I learn will be transferable

> gain greater insight into how code gets executed "on the metal", in order to become a better high-level coder

> learn more about low-level computer hardware architecture (cpu/memory architecture)

> Learn some game programming in assembly to gain an insight into how games used to be developed back in the late 80s and early 90s, before the widespread use of compilers. Eventually I would like to program a simple video game (with graphical display, not just making LEDs flash).

> Learn to work within severe hardware/resource limitations (in this sense, the more limited the device, the better - as long as it is capable of something approaching SNES / Genesis performance I'll be happy).


I have already made a few decisions:

> 8 and 16 bit video game console development units are too expensive, too difficult to find, and information on development for these platforms is arcane and fairly scarce, which would make it unrealistically difficult for someone with my budget and level of knowledge. I am however considering buying an old Commodore 64 to use.

> I want to avoid x86 for now, until I have learned the fundamentals - my research suggests it is bloated and more difficult to learn than many other languages.

> I don't want to spend a large amount of money on hardware/software (in case my brain explodes and I decide assembly is too much for me), but that's not to say I wont shell out for a decent little microcontroller or something like the Raspberry Pi.


I'm interested in people's opinions on:

> Which hardware I should acquire to use as a learning platform (eg. different types of microcontrollers)

> What is the nicest/easiest assembly language for someone with my level of experience to learn. Something with a sensible syntax, plenty of documentation and a reasonable-sized group of active users would be great.


A couple of side questions:

> What is the best assembly language to learn if I want to improve my debugging skills and general programming practice?

> What would be the best assembly language to learn if I wanted to pursue a career in embedded software development?
Three answers:
Jonathan
2013-10-18 15:30:16 UTC
Nifty that you are into retro gaming. I don't know if you know it, but there are (or were just a few years ago) systems that used FPGAs and VHDL/verilog programming in order to create a platform that ran all manner of old video games -- including the huge console games found at pinball arcades, such as made by Atari. This ties directly into your interest of what is going on at the hardware level, because to program up the FPGAs, you have to know a lot at that level.



On your point about your implications that assembly programming may be a thing of the past, think again. There are many jobs and lots of people still doing assembly coding. You don't know much about it, because these devices are often embedded into other devices. I design and build and program such things. So I know. (I also know VHDL, verilog, and related tools, too.) But more to your point, you will be a MUCH BETTER programmer wielding a language like C (and even more so, C++, if you can believe it) if you know assembly coding and understand what compilers do with your code blocks, functions, etc. Knowing what an activation record is, or understanding how a derived class in C++ is constructed, or understanding what exception handling does in code generation in C++, makes remarkable differences in the way you choose to code and the performance of your resulting code. C++ and C compilers "optimize" the obvious, but there are usually several remarkably different ways of coding any single concept and compiler optimizers cannot and do not do "topology inversion" or other interesting methods of optimization. But knowing what they do and what they do not do, YOU can use that knowledge to choose properly between one and another approach.



It's not something that can be explained to someone who has NO experience with assembly. But to someone that does have that experience, I have no problems providing examples to make this point. (I will refrain from including some examples here in the interest of time and allowed space. But feel free to write me if you want me to provide a few of them.)



I've been self-employed in scientific and commercial instrumentation for most of my life. Even with the cheaper, larger, more capable microcontrollers available today, and the ease with which to find a C compiler for them, I can't think of a single embedded device that I've worked on where I didn't include at least some assembly coding. Even when the project is spec'd as C, there remains some things where assembly is the right approach. Cooperative threads, for example, can be usefully applied on even the smallest microcontrollers. And while C can be used for the rest, you still require a handful of assembly lines to perform the stack swaps needed. Just as an example.



I think the very best stand-alone system for learning to code assembly is the MSP430 from Texas Instruments. It has an excellent assembler tool (actually, several) and C and C++, as well. You can get them from IAR, Keil, and also Eclipse based gnu compilers, too. The IAR and Keil ones are code-size limited, but that isn't a problem for you. And their tools and debuggers are excellent. The main reason that the MSP430 is so good for assembly language, is that it is 16-bit. The 8-bit micros are just small enough that it takes sometimes complex groups of instructions to get a task done (a 16-bit counter timer cannot be read in a single instruction, for example.) The 32-bit micros are way too complex to get started on -- seriously, believe me, just figuring out how to configure one of those beasts to get to the first line of useful code is often a nightmare of documentation reading effort. By comparison, 16 bit is "just right." Not bounded on one side by registers that are too small, nor bounded on the other side by a flexibility that generates a configuration nightmare. But the MSP430 does include plenty of useful things to learn.



Specifically, I'd recommend the MSP430 LaunchPad unit. It's very cheap, too. However, if you want crystal controlled timing, you will have to solder on a 32.768kHz crystal onto the board. They leave that for you. These are excellent devices, run on very low power, and are resource-limited, too. They used to be $4.30 delivered to my home. But I think the price went up.



You indicate otherwise, but if you really want a 32-bit device, I'd recommend the STM32F3Discovery board. It can be picked up for about $11. 3D gyro, 3D accelerometer, magnetic compass, and lots more on it. But it will be a pain in the *** configuring. But there are lots of good tools out there for it, too.



For 8-bit, I'd stick with Microchip PIC and perhaps use the PIC18F family. Or for 32-bit, the PIC32 (which has my very favorite cpu architecture -- the MIPS M4K -- I learned RISC on an R2000 back in the mid-1980's directly from Dr. Hennessey.)
cheryll
2016-04-29 09:13:46 UTC
Mastering the foundational examining skills will allow your youngster to target on understanding the subject they're studying as opposed to struggle with knowledge what finally leading to a far more rewarding and satisfying reading experience and this really is in what this program Children Learning Reading from here https://tr.im/UG9lQ is based.

Children Learning Reading use practices to greatly help your son or daughter read and improve his reading, understanding, and spelling power in the early school years.

Although the Kids Learning Reading plan relies about your child understanding the little sounds that make up each word there are several phrases in the English language that only can not be learned in this manner (rhythm for example). In order to support one to show your son or daughter these excellent phrases an manual is provided to the most common words that must be learned by sight.

This advantage could be specially valuable if you and your youngster are fighting a specific word. You know that when the phrase is contained in the information then it's a thing that can not be discovered applying the Children Learning Reading method.
Rabies
2013-10-18 14:55:26 UTC
My freind used C++ .

I'm sure he can help you better then me.

This is the link to his website.

http://www.nuclearglory.com



He used assembly to make his game engine.

http://www.youtube.com/watch?v=Oa3o_Vdr344


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...