C++ as an embedded language

Around 1983 when C++ had just been conceived and got its name, popular personal computer systems for a general audience, as well as businesses, had specifications like ones listed in the following table:

System

CPU

Clock speed (MHz)

RAM (KB)

ROM (KB)

Storage (KB)

BBC Micro

6502 (B+ 6512A)

2

16-128

32-128

Max 1,280 (ADFS floppy)

Max 20 MB (hard drive)

MSX

Zilog Z80

3.58

8-128

32

720 (floppy)

Commodore 64

6510

~1

64

20

1,000 (tape)

170 (floppy)

Sinclair ZX81

Zilog Z80

3.58

1

8

15 (cartridge)

IBM PC

Intel 8080

4.77

16-256

8

360 (floppy)

 

Now compare these computer systems to a recent 8-bit microcontroller (MCU) such as the AVR ATMega 2560 with the following specifications:

  • 16 MHz clock speed
  • 8 KB RAM
  • 256 KB ROM (program)
  • 4 KB ROM (data)

The ATMega 2560 was launched in 2005 and is among the more powerful 8-bit MCUs available nowadays. Its features stack up favorably against the 1980s computer systems, but on top of that the MCU does not rely on any external memory components.

The MCU core clock speed is significantly faster these days thanks to improved silicon IC manufacturing processes which also provide smaller chip sizes, high throughput, and thus lower cost and what's more, 1980s architectures commonly took 2 to 5 clock cycles to retrieve, decode, execute an instruction and store the result as opposed to the single-cycle execution performance of the AVR.

Current MCU (Static) RAM limitations are mostly due to cost and power constraints yet can be easily circumvented for most MCUs using external RAM chips, along with adding low-cost flash-based or other mass storage devices.

Systems like the Commodore 64 (C64) were routinely programmed in C, in addition to the built-in BASIC interpreter (in a built-in ROM). A well-known C development environment for the Commodore 64 was Power C published by Spinnaker:

Power C was one brand of productivity software aimed at C developers. It came on a single, double-sided floppy disk and allowed you to write C code in an editor, then compile it with the included compiler, linker, header files, and libraries to produce executables for the system.

Many more of such compiler collections existed back then, targeting a variety of systems, showing the rich ecosystem that existed for software development. Among these, C++ was of course a newcomer. The first edition of Stroustrup's The C++ Programming Language was only being published in 1985, yet initially without a solid implementation of the language to go with it.

Commercial support for C++ however began to appear rapidly, with major development environments such as Borland C++ 1.0 being released in 1987 and updated to 2.0 in 1991. Development environments like these got used in particular on the IBM PC and its myriad of clones where no preferred development language such as BASIC existed.

While C++ began its life as an unofficial standard in 1985, it wasn't until 1989 and the release of the The C++ Programming Language in its second edition as an authoritative work that C++ reached roughly the level of features equal to what would first be then standardized by an ISO working group as ISO/IEC 14882:1998, commonly known as C++98. Still it can be said that C++ saw significant development and adoption before the advent of the Motorola 68040 in 1990 and Intel 486DX in 1992, which bumped processing power above the 20 MIPS mark.

Now that we have considered early hardware specifications and the evolution of C++ alongside C and other languages of the time intended to be used on the relatively limited systems that existed back then, it seems plausible that C++ is more than capable of running on such hardware, and by extension on modern-day microcontrollers. However, it also seems necessary to ask to what extent the complexity added to C++ since then has impacted memory or computing performance requirements.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.136.142