An Embedded Systems Programming Environment for C

  • Bernd Burgstaller
  • Bernhard Scholz
  • Anton Ertl
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4128)


Resource constraints are a major concern with the design, development, and deployment of embedded systems. Embedded systems are highly hardware-dependent and have little computational power. Mobile embedded systems are further constrained by their limited battery capacity. Many of these systems are still programmed in assembly language because there is a lack of efficient programming environments.

To overcome or at least alleviate the restrictions, we propose a light-weight and versatile programming environment for the C programming language that offers mixed-mode execution, i.e., code is either executed on the CPU or on a virtual machine (VM). This mixed-mode execution environment combines the advantages of highly compressed bytecode with the speed of machine code.

We have implemented the programming environment and conducted experiments for selected programs of the MiBench suite and the Spec 2000. The VM has a footprint of 12 KB on the Intel IA32. Initial results show that the performance of the virtual machine is typically only 2 to 36 times slower than the binary execution, with compressed code occupying only 36%–57% of the machine code size. Combining sequences of VM instructions into new VM instructions (superinstructions) increases the execution speed and reduces the VM code size. Preliminary experiments indicate a speedup by a factor of 3.


Virtual Machine Compression Rate Machine Code Benchmark Program Program Language Design 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    eMedia Asia Ltd. and Gartner, Inc.: Embedded Systems Development Trends: Asia (2005),
  2. 2.
    Kernighan, B.W., Ritchie, D.M.: The C Programming Language. Prentice Hall Press, Upper Saddle River (1988)Google Scholar
  3. 3.
    Guthaus, M.R., Ringenberg, J.S., Ernst, D., Austin, T.M., Mudge, T., Brown, R.B.: MiBench: A Free, Commercially Representative Embedded Benchmark Suite. In: Proceedings of the IEEE 4th Annual Workshop on Workload Characterization (2001)Google Scholar
  4. 4.
    Hanson, D.R., Fraser, C.W.: A Retargetable C Compiler: Design and Implementation. Addison-Wesley, Reading (1995)MATHGoogle Scholar
  5. 5.
    Fraser, C.W.: A Retargetable Compiler for ANSI C. SIGPLAN Not 26, 29–43 (1991)CrossRefGoogle Scholar
  6. 6.
    Romer, T.H., Lee, D., Voelker, G.M., Wolman, A., Wong, W.A., Baer, J.L., Bershad, B.N., Levy, H.M.: The Structure and Performance of Interpreters. In: Proceedings of the 7th International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 150–159. ACM Press, New York (1996)CrossRefGoogle Scholar
  7. 7.
    Ertl, M.A., Gregg, D., Krall, A., Paysan, B.: vmgen — A Generator of Efficient Virtual Machine Interpreters. Software—Practice and Experience 32, 265–294 (2002)MATHCrossRefGoogle Scholar
  8. 8.
    Ertl, M.A., Gregg, D.: Building an Interpreter with vmgen. In: Horspool, R.N. (ed.) CC 2002 and ETAPS 2002. LNCS, vol. 2304, pp. 5–8. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  9. 9.
    Bell, J.R.: Threaded Code. Communications of the ACM 16(6) (1973)Google Scholar
  10. 10.
    Haible, B.: Foreign Function Call Libraries (2006),
  11. 11.
    Standard Performance Evaluation Corporation: Spec CPU 2000 (2000),
  12. 12.
    Debray, S., Evans, W.: Profile-Guided Code Compression. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, pp. 95–105. ACM Press, New York (2002)CrossRefGoogle Scholar
  13. 13.
    Levis, P., Culler, D.: Mate: A Tiny Virtual Machine for Sensor Networks. In: International Conference on Architectural Support for Programming Languages and Operating Systems, San Jose, CA, USA (2002)Google Scholar
  14. 14.
    Various: TinyVM (),
  15. 15.
    Lindholm, T., Yellin, F.: The Java Virtual Machine Specification, 2nd edn. Addison-Wesley, Reading (1999)Google Scholar
  16. 16.
    Aït-Kaci, H.: Warren’s Abstract Machine: A Tutorial Reconstruction. MIT press, Cambridge (1991)Google Scholar
  17. 17.
    Goldberg, A., Robson, D.: Smalltalk-80: The Language and Its Implementation. Addison-Wesley Longman Publishing Co., Inc., Boston (1983)MATHGoogle Scholar
  18. 18.
    Kelsey, R.A., Rees, J.A.: A Tractable Scheme Implementation. Lisp and Symbolic Computation 7, 315–335 (1994)CrossRefGoogle Scholar
  19. 19.
    Folliot, B., Piumarta, I., Riccardi, F.: A Dynamically Configurable, Multi-Language Execution Platform. In: Proc. of the 8th ACM SIGOPS European Workshop, pp. 175–181 (1998)Google Scholar
  20. 20.
  21. 21.
    Muller, G., Moura, B., Bellard, F., Consel, C.: Harissa: A Flexible and Efficient Java Environment Mixing Bytecode and Compiled Code. In: Proceedings of the 3rd Conference on Object-Oriented Technologies and Systems, Portland, OR, USA, Usenix, pp. 1–20 (1997)Google Scholar
  22. 22.
    Hoogerbrugge, J., Augusteijn, L., Trum, J., Wiel, R.V.D.: A Code Compression System Based on Pipelined Interpreters. Softw. Pract. Exper. 29, 1005–2023 (1999)CrossRefGoogle Scholar
  23. 23.
    Pugh, W.: Compressing Java Class Files. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 247–258 (1999)Google Scholar
  24. 24.
    Clausen, L.R., Schultz, U.P., Consel, C., Muller, G.: Java Bytecode Compression for Low-End Embedded Systems. ACM TOPLAS 22, 471–489 (2000)CrossRefGoogle Scholar
  25. 25.
    Bradley, Q., Horspool, R., Vitek, J.: JAZZ: An Efficient Compressed Format for Java Archive Files (1998)Google Scholar
  26. 26.
    Kistler, T., Franz, M.: A Tree-Based Alternative to Java Byte-Codes. International Journal of Parallel Programming 27(1), 21–33 (1999)CrossRefGoogle Scholar
  27. 27.
    Cooper, K.D., McIntosh, N.: Enhanced Code Compression for Embedded RISC Processors. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 139–149 (1999)Google Scholar
  28. 28.
    Ernst, J., Evans, W.S., Fraser, C.W., Lucco, S., Proebsting, T.A.: Code Compression. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 358–365 (1997)Google Scholar
  29. 29.
    Lekatsas, H., Wolf, W.: SAMC: A Code Compression Algorithm for Embedded Processors. IEEE Transactions on CAD 18, 1689–1701 (1999)Google Scholar
  30. 30.
    Latendresse, M., Feeley, M.: Generation of Fast Interpreters for Huffman Compressed Bytecode. In: IVME 2003: Proceedings of the 2003 Workshop on Interpreters, Virtual Machines and Emulators, pp. 32–40. ACM Press, New York (2003)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Bernd Burgstaller
    • 1
  • Bernhard Scholz
    • 1
  • Anton Ertl
    • 2
  1. 1.The University of Sydney 
  2. 2.Technische Universität Wien 

Personalised recommendations