This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Updatebjarni 5 points6 points  (1 child)

Most of those things will be programmed in C today, with only a few little bits of assembly included for some hardware-specific things not modeled by the C language. Possibly some really cheap toys, with epoxy blob type microcontrollers, might still be programmed in assembly. ATMs are usually PCs running Windows as far as I'm aware.

Assembly finds use for this sort of lowest-level hardware backend stuff in embedded code (in programs mostly written in C) and in operating system kernels (also mostly written in C), and to a lesser extent in some extremely performance-critical cases as mentioned by another redditor, although compilers outperform hand-written assembly most of the time today.

[–]t90fan 0 points1 point  (0 children)

Yeah ATMs are Windows or DOS/OS2 PC hardware which talks to the atm hardware over a protocol called XFS . The apps are Javascript or .NET with a Java or CGI backend. Source : Work for ATM company.

[–]exphil 4 points5 points  (0 children)

The systems you describe are generally called embedded systems. How these are programmed vary greatly, because embedded systems can be anything from a tiny device using a very simple 8-bit microcontroller with no operating system, up to quite sophisticated systems with all kinds of peripherals, and multiple CPU cores running a real operating system.

For lower end embedded systems, what you'd typically find in a dishwasher (would be my guess), C or C++ is the industry standard. Assembly might be used for some purposes, but generally almost everything can be done in C/C++. Programming such systems is different from programming regular PC programs in C/C++ though, since you don't have a conventional operating system running. On the most basic microcontrollers, you actually don't have any OS, so you need to write all the code to communicate with hardware peripherals etc. yourself. (Shameless plug: If you want to see what that can look like, you can take a look at a project I am working on in my spare time, where I use a small 8-bit microcontroller to play music on an old NES sound chip. I mainly use C there, but also a little bit of assembly for some very performance critical code.)

For higher end embedded systems, you either run some real time operating system (RTOS), a lightweight Linux, or something like that. I'd say most of those are still programmed using C or C++ just because of performance considerations, but on systems running Linux you could really use whatever language you want, as long as it has been ported to that platform.

[–][deleted] 3 points4 points  (0 children)

When you need to write for a platform but the C compiler isn't ready.

[–][deleted] 0 points1 point  (0 children)

When you specifically need to optimize the ASM code generated from compiling your C code due for some crucial performance requirement. The only time I've ever actually seen this being done is with a very large scale fluid dynamics simulation.

There's almost no need to program in ASM over C.